Skip to main content
Glama

Attach file

attach_file

Attach base64-encoded file content to a task without altering its fields. Attach a .md report to clear the research-report review gate (RESEARCH_REPORT_REQUIRED); re-attaching a filename overwrites its bytes in place.

Instructions

Attach a file to a task (content as base64) without changing any of its fields. Re-attaching an existing filename overwrites its bytes in place — the file list gains no duplicate. Pass dryRun to validate without writing. A filename ending in .md is what satisfies the research-report gate: a type:"Research" task is refused review with RESEARCH_REPORT_REQUIRED until a .md is attached, so attaching the report is how to recover from that refusal. Use it for reports, screenshots and evidence; use add_comment for discussion text.

Input Schema

NameRequiredDescriptionDefault
idYesTask id — a full id, or any unique prefix of one, of the task to attach to. An id that matches nothing is refused with TASK_NOT_FOUND; no file is written.
dryRunNoPreview only: validate the filename and payload without writing a file.
filenameYesBare filename, no directory part. The EXTENSION decides acceptance: a .md is what satisfies the research-report gate, and an unsupported extension is refused with UNSUPPORTED_FILE_TYPE.
contentB64YesThe file content, base64-encoded (not raw bytes, and not a path to read). Required: omitting it is refused by input validation before the tool runs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.22.0
    • addedInput schema / properties / dryRun / description
      Added value: +"Preview only: validate the filename and payload without writing a file."
  2. Changed1 schema field changedv0.21.1
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observedv0.20.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses in-place byte overwrite with no duplicate entry on re-attach, that dryRun validates without writing, and that attaching a .md is what unblocks review of a Research task. Annotations only declare the generic write/idempotency profile, so this added mutation semantics carries real value.

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

Conciseness4/5

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

Front-loaded with the core action, then overwrite semantics, dryRun, and the gate rule in descending priority. It is dense but every sentence carries distinct information; the research-gate sentence restates the refusal consequence twice ('refused review ... so attaching the report is how to recover'), which is the only real redundancy.

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?

For a 4-parameter mutation with no output schema and no rich annotations, the definition covers write semantics, validation mode, failure codes and sibling routing. It does not say what a successful attach returns (file id, size, resulting file list), which leaves a small gap an agent may care about.

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 still adds meaning by tying the filename extension to acceptance and the research gate, and by tying id to the attach target and TASK_NOT_FOUND failure. The base64-vs-path distinction for contentB64 is left mostly to the schema.

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 ('Attach a file to a task') plus the payload form (base64) and the key invariant ('without changing any of its fields'). The final sentence contrasts it directly with the add_comment sibling, so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit use cases ('reports, screenshots and evidence'), a named alternative for the adjacent case ('use add_comment for discussion text'), a validation-only mode ('Pass dryRun'), and a concrete trigger/recovery path for the research gate (RESEARCH_REPORT_REQUIRED until a .md is attached). Both when-to-use and when-not-to-use are covered.

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