---
name: "google_drive_upload"
area: "googleworkspace"
title: "Write a Google Drive file"
price: "$0.001"
method: "POST"
url: "https://api.conecto.chat/v1/tools/google_drive_upload"
mcp_server: "https://api.conecto.chat/mcp/googleworkspace"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/googleworkspace/google_drive_upload"
---

# Write a Google Drive file (`google_drive_upload`)

Writes a text file into a Drive folder; replacing one waits for the owner.

Write a text file (up to 4 MB) into a Drive folder (My Drive when folder_id is left out). If a file with that name exists the new one gets a " (1)" name, unless if_exists is replace (which waits for the owner's approval by default) or fail. $0.001.

Price: $0.001 a call. A call that fails costs nothing.

## Use it when

The agent saves a report or a note where the team will look for it.

## Say this to your agent

> Save the October returns report in My Drive.

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `mailbox` | string | no | One of the mailboxes the agent may act as; optional when only one is connected. Up to 254 characters. |  |  |
| `name` | string | yes | 1 to 200 characters. |  |  |
| `content` | string | yes | Up to 4,000,000 characters. |  |  |
| `folder_id` | string | no | Up to 200 characters. |  |  |
| `if_exists` | string | no |  | `"rename"`, `"replace"`, `"fail"` | `"rename"` |

## Example

Written for Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon.

MCP: call `google_drive_upload` on the MCP server `https://api.conecto.chat/mcp/googleworkspace` with these arguments:

```json
{
  "mailbox": "support@halversoncycle.example",
  "name": "october-returns.md",
  "content": "# Returns in October\n\n14 returns, 3 of them a Tabor."
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/google_drive_upload \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mailbox": "support@halversoncycle.example", "name": "october-returns.md", "content": "# Returns in October\n\n14 returns, 3 of them a Tabor."}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "google_drive_upload",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.001",
  "balance_usd": "$19.75",
  "result": {
    "mailbox": "support@halversoncycle.example",
    "file": {
      "id": "1Zx8wV7uT6sR5qP4oN3mL2kJ1iH0gF9eD",
      "name": "october-returns.md",
      "size": 58,
      "folder": false,
      "type": "text/plain",
      "modified_at": "2026-10-14T08:00:00+00:00",
      "link": "https://drive.google.com/file/d/1Zx8wV7uT6sR5qP4oN3mL2kJ1iH0gF9eD/view",
      "replaced": false
    }
  }
}
```

`result`: mailbox; file: id, name, size, type, modified_at, link and replaced.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `not_connected` | 409 | Google Workspace isn't connected yet. | Connect it with google_connect. |
| `not_allowed` | 403 | The mailbox is not one the agent may act as. | Use a connected mailbox; the owner adds one by connecting again. |
| `vendor_rejected` | 502 | Google refused: delegation is missing a scope, or Google said no. | Ask the Workspace admin to grant what the message names. |
| `conflict` | 409 | A file with that name exists and if_exists is fail. | Pick another name, or rename or replace. |
| `too_large` | 413 | The content is over 4 MB. | Split it into smaller files. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [google_connect](https://conecto.chat/tools/googleworkspace/google_connect.md): Connects the company's Google Workspace through its own service account, for the mailboxes the agent may act as. Free.
- [google_mail_search](https://conecto.chat/tools/googleworkspace/google_mail_search.md): The newest messages in a mailbox, or those matching a Gmail search. Free up to 1,000,000 reads a month.
- [google_mail_read](https://conecto.chat/tools/googleworkspace/google_mail_read.md): One message in full, with its body as text and its attachments' names. Free up to 1,000,000 reads a month.
- [google_mail_send](https://conecto.chat/tools/googleworkspace/google_mail_send.md): Sends an email, or a reply in the same thread, as one of the company's mailboxes. $0.001 a call.
- [google_calendar_events](https://conecto.chat/tools/googleworkspace/google_calendar_events.md): The events in a mailbox's calendar between two times, in UTC. Free up to 1,000,000 reads a month.
- [google_calendar_create](https://conecto.chat/tools/googleworkspace/google_calendar_create.md): Adds an event to a mailbox's calendar and invites its attendees, with a Meet link if asked. $0.001 a call.
- [google_calendar_cancel](https://conecto.chat/tools/googleworkspace/google_calendar_cancel.md): Cancels an event and tells its attendees; waits for the owner by default. $0.001 a call.
- [google_drive_search](https://conecto.chat/tools/googleworkspace/google_drive_search.md): Files in a mailbox user's Drive, shared drives included, whose words match. Free up to 1,000,000 reads a month.
- [google_drive_read](https://conecto.chat/tools/googleworkspace/google_drive_read.md): A Drive file's words: Docs, Sheets, Slides, text, PDF or Office, up to 5 MB. Free up to 1,000,000 reads a month.
- [google_disconnect](https://conecto.chat/tools/googleworkspace/google_disconnect.md): Forgets the service account's key and the mailboxes; nothing in Google Workspace changes. Free.
