Skip to main content
Glama

APEX AI, LLM, Embeddings, OCR & Media

Json extract

json_extract
Read-onlyIdempotent

Extract structured JSON data from unstructured text (invoices, emails, receipts, pages) using fields or JSON Schema via Workers AI + deterministic JSON repair. $0.005 per call over x402 (Base, Solana or X1) or X-API-Key. Call once without payment for terms, then pass payment.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "json_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesUnstructured source text (1 to 14000 chars).
modelNoOptional model (default llama-3.3-70b).
fieldsNoField names to extract (required unless schema is provided).
schemaNoOptional JSON Schema object describing desired output.
paymentNosigned x402 payment payload (PAYMENT-SIGNATURE).
instructionNoOptional extra extraction rule.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations, the description discloses pricing ('$0.005 per call'), supported payment rails (Base, Solana or X1), an X-API-Key auth option, and a two-step payment handshake. These are exactly the operational details an agent needs to invoke the tool correctly and avoid surprise costs.

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, both front-loaded and waste-free: the first defines the purpose and mechanism, the second covers cost, auth, and the payment flow. No unnecessary repetition or filler.

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?

For a tool involving AI extraction and payment, the description covers purpose, cost, auth, and payment flow, which is most of what an agent needs. It could be slightly more complete by explicitly stating the return type (JSON) and any handling of the optional model or instruction parameters, but it is sufficient given the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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. The description adds value by clarifying the `fields` vs `schema` alternative ('using fields or JSON Schema') and, more importantly, by explaining the otherwise cryptic `payment` parameter's two-step usage: call without it first for terms, then pass it.

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 states a specific verb and resource: 'Extract structured JSON data from unstructured text (invoices, emails, receipts, pages)'. This is clear and distinguishes the tool's core function, but it does not explicitly contrast with siblings such as json_repair or page_extract, even though 'deterministic JSON repair' hints at one.

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 guidance is limited to the payment workflow: 'Call once without `payment` for terms, then pass `payment`'. There is no explicit guidance on when to use this tool instead of an alternative like page_extract or json_repair; the intended use is implied by the input examples (invoices, emails, receipts, pages).

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.