Skip to main content
Glama

x402 Structured Data & Headless Scraper

extract_structured_data

Read-only

Convert raw text, email bodies, receipts, logs, or HTML snippets already in memory into strict typed JSON conforming to target_schema. Use when you already have the source text and need deterministic schema enforcement without burning local reasoning tokens. Strictly capped at 6,000 bytes.

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": {
      "raw_text": "<raw_text>"
    },
    "name": "extract_structured_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
raw_textYesUnstructured text, HTML fragment, or document snippet to normalize (max 6,000 bytes).
preview_tokenNoOptional 300s preview token returned by preview_extract to immediately return the unmasked snapshot without re-processing.
target_schemaNoDeclarative key-type map defining the exact JSON structure to return.
include_metadataNoWhen true, wraps output in { data, meta: { resolved_url, status, block_reason, cached } }.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavior: deterministic schema enforcement, a 6,000-byte hard cap, and the token-saving rationale. It does not say what happens when input exceeds the cap or when the text cannot be coerced into target_schema, which is the main remaining gap.

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?

Three front-loaded sentences: what it does, when to use it, then the hard constraint. The 6,000-byte cap is stated twice (once in prose, once implicitly via maxLength in the schema), which is minor redundancy rather than waste.

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?

There is no output schema, but the description tells the agent the return is strict typed JSON shaped by target_schema, and the include_metadata wrapper is documented in the schema itself. The cap and determinism guarantee are covered. Failure modes for oversized or non-conformable input are the only notable omission for this read-only transformation tool.

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 description coverage is 100%, so raw_text, preview_token, target_schema, and include_metadata are already documented in structured fields. The description reinforces the role of target_schema as the conformance contract and the source types for raw_text, but adds no syntax or semantics beyond the schema. 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?

The description states a specific verb (Convert) and resources (raw text, email bodies, receipts, logs, HTML snippets), and it pins down the output (strict typed JSON conforming to target_schema). The phrase 'already in memory' distinguishes it from URL-fetching siblings such as extract_from_url and extract_dynamic_url without having to open their schemas.

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?

It gives an explicit invocation condition: use when you already have the source text and need deterministic schema enforcement without spending local reasoning tokens. The in-memory requirement implicitly excludes URL-based extraction, but no sibling is named as the alternative, so the routing is inferred rather than 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.