Skip to main content
Glama

Extend MCP

Parse a document to markdown/text

parse_document

Convert a document (PDF, image, Office doc, spreadsheet) into clean structured text — markdown by default (parse group). Right when the user wants the content of the pages ("OCR this", "what does this document say", feed text to another step); for specific field values — or when values need source citations/provenance — use extract_data instead. No saved resource needed. NEVER pull a whole multi-page document into context when only a section matters: pass pageRange to return just those pages, or split_document the bundle first and parse only the relevant segment's fileId — this applies even when you have not yet located the section. Full output of a long document is large — maxChars caps it; rawBlocks returns block-level structure (tables, figures, coordinates). Creates a parse run: may return status: "running" with a runId — normal, not an error; poll it with get_parse_run. Parse runs cannot be cancelled. Follow any llmContext guidance included in results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesDocument to parse. Exactly one of id/url — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
configNoParse config: { target?, chunkingStrategy?, blockOptions?, advancedOptions? } — e.g. blockOptions.tables.targetFormat, advancedOptions.pageRanges, Excel modes. Before authoring a config by hand, call get_documentation with https://docs.extend.ai/parsing/configuration.md and follow it.
maxCharsNoTruncation cap for returned text (default 50000); response sets truncated: true when hit.
metadataNoArbitrary key-value metadata stored on the run.
pageRangeNoReturn only these 1-indexed pages of the output (post-parse slice; the whole document is still parsed and billed).
rawBlocksNoReturn block-level output (chunks/blocks with types and page metadata) instead of concatenated markdown. Default false.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
runIdYes
chunksNoBlock-level output (rawBlocks: true).
statusYesTerminal status, or "running" (resume via the get tool).
runTypeNo
markdownNoConcatenated page-delimited markdown (default output).
pageCountNo
truncatedNo
llmContextNo
failureReasonNo
failureMessageNo

TDQS

A5/5.0
Behavior5/5

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

Goes well beyond annotations by disclosing that it creates a parse run, may return status 'running' with a runId (normal), cannot be cancelled, should be polled via get_parse_run, and that pageRange slices output post-parse while the whole document is still billed. These are critical behavioral details not present in annotations.

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?

The description is dense but every sentence earns its place, covering purpose, usage boundaries, async behavior, truncation, block output, and cancellation. It is front-loaded with the core conversion purpose before moving to caveats and alternatives.

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?

For a 9-parameter tool with nested objects and an output schema, the description covers all key operational concerns: async status handling, polling, cancellation, truncation, page-range behavior, raw-block output, billing implications, and environment/workspace targeting. Nothing essential is missing for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description adds substantial meaning beyond the schema: file must be exactly one of id/url, never a bare string; pageRange is 1-indexed; maxChars truncates and sets truncated=true; environment must match a granted target from get_me; config should follow get_documentation. This deepens parameter understanding significantly.

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 states a specific verb and resource: converts documents (PDF, image, Office, spreadsheet) into clean structured markdown/text, and explicitly contrasts itself with extract_data for field-value/provenance needs. This clearly distinguishes it from sibling tools like extract_data and split_document.

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 explicit when-to-use guidance ('when the user wants the content of the pages', 'OCR this', 'what does this document say') and explicit when-not-to-use alternatives ('for specific field values... use extract_data'). It also advises on partial-document scenarios with pageRange or split_document, and directs following llmContext guidance.

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.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct resource+action combination, and the descriptions actively disambiguate potential overlaps (e.g., extract_data vs parse_document, detect_form_fields vs edit_pdf, get_file vs get_file_upload). The consistent verb_noun prefix pattern makes the semantic boundary of every tool immediately recognizable.

Naming Consistency4/5

The dominant verb_noun pattern is highly consistent across all nine domains (list_*, get_*, create_*, update_*, delete_*, run_*, get_*_run, get_*_batch, publish_*_version). Minor deviations exist: deploy_workflow_version vs publish_*_version for the same freeze-a-draft concept, and get_form_detection_run doesn't mirror its detect_form_fields counterpart.

Tool Count2/5

86 tools is a very heavy agent-facing surface, well past the 25+ threshold. The count is inflated by the near-identical 13-tool lifecycle repeated across extract, classify, and split (each with list/get/create/update/publish/runs/batches/versions), and while each tool has a distinct purpose, the sheer volume makes selection harder.

Completeness4/5

Core lifecycles are thoroughly covered: create → update → publish → run (single and batch) → poll → cancel → delete-run → list runs/versions. Notable gaps include no delete tool for extractors, classifiers, splitters, workflows, or evaluation sets, and edit/form-detection runs have no list endpoint (documented workaround: keep run IDs). These are hygenic gaps that don't block primary workflows.

Resources