Skip to main content
Glama

chat.media.upload

Uploads a file attachment to a Google Chat space for use in messages or import workflows.

Instructions

Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) You can upload attachme [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON UploadAttachmentRequest object accepting filename; pass it via params or whole via body_file Siblings over the same resource: download.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
parentYes[URL path segment] Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}".
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON UploadAttachmentRequest object.
request_bodyNoRequest body of type UploadAttachmentRequest: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
attachmentDataRefNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON UploadAttachmentRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type UploadAttachmentRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "filename": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / parent / description
      Previous value: -"Required. Resource name of the Chat space in which the attachment is uploaded. Format \"spaces/{space}\"."New value: +"[URL path segment] Required. Resource name of the Chat space in which the attachment is uploaded. Format \"spaces/{space}\"."
    • addedInput schema / properties / parent / pattern
      Added value: +"^spaces/[^/]+$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "attachmentDataRef": {
      +      "properties": {
      +        "attachmentUploadToken": {
      +          "type": "string"
      +        },
      +        "resourceName": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden, and it does disclose key traits: HTTP POST that creates/triggers a change, refusal under --readonly profiles, the required OAuth scopes, and that the response is the API resource as JSON. It omits important downstream behavior (that the returned attachment reference presumably must be attached to a message) and any size/type limits on uploads.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, but the body contains a visibly truncated fragment ("You can upload attachme") and inline documentation links that interrupt flow. The appended HTTP-method/safety note is useful but reads as bolted-on metadata rather than integrated prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need no explanation, and the description covers auth scopes, a mode restriction, and mutation/readonly behavior for a 6-parameter tool. The main gap is not explaining what the agent should do with the resulting attachment object or any upload constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description restates that the body is an UploadAttachmentRequest accepting a filename and can be passed via params or body_file, which duplicates what the schema already documents rather than adding new meaning to the params, query, or dry_run fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Uploads an attachment" gives a specific verb and resource, and the trailing note "Siblings over the same resource: download" explicitly distinguishes it from chat.media.download. It stops short of naming the space/message context, but an agent can identify the operation without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists required auth scopes and notes that the import scope is valid only in import-mode spaces, which implicitly tells the agent about preconditions. However, it never states when to choose this over posting via chat.spaces.messages.create or how the uploaded attachment is subsequently consumed, so usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools