Skip to main content
Glama

Doxtract

Parse document

parse_document

Extract structured fields from a PDF, PNG, JPEG, or text file sent as base64 in file_base64, or from plain text sent in text (10 MB and 10 pages on Free, 25 MB on Starter and Pro, 100 MB on Business; pages per document by plan: Starter 50, Pro 200, Business 500). 1 credit per page; an image is 1 page; text is 1 credit per 3,000 characters. Nothing is stored. Send exactly one of file_base64 or text. The result has status and values. Set citations to true to also get, for each value, the page, the printed text, and a box where it was read.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "parse_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoThe document as plain text, for example a pasted invoice or email. 1 credit per 3,000 characters (started), at least 1. At most 30,000 characters on Free and 150,000 on paid plans. The text is not stored. Send this or file_base64, not both.
schemaNoThe slug of a layout saved in this workspace, or a literal layout object (sent in the `schema` JSON field). A layout is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes.
strictNoA long document is read in chunks of pages. By default a chunk that cannot be read leaves a partial result: status "partial", the pages that failed in failed_page_ranges, and credits only for the pages that were read. When true, any chunk that cannot be read fails the whole parse with CHUNK_FAILED (502) and no credits are used. Default false.
citationsNoWhen true, the result also has citations: for each value's path, the page, the printed text it was read from, a box [x0, y0, x1, y1] on the page (0 to 1 from the top left), and a status saying whether the text was found in the document. Same credits. Default false.
file_base64NoBase64-encoded PDF, PNG, JPEG, or UTF-8 text file (.txt, .md, .csv, .eml). At most 10 MB and 10 pages on Free, 25 MB on Starter and Pro, 100 MB on Business; pages per document are set by plan (Starter 50, Pro 200, Business 500). Each page costs 1 credit; an image is 1 page; text is 1 credit per 3,000 characters. The bytes are not stored. Send this or text, not both.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the full cost/limit model (1 credit per page, 1 credit per 3,000 characters, plan-based page and MB ceilings), the no-storage guarantee, and the alternative failure mode controlled by strict (partial result with failed_page_ranges vs CHUNK_FAILED 502 with no credits). These are exactly the behavioral traits the readOnlyHint:false / idempotentHint:false annotations cannot convey.

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 opening sentence front-loads the action, accepted formats, and input location before any qualifiers, and each subsequent sentence covers a distinct concern (limits, credits, exclusivity, result, citations). The long plan-limit parenthetical is dense and duplicates the schema's file_base64 description, costing it a point.

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 no output schema, the description does carry the return burden and handles it reasonably: it names status and values, the per-value citation fields, and the partial/failed_page_ranges shape under strict. What it does not explain is the structure of values itself or the non-strict error surface, a modest gap for a five-parameter commercial parsing endpoint.

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 schema already documents each of the five parameters in depth, including the layout grammar and the citations payload. The description largely restates that content (the one-of constraint, the citations flag, the result's status and values) without adding format detail the schema lacks, so the baseline of 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?

The description names a specific verb and resource ("Extract structured fields from a PDF, PNG, JPEG, or text file") and enumerates the two input modes plus the optional citations output, so an agent knows exactly what the tool does. It does not, however, explicitly contrast itself with nearby siblings such as upload_document or create_schema, leaving that routing to inference.

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?

Usage is implied rather than stated: the agent can infer this is the tool for turning a document into structured data, and the mutual-exclusion rule ("Send exactly one of file_base64 or text") is spelled out. There is no explicit when-not guidance and no named alternative for the adjacent tasks (uploading, schema creation) that the sibling list suggests exist.

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.