Skip to main content
Glama

Extract named fields of one PDF as JSON (paid, x402)

doc_json
Read-only

PAID: read named labels out of a PDF and get one JSON value per field (text, number or date), for $0.0100. We fetch it; no OCR. A label we cannot find is null, never a guess. Unpaid, it returns the price; pay with x402 (USDC on Base, Solana, Polygon, Arbitrum, Avalanche, Sei or X Layer) in _meta['x402/payment'] and call again. Feedback: POST /feedback (free). Read daily; no individual reply.

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": "doc_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoThe absolute http(s) URL of the PDF, e.g. https://arxiv.org/pdf/1706.03762v7.
fieldsNoThe labels to read, 1..10, e.g. [{"name":"abstract","label":"Abstract","kind":"text"}].
maxPagesNoRead at most this many pages: 1..20. Omitted means 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, so safety is covered; the description adds genuinely new behavior: the $0.0100 charge, the price-return-on-unpaid handshake, the x402 retry protocol with accepted chains, and the crucial 'a label we cannot find is null, never a guess' guarantee. Minor tension: it fetches an arbitrary user-supplied URL, which sits awkwardly with openWorldHint=false, though that is a server-side fetch rather than a clear contradiction. A 4 reflects strong added context beyond the annotations.

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 'PAID' and the price, then the operation, then the payment mechanics — a sensible ordering for an agent that must budget before calling. It is dense with no wasted sentences, though the trailing feedback/response-policy note is operational boilerplate that does not help an agent decide or invoke. Slight over-packing keeps it at 4.

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 still tells the agent the return shape (one JSON value per field keyed by name, null when not found) and the unpaid-call behavior, which is the critical unknown for a paid tool. Page limits and field-count limits live in the schema. Only the exact success-response envelope is left unstated, a small gap.

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 url, fields, name, label, kind and maxPages are all documented in the schema with limits and matching rules. The description reinforces the field-kind semantics ('text, number or date') and the null result for unfound labels, but adds no format, syntax or edge-case detail about the parameters themselves. Baseline 3 is appropriate when the schema carries the load.

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?

States a concrete verb and resource: read named labels out of a PDF and return one JSON value per field, with kinds (text, number, date) and the explicit constraint 'no OCR'. That is far more specific than a generic 'extract PDF' and implicitly separates it from plain-text extraction siblings. It stops short of naming the sibling it should not be used instead of (e.g. doc_text), so it lands at 4 rather than 5.

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?

The payment workflow is spelled out well: unpaid calls return the price, payment goes in _meta['x402/payment'] across seven chains, then call again. What is missing is selection guidance — nothing says when to pick this field-based extractor over the sibling doc_text or scrape_page, or what document types it handles poorly. Usage is implied by the tool's nature rather than contrasted with alternatives.

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.