Skip to main content
Glama

Attach a document to a transaction

attach_document
Idempotent

Attaches a stored document (from list_documents) to a bank transaction as its evidence — confirming a match_ambiguous proposal (pass one of its candidate_ids) or manually resolving an awaiting_transaction/extraction_failed document. This links evidence only: it NEVER creates or changes a booking. Already-matched documents are refused (attachments are never silently re-pointed). event_id is a classified event id, e.g. from list_documents proposal.candidate_ids or get_unreviewed_events. actor_id is optional and defaults to the organisation entity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
org_idNoOptional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected.0e91146d-511c-469f-bdee-5c867b26ae0d
actor_idNoOptional. Defaults to the organisation entity (correct for an org-scoped key). If provided, it must be an entity belonging to this organisation — arbitrary UUIDs are rejected, so the audit trail cannot be attributed to someone else.
event_idYesThe transaction (classified event) it evidences.
document_file_idYesThe document to attach (list_documents).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
matched_viaYes
document_file_idYes
matched_event_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description adds meaningful behavior beyond the annotations: it states that the call 'links evidence only' and 'NEVER creates or changes a booking', and that already-matched documents are refused so attachments are never silently re-pointed. This complements the idempotent and non-destructive hints without contradicting them.

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?

Four sentences with no filler. The action and scope are front-loaded, and every sentence adds a constraint, source reference, or safety clarification needed for correct invocation.

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

Completeness5/5

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

With an output schema present and annotations covering idempotence and destructiveness, the description covers all call-relevant context: purpose, source of event IDs, refusal behavior, org-scoped defaults, and the guarantee that no booking mutation occurs. Nothing essential is missing.

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 adds extra value by explaining that event_id is a classified event id, e.g. from list_documents proposal.candidate_ids or get_unreviewed_events, and by clarifying that actor_id defaults to the organisation entity. This goes beyond the schema property descriptions.

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 description opens with a specific verb and resource: 'Attaches a stored document ... to a bank transaction as its evidence'. It also names the two triggering scenarios (confirming a match_ambiguous proposal or resolving awaiting_transaction/extraction_failed documents), which clearly differentiates it from siblings like list_documents or approve_classification.

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?

Usage conditions are explicit: it should be used to confirm a match_ambiguous proposal with one of its candidate_ids or to manually resolve an awaiting_transaction/extraction_failed document. It also gives a clear when-not-to-use signal: already-matched documents are refused and it never creates or changes a booking, and it names source tools for event_id.

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