gmail__upload_attachment
Use this instead of returning Gmail attachment bytes through model/tool context.
Access
Requires a project integration connection for gmail.
Call type: Can change resources.
Arguments
| Field | Type | Required | Description and constraints |
|---|---|---|---|
project_reference | string | No | Project ID or slug |
message_id | string | Yes | Gmail message ID containing the attachment. Minimum length: 1. |
attachment_id | string | Yes | Gmail attachment ID from the message payload part body. Minimum length: 1. |
file_path | string | Yes | Destination upload path (e.g., gmail-proof/originals/invoice.pdf). Raw JSON path; spaces, Unicode and literal percent characters are accepted. Do not URL-encode. |
content_type | string | No | MIME type to store with the upload. Defaults to application/octet-stream because Gmail attachment bodies do not include content type. Minimum length: 1. |
expected_size | integer | No | Optional exact decoded byte size guard. The tool fails if decoded bytes do not match. |
max_bytes | integer | No | Optional decoded attachment size limit in bytes. Defaults to 104857600 and is capped at 536870912. Maximum: 536870912. |
Example request
Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See MCP client setup.
request.json
1{2 "jsonrpc": "2.0",3 "id": 1,4 "method": "tools/call",5 "params": {6 "name": "gmail__upload_attachment",7 "arguments": {8 "message_id": "example",9 "attachment_id": "example",10 "file_path": "example"11 }12 }13}Result
The published output shape is summarized below. Inspect both the MCP response content and isError when handling a call.
| Field | Type | Required | Description and constraints |
|---|---|---|---|
upload_id | string | Yes | Persisted upload UUID. Format: uuid. |
file_path | string | Yes | Storage path including the project id prefix. Prefer path when chaining upload tools. get_upload_download_url also accepts this legacy value within the same project. |
path | string | Yes | Path relative to the project root, without the project id. Pass this path value as the upload_reference of get_upload_download_url and as the path of the other upload tools. |
file_name | string | Yes | Filename from the stored project-relative path. |
content_type | string | Yes | Effective stored MIME type; application/octet-stream when unavailable. Minimum length: 1. |
size | integer | Yes | Actual stored byte size, including zero. Reused uploads retain their stored size; fresh downloads obey the tool byte limit. Minimum: 0. Maximum: 9007199254740991. |
status | string | Yes | Persisted upload status returned by the storage record, normally active. |
Full schemas
input-schema.json
1{2 "type": "object",3 "properties": {4 "project_reference": {5 "type": "string",6 "description": "Project ID or slug"7 },8 "message_id": {9 "type": "string",10 "minLength": 1,11 "description": "Gmail message ID containing the attachment."12 },13 "attachment_id": {14 "type": "string",15 "minLength": 1,16 "description": "Gmail attachment ID from the message payload part body."17 },18 "file_path": {19 "type": "string",20 "description": "Destination upload path (e.g., gmail-proof/originals/invoice.pdf). Raw JSON path; spaces, Unicode and literal percent characters are accepted. Do not URL-encode."21 },22 "content_type": {23 "type": "string",24 "minLength": 1,25 "description": "MIME type to store with the upload. Defaults to application/octet-stream because Gmail attachment bodies do not include content type."26 },27 "expected_size": {28 "type": "integer",29 "exclusiveMinimum": 0,30 "description": "Optional exact decoded byte size guard. The tool fails if decoded bytes do not match."31 },32 "max_bytes": {33 "type": "integer",34 "exclusiveMinimum": 0,35 "maximum": 536870912,36 "description": "Optional decoded attachment size limit in bytes. Defaults to 104857600 and is capped at 536870912."37 }38 },39 "required": [40 "message_id",41 "attachment_id",42 "file_path"43 ],44 "additionalProperties": false,45 "description": "Arguments for the gmail__upload_attachment tool.",46 "$schema": "http://json-schema.org/draft-07/schema#"47}output-schema.json
1{2 "type": "object",3 "properties": {4 "upload_id": {5 "type": "string",6 "format": "uuid",7 "description": "Persisted upload UUID."8 },9 "file_path": {10 "type": "string",11 "description": "Storage path including the project id prefix. Prefer `path` when chaining upload tools. `get_upload_download_url` also accepts this legacy value within the same project."12 },13 "path": {14 "type": "string",15 "description": "Path relative to the project root, without the project id. Pass this `path` value as the `upload_reference` of `get_upload_download_url` and as the path of the other upload tools."16 },17 "file_name": {18 "type": "string",19 "description": "Filename from the stored project-relative path."20 },21 "content_type": {22 "type": "string",23 "minLength": 1,24 "description": "Effective stored MIME type; application/octet-stream when unavailable."25 },26 "size": {27 "type": "integer",28 "minimum": 0,29 "maximum": 9007199254740991,30 "description": "Actual stored byte size, including zero. Reused uploads retain their stored size; fresh downloads obey the tool byte limit."31 },32 "status": {33 "type": "string",34 "description": "Persisted upload status returned by the storage record, normally active."35 }36 },37 "required": [38 "upload_id",39 "file_path",40 "path",41 "file_name",42 "content_type",43 "size",44 "status"45 ],46 "additionalProperties": false,47 "description": "Structured download url to project upload output schema for MCP tools.",48 "$schema": "http://json-schema.org/draft-07/schema#"49}