Skip to main content
Glama

AgentDiet AI Token Diet & Context Window Distiller

extract_structured_data

Read-onlyIdempotent

Extract machine-readable structured data from a web page: Schema.org JSON-LD objects, OpenGraph metadata, HTML tables parsed as JSON row arrays, fenced code blocks, section headings, and links. WHEN TO USE: Call this tool for pricing tables, API specifications, product metadata, or code snippets; use distill_webpage for narrative Markdown or recon_webpage_skeleton for a lightweight heading outline. WHEN NOT TO USE: Do not use for narrative prose extraction or binary files. PARAMETER INTERACTIONS: Provide either url or html (when html is supplied, url is not fetched and only labels the cache key). Omit agent_id and tx_hash during your 5 free calls. Read-only and idempotent; results are cached for 1 hour (<5ms cache hit). $0.001 per call ($0.0005 cached). Pricing: the first 5 calls per agent_id are free and failed calls are never charged. After 5 calls, the tool returns a payment-required quote (not a fatal error) with a $2 Stripe top-up link and Base/Solana USDC addresses; complete payment, then retry with your agd_pass_ key in agent_id or pass tx_hash. Example: extract_structured_data(url='https://docs.stripe.com/api')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget public HTTP(S) webpage URL to fetch (or builtin://stripe-docs for a built-in benchmark page). Private/loopback IPs are blocked.
htmlNoOptional raw HTML string (up to ~1.9MB) to process directly without network fetching. When provided, url is not fetched and only labels the cache entry.
tx_hashNoOptional on-chain Base Mainnet (0x...) or Solana SPL USDC transaction hash. Omit unless settling an individual call directly on-chain instead of using an agd_pass_ key in agent_id.
agent_idNoOptional agent identifier or prepaid agd_pass_ session key. Omit during your 5 free trial calls to use an ID automatically derived from your client IP, or pass your agd_pass_ key after topping up.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoStructured tool output payload.
statusYesExecution status ('ok' or 'payment_required').
roi_proofNoToken compression and cost-savings verification metrics.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, openWorld, non-destructive), yet the description goes well beyond them: 1-hour caching with <5ms hits, a 5-free-call trial, a non-fatal payment-required quote with Stripe/Base/Solana settlement paths, and the fact that failed calls are never charged. This is the pricing and failure-mode context an agent needs before calling.

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?

Front-loaded core purpose followed by labeled WHEN TO USE / WHEN NOT TO USE / PARAMETER INTERACTIONS blocks, with the pricing detail last. The pricing paragraph is dense but each sentence carries operative information (free-call count, quote-not-error behavior, retry credentials); slightly overlong, keeping it just below a 5.

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?

An output schema exists, so return-value explanation is unnecessary, and the description instead covers routing, parameter interaction, caching, and the payment lifecycle. For a paid, cached, network-fetching extractor, nothing an agent needs to invoke it successfully is missing.

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 already 100%, so the baseline is 3, but the description adds genuine cross-parameter semantics: url or html is either/or, and when html is supplied the url only labels the cache key rather than being fetched. It also clarifies that agent_id and tx_hash should be omitted during the free calls, which the individual schema descriptions only imply.

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 (extract) and resource (structured data from a web page) and enumerates the concrete artifact types returned: JSON-LD, OpenGraph, HTML tables as JSON rows, code blocks, headings, links. It also names the sibling tools it is distinct from, so an agent can route correctly without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit WHEN TO USE with concrete scenarios (pricing tables, API specs, product metadata, code snippets) and explicit alternative routing to distill_webpage for narrative Markdown and recon_webpage_skeleton for a lightweight outline. WHEN NOT TO USE closes the remaining ambiguity (narrative prose, binary files).

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