Skip to main content
Glama

docs

Document Pipeline

document_pipeline
Idempotent

One call: PDF invoice to parse (hallucination-guarded OCR) + field extraction + arithmetic verification (+optional issuer enrich). Flat $0.05/document; inputs validated before payment. Choose this when a PDF is an invoice/receipt and you want parse + field extraction + arithmetic verification in one paid call; for text only use parse_document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute http(s) URL of the input (web page or PDF, per tool)
enrichNoAlso run issuer enrichment on the parsed invoice
x_paymentNoOptional: base64 X-PAYMENT header value (x402 exact scheme, USDC on Base mainnet). Omit it to receive the payment requirements (accepts[] + docs) for this call without being charged.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesJSON body of the underlying call (see /samples/{product} for each product's shape)
statusYesHTTP status of the underlying call (200 result, 402 payment terms, 4xx input error)
how_to_payNo
receipt_idNoset on paid results; free re-fetch via get_receipt
payment_requiredNotrue when status is 402: body holds x402 payment terms, not a result. Pay and call again with x_payment

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Goes beyond annotations by disclosing cost ($0.05/document), that inputs are validated before payment (no charge on invalid input), and that OCR is hallucination-guarded. Annotations already cover idempotency and non-destructiveness, so this adds real value; it could say more about failure modes or what the enrich step returns, but the paid-call semantics are unusually well covered.

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 pipeline summary, then cost, then selection guidance. Dense but every clause carries information; the parenthetical asides make it slightly busier than necessary, keeping it just short of a 5.

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?

With an output schema present the return values need no explanation, and annotations cover the safety profile. The description supplies purpose, cost, selection rule, and alternative, so nothing an agent needs to invoke it correctly is missing.

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 coverage is 100%, so all three parameters (url, enrich, x_payment) are already documented. The description echoes the optional enrich step but adds no syntax, format, or constraint detail beyond the schema, so the baseline 3 applies.

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+resource chain (parse PDF invoice, extract fields, verify arithmetic, optional enrich) and explicitly distinguishes itself from the sibling parse_document by input type ('for text only use parse_document'). An agent can select it without opening either schema.

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 an explicit when-to-use condition ('when a PDF is an invoice/receipt and you want parse + field extraction + arithmetic verification in one paid call') plus a named alternative (parse_document) for the text-only case. Both the selection rule and the exclusion are stated.

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