Skip to main content
Glama

Document to JSON

Extract Document to JSON

extract_document

Extract structured JSON from any document text. Auto-detects document type (invoice, receipt, contract, purchase_order, bill) and extracts relevant fields: vendor, customer, line items, totals, dates, parties, obligations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesRaw document text (invoice, receipt, contract, etc.)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries full behavioral burden. It usefully discloses the auto-detection behavior (type is inferred, not supplied), which is real behavioral context beyond the schema. But it says nothing about failure modes, unrecognized document types, non-determinism, or size/rate limits.

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?

Two sentences, zero waste, and the core action is front-loaded ahead of the field enumeration. Nothing padded.

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?

There is no output schema, so the description must convey the return shape – and it does by listing the extracted field groups (vendor, customer, line items, totals, dates, parties, obligations). That covers the essentials for a one-parameter tool, though edge-case behavior remains unstated.

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% for the single 'text' parameter, so the baseline is 3. The description's phrase 'any document text' and its list of document types adds modest expectation-setting but no new syntax or format detail beyond the schema.

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?

States a specific verb and resource ('Extract structured JSON from any document text') and enumerates the auto-detected document types and target field groups, so an agent knows exactly what comes out. No siblings exist to differentiate from, 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?

Usage is implied by 'from any document text' – the agent can infer it takes raw document text. However, there is no explicit when-to-use context, no note on what happens with unsupported document types, and no guidance on input size or format limits beyond what the schema states.

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.

Resources