Skip to main content
Glama

add_document

Destructive

Attach a document (typed info) to a record BY REFERENCE — no file bytes, url just points at something hosted elsewhere. Required: entity ('lead'|'contact'|'account'|'campaign'), entity_id, title. Optional: doc_type (default 'note'), description (the analyzable text), source, url, amount, currency, status, occurred_at (ISO). To attach an actual FILE (get it stored + optionally AI-summarized), use upload_document instead.

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": {
      "entity": "<entity>",
      "entity_id": "<entity_id>",
      "title": "<title>"
    },
    "name": "add_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoLink to where the document is hosted
titleYesTitle of the document
amountNoAmount
entityYesRecord type the document is attached to: lead, contact, account or campaign
sourceNoOrigin of the document (optional provenance)
statusNoInitial status
currencyNoCurrency code (ISO 4217, e.g. EUR)
doc_typeNoType of document (default 'note')
entity_idYesID of the record
descriptionNoDescription of the document
occurred_atNoWhen it happened (ISO 8601)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedInput schema / properties / amount / description
      Added value: +"Amount"
    • addedInput schema / properties / currency / description
      Added value: +"Currency code (ISO 4217, e.g. EUR)"
    • addedInput schema / properties / description / description
      Added value: +"Description of the document"
    • addedInput schema / properties / doc_type / description
      Added value: +"Type of document (default 'note')"
    • addedInput schema / properties / entity / description
      Added value: +"Record type the document is attached to: lead, contact, account or campaign"
    • addedInput schema / properties / entity_id / description
      Added value: +"ID of the record"
    • addedInput schema / properties / occurred_at / description
      Added value: +"When it happened (ISO 8601)"
    • addedInput schema / properties / source / description
      Added value: +"Origin of the document (optional provenance)"
    • addedInput schema / properties / status / description
      Added value: +"Initial status"
    • addedInput schema / properties / title / description
      Added value: +"Title of the document"
    • addedInput schema / properties / url / description
      Added value: +"Link to where the document is hosted"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, idempotentHint=false, so the mutation profile is covered; the description adds the genuinely non-obvious behavior that nothing is stored locally and the url is merely a pointer, and that description is the analyzable text. It stops short of saying what is returned (an id?) or what happens when the same url is attached twice, despite idempotentHint=false.

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 semantic distinction and the required-field list before the alternative-tool caveat. Dense and waste-free, though the flat enumeration of optional parameters largely restates the schema and could be trimmed.

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 an 11-parameter mutation with no output schema, the description covers the essentials: what is stored, what is required, the reference-not-bytes contract, and the sibling routing. The remaining gap is the response shape and duplicate-attach behavior, which matters given idempotentHint=false but is a minor omission against full schema coverage.

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 the baseline is 3. The description adds modest meaning — grouping entity/entity_id/title as required, restating doc_type's default, and hinting that description holds the analyzable text — but most parameters (amount, currency, status, source, occurred_at) get no extra semantics beyond 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 document ... to a record') plus the decisive qualifier 'BY REFERENCE — no file bytes', which separates it from every file-upload sibling in one clause. An agent can identify the operation without opening the 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 an explicit when-not rule with the named alternative: 'To attach an actual FILE (get it stored + optionally AI-summarized), use upload_document instead.' It also names the required fields, so the agent knows both the routing decision and the minimum call shape.

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.