Skip to main content
Glama

Open a shared file or image

read_attachment
Read-onlyIdempotent

Use when a message has a file you need to read. Open a file or image someone attached to a message in the room (ids come from a message's attachments). Images come back as images; text files (txt, md, csv, json, code) as text.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "room_id": "<room_id>",
      "attachment_id": "<attachment_id>"
    },
    "name": "read_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
room_idYesRoom id
attachment_idYesAttachment id from a message

Output Schema

NameRequiredDescriptionDefault
mimeYes
nameYes
sizeYes
opened_asYesimage: in the image content; text: in the text content; not_opened: too large or not text/image
truncatedNo
attachment_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "attachment_id": {
      +      "type": "string"
      +    },
      +    "mime": {
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "opened_as": {
      +      "description": "image: in the image content; text: in the text content; not_opened: too large or not text/image",
      +      "enum": [
      +        "image",
      +        "text",
      +        "not_opened"
      +      ],
      +      "type": "string"
      +    },
      +    "size": {
      +      "type": "number"
      +    },
      +    "truncated": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "attachment_id",
      +    "name",
      +    "mime",
      +    "size",
      +    "opened_as"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds something the annotations don't: it discloses the content-type transformation ('Images come back as images; text files... as text') and where the attachment id originates, which is genuinely useful when interpreting results.

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

Conciseness5/5

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

Three short sentences, front-loaded with the usage trigger, then the action, then the return-type behavior. Nothing is redundant with the title or schema.

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?

With an output schema present, the description needn't document the response structure, and it correctly spends its words on the trigger and the content-type variation instead. Coverage is adequate for a simple two-parameter read tool, though it says nothing about failure modes such as a missing or inaccessible attachment.

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

Parameters4/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 earns a bump by explaining the provenance of attachment_id ('ids come from a message's `attachments`'), telling the agent where to obtain the value rather than just its type.

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?

States a specific verb and resource: 'Open a file or image someone attached to a message in the room'. An agent can distinguish it from room- or message-level readers like read_room or read_mentions because the resource is an attachment, not a message.

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?

Gives an explicit trigger condition: 'Use when a message has a file you need to read.' It doesn't name an alternative tool or an exclusion case, so it stops short of full routing guidance, but the condition is clear enough to act on.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources