Skip to main content
Glama

x402 Structured Data & URL 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).
target_schemaNoDeclarative key-type map defining the exact JSON structure to return.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / raw_text / examples
      Removed value: -[
      -  "Invoice #1042 from Acme Corp — Total: $249.00 USD, Due: 2026-12-01"
      -]
    • removedInput schema / properties / target_schema / examples
      Removed value: -[
      -  {
      -    "due_date": "string",
      -    "invoice_id": "string",
      -    "total_usd": "number",
      -    "vendor": "string"
      -  }
      -]
  2. 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 safety is covered; the description adds real value beyond that by promising deterministic schema enforcement, no local reasoning-token cost, and a hard 6,000-byte cap. It stops short of describing behavior on schema violations or unparseable input, which matters for a normalizer.

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 tight sentences, front-loaded with the transformation and followed by the usage condition and constraint. The trailing 'Strictly capped at 6,000 bytes' partially duplicates the raw_text maxLength, a small redundancy in an otherwise lean text.

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 carries the return-value burden and does so by stating the output is strict typed JSON shaped by target_schema. Size limits and usage context are present; only error/validation behavior is left unstated for this two-parameter 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 both raw_text and target_schema are already documented. The description restates the byte cap and the role of target_schema without adding format or syntax detail beyond the schema, so 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?

Names a specific verb (Convert) plus the input resource (raw text, email bodies, receipts, logs, HTML snippets) and the exact output form (strict typed JSON conforming to target_schema). The phrase 'already in memory' implicitly separates it from extract_from_url, so an agent can pick between them without opening either schema.

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 triggering condition: 'Use when you already have the source text and need deterministic schema enforcement'. The no-siblings-named gap is minor since the in-memory precondition is what actually discriminates the choice, but no explicit when-not or failure guidance is given.

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.

Resources