fetch_from_drive
What it does
Streams a Google Drive file into R2 and creates the matching content + upload rows. Handles either a raw fileId or any standard Drive sharing URL (/file/d/<id>/view, ?id=<id>, etc.).
Refreshes the workspace's cached OAuth token automatically when needed.
Input schema
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| file_id | string | required | — |
Drive file id or sharing URL. |
| content_id | string | optional | — |
Attach to an existing content. Omit to create a new one. |
| title | string | optional | — |
Required when content_id is omitted. |
| brand | string | optional | — |
Optional brand label. |
| area | string | optional | "raw" |
One of raw, review, grafica. Uploading into review auto-flips the content to Attesa Approvazione. |
Example call
json{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "fetch_from_drive", "arguments": { "file_id": "https://drive.google.com/file/d/1abcDEFghijKLM/view", "title": "Raw bin — espresso b-roll", "brand": "CorpoSostenibile", "area": "raw" } } }
Response shape
json{ "ok": true, "content_id": "c_xyz789", "upload_id": "u_abc123", "r2_key": "your-slug/raw/CorpoSostenibile/Raw bin — espresso b-roll/1716301234567-raw_001.mp4", "size_bytes": 12345678, "drive_file_id": "1abcDEFghijKLM", "filename": "raw_001.mp4", "content_type": "video/mp4", "area": "raw", "created_content": true }
Usage from Claude Desktop
prompt"Pull this Drive file into Lumiqa as new raw content: https://drive.google.com/file/d/1abc.../view"
Usage from Python
pythonimport requests LUMIQA = "https://lumiqa.io/mcp/your-slug" HEADERS = {"Authorization": "Bearer lk_live_xxxxxxxxxxxx"} r = requests.post(LUMIQA, headers=HEADERS, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "fetch_from_drive", "arguments": {"file_id": "https://drive.google.com/file/d/1abc/view", "title": "Raw bin"} }, }) print(r.json())
Usage from Node
javascriptconst r = await fetch("https://lumiqa.io/mcp/your-slug", { method: "POST", headers: { "Authorization": "Bearer lk_live_xxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "fetch_from_drive", arguments: { file_id: "https://drive.google.com/file/d/1abc/view", title: "Raw bin" }, }, }), }); const data = await r.json(); console.log(data);
Required env vars / integrations
- Workspace OAuth row in
workspace_integrationswithplatform = 'google_drive'— connected via/settings/integrations. - R2 binding
UPLOADS.
Known limitations
- 500 MB cap — R2 single-shot limit. For bigger files, use a chunked-upload worker (not shipped yet).
- Cannot download native Google Docs / Sheets / Slides — export them first.
- Refresh token revocation surfaces as a clear "reconnect at /settings/integrations" error.
- Has anti-orphan rollback: if the DB insert fails, the R2 object is deleted to avoid ghost uploads.