Skip to main content
Glama

chat.spaces.messages.attachments.get

Retrieve metadata for a Google Chat message attachment so you can inspect its details before fetching the attachment data via the media API.

Instructions

Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment. Requires app authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot [HTTP GET]. Returns the requested resource as JSON — request bodies are built from the typed parameters (typed flags win over the params map), or read whole from body_file

Input Schema

NameRequiredDescriptionDefault
nameYes[URL path segment] Required. Resource name of the attachment, in the form `spaces/{space}/messages/{message}/attachments/{attachment}`.
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
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.

Output Schema

NameRequiredDescriptionDefault
nameNo
sourceNo
contentNameNo
contentTypeNo
downloadUriNo
driveDataRefNo
thumbnailUriNo
attachmentDataRefNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Required. Resource name of the attachment, in the form `spaces/{space}/messages/{message}/attachments/{attachment}`."New value: +"[URL path segment] Required. Resource name of the attachment, in the form `spaces/{space}/messages/{message}/attachments/{attachment}`."
    • addedInput schema / properties / name / pattern
      Added value: +"^spaces/[^/]+/messages/[^/]+/attachments/[^/]+$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "attachmentDataRef": {
      +      "properties": {
      +        "attachmentUploadToken": {
      +          "type": "string"
      +        },
      +        "resourceName": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "contentName": {
      +      "type": "string"
      +    },
      +    "contentType": {
      +      "type": "string"
      +    },
      +    "downloadUri": {
      +      "type": "string"
      +    },
      +    "driveDataRef": {
      +      "properties": {
      +        "driveFileId": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "source": {
      +      "enum": [
      +        "SOURCE_UNSPECIFIED",
      +        "DRIVE_FILE",
      +        "UPLOADED_CONTENT"
      +      ],
      +      "type": "string"
      +    },
      +    "thumbnailUri": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the required app authentication, the exact `chat.bot` authorization scope, the HTTP GET method, and that the response is a JSON resource. It does not describe error behavior or that the trailing request-body machinery is irrelevant for a GET.

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?

The purpose and auth details are front-loaded and useful, but the final sentence about building request bodies from typed parameters or `body_file` is irrelevant for a GET endpoint and reads as wrapper boilerplate rather than earning its place.

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 needn't be spelled out, and the description covers purpose, alternative path for the actual media, auth scope, and method. It is essentially complete for an agent to call it correctly, with only minor noise from the request-body boilerplate.

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% and the `name` parameter already documents the required `spaces/{space}/messages/{message}/attachments/{attachment}` form and pattern, so the baseline is 3. The description adds nothing about `name`, `query`, `params`, or `dry_run` beyond generic boilerplate that typed parameters override the `params` map.

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

Purpose5/5

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

States a specific verb and resource ('Gets the metadata of a message attachment') and immediately clarifies that the bytes themselves come from the media API, which is exactly the distinction an agent needs against the sibling chat.media.download. No ambiguity about what this call returns.

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

Usage Guidelines4/5

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

The description tells the agent when to use this (metadata) versus the linked media API (actual attachment data), and adds an example link. It stops short of naming the concrete sibling tool `chat.media.download` or stating exclusions/preconditions beyond auth.

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