Skip to main content
Glama

Extract JSON fields from text: turn unstructured text into a JSON object with the fields you name

ai_extract_json
Read-only

Pull named fields out of unstructured text (emails, invoices, listings, bios) and get them back as a JSON object, with null for anything not present. Use to turn messy text into structured data for an agent. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
textYesSource text, up to 12,000 characters
fieldsYesComma-separated field names to extract (1-30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=false, but the description adds meaningful context beyond them: per-call pricing ($0.01/call via x402 USDC or card key), first 25 free, failed calls free, and the fact that repeats are charged. It also states output behavior—null for missing fields—which is important for an extraction tool.

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?

The purpose is front-loaded in the first sentence, followed by usage, then pricing/safety information. Every sentence adds something useful, though the pricing/safety sentence is slightly dense and could be split for readability.

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?

For a simple two-parameter extraction tool with no output schema, the description covers purpose, output shape, billing model, and safety profile. Combined with a fully described input schema and informative annotations, an agent has everything needed to decide when and how to call it.

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 the two parameters (text and fields) are fully documented in the schema with character limits and field-count constraints. The description only implies 'named fields' and does not add syntax or format details beyond what the schema already provides; baseline 3 is appropriate.

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 ('pull named fields out of unstructured text') and the return shape (JSON object with null for missing fields). This is clearly distinguishable from sibling tools like ai_classify, ai_summarize_text, or ai_answer, which transform text in other ways rather than extracting named fields.

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?

Gives a clear usage statement: 'Use to turn messy text into structured data for an agent,' with example source types (emails, invoices, listings, bios). It does not explicitly name alternative tools or exclusions (e.g., use ai_classify for categories), so it stops short of a 5.

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.