Skip to main content
Glama

Save Docling document

save_docling_document

Save a cached document to disk as Markdown and JSON, optionally exporting only a specific page to Markdown while keeping the full JSON document.

Instructions

Save a document from the local document cache to disk in both markdown and JSON formats.

This tool takes a document that exists in the local cache and saves it to the specified cache directory with filenames based on the document key. Both markdown and JSON versions of the document are saved. When page_no is set, only that page is saved in markdown, to a page-specific file, while the JSON file still contains the full document.

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_key": "<document_key>"
    },
    "name": "save_docling_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
page_noNoPage number to export to the markdown file (1-based). When omitted, all pages are exported. The JSON file always contains the full document.
document_keyYesThe unique identifier of the document in the local cache.

Output Schema

NameRequiredDescriptionDefault
md_fileYes
json_fileYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.2
    • addedInput schema / properties / page_no
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Page number to export to the markdown file (1-based). When omitted, all pages are exported. The JSON file always contains the full document.",
      +  "title": "Page No"
      +}
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only say it is a non-read, non-destructive write, so the description carries real weight and it does: it discloses that two files are written, that filenames derive from the document key, and that page_no narrows only the markdown file while JSON stays complete. It never explains how the target 'cache directory' is determined or what happens on an overwrite, which keeps it from a 5.

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 the page_no caveat. It is slightly repetitive, restating 'both markdown and JSON versions' after already saying 'in both markdown and JSON formats', but nothing is wasted enough to hurt.

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 only two parameters, full schema coverage, annotations for the write profile, and an output schema, the remaining need is explaining the dual-file write and page_no asymmetry — both are covered. The only soft spot, where the target directory comes from, is minor.

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 both parameters are already documented in the schema, including the page_no markdown-only nuance. The description restates rather than extends that meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: saves a cached docling document to disk as markdown plus JSON, which is more specific than the title alone. It never names the near-identical sibling export_docling_document_to_markdown, so an agent must guess which is the right 'write to disk' tool.

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

Usage Guidelines3/5

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

The phrase 'takes a document that exists in the local cache' implies the precondition (the doc must already be cached), which is useful usage context. But there is no explicit when-to-use/when-not guidance and no routing to or away from export_docling_document_to_markdown or check_document_in_local_cache.

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