search_files
Search Google Drive files by name or content across My Drive and accessible shared drives, with optional folder and MIME type filters.
Instructions
Search for files in Google Drive by name or content. Without folder_id, searches 'My Drive' AND every shared drive the authenticated account can access (corpora='allDrives').
For a spreadsheet-only search, search_spreadsheets(query, max_results) is a narrower convenience wrapper around this same query pre-filtered to the spreadsheet MIME type.
Args: query: Search string matched against file name and full text. mime_type: Optional MIME type filter, e.g. 'application/vnd.google-apps.document', 'application/vnd.google-apps.spreadsheet', 'application/pdf'. folder_id: Optional folder to restrict the search to. max_results: Maximum results to return (default 20, max 100).
Returns: List of matching files with id, name, mimeType, modified time, owners, parent folder, webViewLink, and starred status. Trashed files are excluded; to find one to restore, use get_file_metadata or restore_file with its file ID.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| folder_id | No | ||
| mime_type | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |