Skip to main content
Glama

Export Docling document to markdown format

export_docling_document_to_markdown
Read-only

Convert a cached Docling document into a markdown string for display or further processing, with optional single-page export and character limit.

Instructions

Export a document from the local document cache to markdown format.

This tool converts a Docling document that exists in the local cache into a markdown formatted string, which can be used for display or further processing. Set page_no to export a single page instead of the whole 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": "export_docling_document_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
page_noNoPage number to export (1-based). When omitted, all pages are exported.
max_sizeNoThe maximum number of characters to return.
document_keyYesThe unique identifier of the document in the local cache.

Output Schema

NameRequiredDescriptionDefault
markdownYes
document_keyYes

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 (1-based). When omitted, all pages are exported.",
      +  "title": "Page No"
      +}
  2. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds that the source must exist in the local document cache and that output is a markdown string, but says nothing about failure when the key is absent or about size limits beyond the schema's own max_size field.

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, and the page_no hint is placed after the main statement. The clause 'which can be used for display or further processing' is filler that could be trimmed, but overall it is tight.

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 an output schema present, the description needn't explain return values, and annotations cover the read-only profile. It is complete enough for a straightforward export tool, though a note on behavior for missing or uncached document keys would close the remaining gap.

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 all three parameters are already documented, including page_no's 1-based semantics and max_size's character cap. The description's page_no note duplicates the schema rather than adding meaning, so 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 and resource — export a cached Docling document to markdown — and the conversion to a markdown string makes the output distinctive among siblings like get_text_of_document_item_at_anchor. It doesn't explicitly contrast with any sibling, but the purpose is unambiguous.

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 only guidance is 'Set page_no to export a single page instead of the whole document', which is parameter usage rather than when-to-use-this-tool guidance. No mention of when to prefer other extraction tools (e.g., anchor-based text retrieval) or prerequisites such as the document already being in the cache.

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