Skip to main content
Glama

AIDataParser

Parse a document into structured JSON

parse_document

Extract clean, schema-guaranteed JSON from a PDF or image. Provide the document via url or base64. Pass an optional JSON schema to constrain the output shape, and instructions to guide extraction. Returns the extracted data plus a confidence score and a review_needed flag. Costs 1 credit per successful call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic http(s) URL of the PDF or image to parse.
base64NoBase64-encoded document bytes (alternative to `url`). Provide `media_type` alongside it.
redactNoWhen true, PII (emails, SSNs, card numbers, phones, etc.) is masked in the output before it leaves the server.
schemaNoOptional JSON Schema describing the exact output shape you want. When provided, the returned `data` conforms to it.
schema_idNoOptional named template to use instead of a hand-written schema, e.g. "invoice", "receipt", "resume". Call the list_schemas tool for the full set. Ignored when `schema` is provided.
media_typeNoMIME type for `base64` input, e.g. application/pdf, image/png, image/jpeg.
instructionsNoOptional natural-language guidance for what to extract.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the behavioral burden. It adds useful context by stating there is a per-call credit cost, that cost applies only to successful calls, and that the output includes a confidence score and review_needed flag. It does not discuss failure modes or side effects, but for a read-oriented parsing tool this is substantial disclosure.

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 two tightly packed sentences with no filler. It front-loads the core purpose, then covers input, output, and cost in order of importance.

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 or annotations, the description correctly summarizes return values and the important credit cost. It omits nothing critical for invocation because the input schema already documents all seven parameters and their relationships, though it could have explicitly guided users between schema, schema_id, and instructions.

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 baseline is 3 and the schema already documents all parameters. The description reiterates that url/base64 are input alternatives and that schema/instructions are optional, but it does not add much meaning beyond the schema's own parameter descriptions.

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 uses a specific verb ('Extract') and resource ('PDF or image') and states the result is 'clean, schema-guaranteed JSON'. It distinguishes itself from parse_text by explicitly framing the input as PDF/image rather than text.

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?

The description clearly says the tool is for PDFs or images and supports url or base64 input, plus optional schema and instructions. It does not explicitly name when to use parse_text, infer_schema, or validate instead, so it stops short of full alternative routing.

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.