Skip to main content
Glama

Add Document to Draft

add_document_to_draft
Destructive

Append a document to an existing Draft. Provide exactly one of document_base64, document_url, or template_id. A multi-document template inserts ALL of its documents (each counts toward the limit of 10) and name is then not allowed. role_mapping (template only) maps the template's roles onto this envelope's roles, e.g. {"customer": "client"}; unmapped roles are inserted as-is, never guessed. Fields already placed keep their pages; inserted pages come after them. Returns the draft with its documents[] (page ranges) so you can place fields with document_id + document-relative page. Requires Authorization: Bearer zs_....

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": {
      "document_id": "<document_id>"
    },
    "name": "add_document_to_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
filenameNodocument.pdf
document_idYes
template_idNo
document_urlNo
role_mappingNo
document_base64No

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, openWorldHint=true, and non-idempotence; the description adds substantive behavior beyond them: a multi-document template inserts ALL documents and each counts toward the 10-document limit, unmapped roles are inserted as-is and never guessed, existing field pages are preserved, and inserted pages come after existing ones. The auth requirement ('Authorization: Bearer zs_...') is also disclosed.

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?

The action and mutual-exclusion rule are front-loaded, and each subsequent sentence adds a real constraint rather than filler. It is densely packed with backticked identifiers and reads as a run-on, but little could be cut without losing a genuine constraint.

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 7-parameter mutation with a destructive annotation and an output schema present, the definition covers selection rules, template edge cases, ordering effects, and auth. The only meaningful gap is the semantics of the `filename` parameter, and return values are already covered by the output schema.

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 0%, so the description carries the burden; it explains the mutual exclusivity of document_base64/document_url/template_id, the conditional prohibition on `name`, the shape and fallback behavior of role_mapping, and how document_id is used for field placement. It leaves `filename` and `document_id` as an input source largely unexplained, which keeps this below a 5.

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: 'Append a document to an existing Draft.' The append-to-draft scope distinguishes it from siblings like prepare_document, download_signed_document, or create_template without needing 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 Guidelines4/5

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

It states the exclusive-choice rule ('Provide exactly one of document_base64, document_url, or template_id') and the conditional restriction that `name` is not allowed when a multi-document template is used, which is genuine when-to-use guidance. It does not, however, route the agent toward or away from adjacent siblings such as prepare_document or update_draft.

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