Skip to main content
Glama

extract_json

Extract JSON embedded in arbitrary text — LLM prose, chat messages, logs, emails — then repair and validate it. Deterministic extraction is free. If no JSON can be located and allow_llm_fallback is true, a paid LLM extracts structured data from the text (requires x402 payment; charged only on success). Pass a JSON Schema to shape the output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesText that may contain JSON
schemaNoOptional JSON Schema the output must conform to
allow_llm_fallbackNoPermit the paid LLM extraction tier

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses free deterministic path, paid LLM fallback with payment details, and optional schema shaping. Missing details on rate limits or output format, but overall transparent about core behavior.

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?

Four sentences, front-loaded with main purpose, then free/paid distinction, then schema advice. Each sentence earns its place. Could be more compact but no redundancy.

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?

Moderate complexity (3 params, no output schema). Description covers extraction modes, payment, and schema use. Lacks explicit output description but reasonably complete for its class.

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 coverage is 100% for all 3 parameters. The description adds context beyond schema: explains schema role 'shape the output' and allow_llm_fallback's payment implications. This adds value, justifying above baseline 3.

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 clearly states the tool extracts JSON from arbitrary text, with repair and validation. It distinguishes from siblings (infer_schema, repair_json, validate_json) by combining extraction with optional LLM fallback and schema shaping, making it the primary extraction tool.

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 explains when to use deterministic extraction vs paid LLM fallback, including the x402 payment requirement and success-only charging. It also suggests using a JSON Schema to shape output. Implicitly, it is for messy text, but explicit when-not-to-use guidance is missing.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: extract JSON from text, infer schema from data, repair malformed JSON, and validate against a schema. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (extract_json, infer_schema, repair_json, validate_json), making them predictable and easy to distinguish.

Tool Count5/5

With 4 tools, the server is well-scoped for its purpose of JSON handling. Each tool addresses a distinct need without excess or deficiency.

Completeness4/5

The tool set covers core JSON operations: extraction, schema inference, repair, and validation. Minor gaps exist (e.g., no transformation or generation), but the surface is largely complete for common tasks.