Drive Tools
manage_drive — search your Drive and convert files to native Google Spreadsheets.
manage_drive
Two actions: search and convert_to_spreadsheet.
action: "search"
Searches Google Drive for files matching a query. Automatically excludes trashed files (and trashed=false is always appended).
| Parameter | Type | Required | Description |
|---|---|---|---|
action | "search" | ✓ | — |
query | string | ✓ for search | Drive search query string |
Returns up to 20 files per call (hardcoded pageSize: 20).
Response
{
"files": [
{
"id": "1a2B3cD4eF5g",
"name": "sales_q2.csv",
"mimeType": "text/csv",
"webViewLink": "https://drive.google.com/file/d/...",
"createdTime": "2026-04-01T10:00:00.000Z"
}
]
}Drive query syntax
The query field uses the Drive Files API query syntax:
| Goal | Query |
|---|---|
| Find by name | name contains 'report.csv' |
| Find by exact name | name = 'Q2 Sales.xlsx' |
| Find only spreadsheets | mimeType = 'application/vnd.google-apps.spreadsheet' |
| Find CSVs | mimeType = 'text/csv' |
| Name contains AND type | name contains 'sales' and mimeType = 'text/csv' |
Note
and trashed=falseis always appended to every query automatically. You do not need to add it.
action: "convert_to_spreadsheet"
Converts a Drive file (CSV, TSV, XLSX, ODS) to a native Google Spreadsheet using the Drive API's server-side conversion (files.copy with mimeType: application/vnd.google-apps.spreadsheet). No client-side parsing.
| Parameter | Type | Required | Description |
|---|---|---|---|
action | "convert_to_spreadsheet" | ✓ | — |
fileId | string | ✓ | Drive file ID from search |
filename | string | ✗ | New name for the converted spreadsheet |
Response
{
"spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
"name": "sales_q2",
"url": "https://docs.google.com/spreadsheets/d/.../edit",
"hint": "Use this spreadsheetId with list_sheets, analyze_range, or transform_range."
}The hint field is literal text from the server response — it tells agents what to do next without needing to reason about it.
End-to-end CSV workflow
1. manage_drive(action: "search", query: "name contains 'sales_q2.csv'")
→ get fileId
2. manage_drive(action: "convert_to_spreadsheet", fileId: "...", filename: "Sales Q2 2026")
→ get spreadsheetId
3. list_sheets(spreadsheetId: "...")
→ confirm tab structure
4. analyze_range(spreadsheetId: "...", range: "Sheet1!A:Z", query: "SELECT ...")
→ query the converted dataWarning: Conversion creates a new Google Spreadsheet — it does not modify the original Drive file. The original CSV/XLSX remains in Drive unchanged.
Supported source formats
From the source code comment: CSV, TSV, XLSX, ODS — anything Drive can convert server-side via the files.copy mimeType override.