Drive: Search Tool
Usage
All Portia tools using API endpoints that require OAuth are built with plug and play authentication support. They use Portia client credentials including client ID, client name and redirect URL. Such tools will raise a Action Clarification
with an OAuth link as the action URL. The portia.wait_for_ready()
method must be used in this scenario: Portia's OAuth server will listen for the authentication result and resolve the concerned clarification, allowing your plan run to resume again.
For more on this, please visit to the section on running Portia tools (↗).
Tool details
Tool ID: portia:google:drive:search
Tool description: Search for files and folders in Google Drive. Google Drive stores proprietary files like Google Docs, Sheets, and Slides. It also stores regular files like PDFs, images, and videos or even files from other apps like Microsoft docx, xlsx, pptx, etc. Use this tool to search for files using a search query. This tool should be used to resolve name / file descriptions into concrete file IDs for other Google tools to use when needed.
Args schema:
{
"description": "Schema for the Google Drive search tool.",
"properties": {
"query": {
"description": "The query to search for. ALWAYS EXCLUDE words like 'doc', 'sheet', 'spreadsheet', 'file' from the end query string. For example if the query is 'cash flow forecast spreadsheet', the query string should be 'cash flow forecast'",
"title": "Query",
"type": "string"
},
"mime_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the files to search for. Use this if you want to search for files with a specific type of file or file extension. For example, 'application/pdf' or 'pdf'. Uses RFC 6838 standard for MIME types.",
"title": "Mime Type"
}
},
"required": [
"query"
],
"title": "GoogleDriveSearchToolSchema",
"type": "object"
}
Output schema:
('dict', 'dict: Dictionary containing the results of the Google Drive search. Each file result includes metadata like name, id, mimeType and more.')