Skip to main content
Glama

agents_add_file

Attach a file to this agent's private knowledge (agent-specific files, not shared with other agents).

Workflow:

  1. Upload the file with files_upload (pass source_url for remote files)

  2. Index it with files_ingest (pass the file_id)

  3. Call this tool with agent_id + file_id

Returns chunk_count — shows 0 while still processing. Call agents.list_files later to see the final chunk count once indexing completes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesfile_id returned by files_upload or files_ingest
agent_idYesID of the agent to attach the file to
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  2. Added
  3. Removed
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare it is a write (readOnlyHint=false), not destructive, and not idempotent, so the safety profile is covered. The description adds genuinely new behavioral context: indexing is asynchronous, the returned chunk_count reads 0 while processing, and final state must be checked later via agents.list_files. It omits failure modes such as re-attaching a duplicate file or a file that was never ingested.

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?

Purpose is front-loaded in one sentence, followed by a tight three-step numbered workflow and a single return-value caveat. Every sentence carries information; nothing is restated or padded.

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 no output schema, the description correctly compensates by explaining the chunk_count return and its transient zero value, and the pipeline prerequisites are fully spelled out. It leaves minor gaps around duplicate attachments and permission requirements, but is otherwise sufficient to invoke the tool correctly.

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 description coverage is 100%, so file_id, agent_id, and in_workspace are already documented in the schema, including that file_id comes from files_upload or files_ingest. The description reinforces the file_id provenance through its workflow but adds no new syntactic or semantic detail beyond the structured fields, so the baseline 3 applies.

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?

The first sentence gives a specific verb and resource ("Attach a file to this agent's private knowledge") and immediately scopes it against the sibling concept by clarifying these are agent-specific files "not shared with other agents." An agent can distinguish this from collections_add_file or a shared-knowledge tool without opening any schema.

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 numbered workflow explicitly sequences prerequisites (files_upload, then files_ingest, then this tool) and names the exact parameters to pass at each step, which is strong when-to-use guidance. It stops short of stating when NOT to use this tool (e.g. shared collections vs. agent-private knowledge), so it falls just short of 5.

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.