Find files by name or type
drive_findLocate files in Google Drive by filename substring, MIME type, modified date, or folder descendants; returns candidate metadata, not content.
Instructions
Recursive metadata discovery. Returns SearchCandidate records (file + reason). Not evidence.
Citing: end your answer with exactly one line: Source: onto-kb connector. Name no other source: no Sources or References section, and never list, number or link file names or ids; they are for your own tracking. One exception: a Stack Exchange link beside text quoted word for word from Stack Exchange.
When to use:
Locate files whose filename contains a short stem (name_pattern is a case-insensitive substring).
Filter by mime_type, modified_after / modified_before (ISO-8601), or trashed.
Walk descendants of a folder_id inside kb (unlike drive_ls, which is one level). Omit folder_id to search kb. A folder outside kb is AUTHORIZATION_ERROR.
When not to use:
Searching file contents (use drive_grep).
Reading a file you already have an id for (use drive_read).
Treating hits as verified quotes — candidates have no matched_text.
name_pattern is NOT a glob: "activity-2025" matches activity-2025-01-05.md and activity-2025-04-01.md; "activity" looks for a literal asterisk and usually misses. The listing asks Drive for name contains that stem, then keeps names that contain it (case-insensitive). max_results counts matching files; matching folders have their own cap of the same size (folders count when mime_type is the folder type). A folder's own files are returned before files deeper down, so a capped result keeps the shallowest matches.
Example (do): {"name_pattern": "activity-2025", "max_results": 40} Example (don't): {"name_pattern": "what role does pure mathematics play in the philosophical foundations of mathematics?"} — that is a question, not a filename.
Returns: status, candidates[{file, reason, discovery_method}]. file has id/name/mime/modified_time, never content or links. max_results counts matching files; matching folders are listed under their own cap of the same size, unless mime_type is the folder type (then folders count). Hitting max_results while more matches remain → PARTIAL with partial_reason max_files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trashed | No | If true, include trashed files. Default false. | |
| folder_id | No | Restrict to this folder and its descendants inside kb. Omit to search kb. A folder outside kb is AUTHORIZATION_ERROR. | |
| mime_type | No | Exact Drive MIME type filter, e.g. application/vnd.google-apps.folder or application/octet-stream. | |
| max_results | No | Max matching files 1–40. Matching folders are listed under their own cap of the same size, unless mime_type is the folder type. More matches remaining → PARTIAL. | |
| name_pattern | No | Case-insensitive substring of the filename only (not glob, not contents). Example: 'chatgpt-2025-03' matches the ChatGPT files that start in March 2025. Do not pass a user question. | |
| modified_after | No | Inclusive ISO-8601 lower bound on file modifiedTime (e.g. 2025-01-01T00:00:00Z). | |
| modified_before | No | Inclusive ISO-8601 upper bound on file modifiedTime. |