Skip to main content
Glama

Extract Structured Data

extract_structured
Read-onlyIdempotent

Extract structured data from a URL or raw text into strict JSON matching a schema you provide. Fields the content doesn't support come back null - never an invented or approximate value, and an unmatchable schema returns an explicit error. Try GET /extract/sample. Part of the AgentIndex content kit (pdf, web-read, extract, summarize, detect-language) - see GET /capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to read and extract from. Provide this or text, not both.
textNoRaw text to extract from. Provide this or url, not both.
schemaYesJSON Schema describing the fields to extract. The response's `data` field will strictly conform to it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesExtracted data, matching the requested schema's shape - fields the content doesn't support come back null rather than an invented value (see missing_fields).
x402_receiptNoBilling and provenance receipt for this call.
missing_fieldsYesTop-level keys in data the model could not find in the content and returned as null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / properties / data / description
      Previous value: -"Extracted data, strictly conforming to the requested schema."New value: +"Extracted data, matching the requested schema's shape - fields the content doesn't support come back null rather than an invented value (see missing_fields)."
    • addedOutput schema / properties / missing_fields
      Added value: +{
      +  "description": "Top-level keys in data the model could not find in the content and returned as null.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "data"
      -]New value: +[
      +  "data",
      +  "missing_fields"
      +]
  2. Changed4 schema fields changed
    • addedInput schema / properties / schema / description
      Added value: +"JSON Schema describing the fields to extract. The response's `data` field will strictly conform to it."
    • addedInput schema / properties / text / description
      Added value: +"Raw text to extract from. Provide this or url, not both."
    • addedInput schema / properties / url / description
      Added value: +"URL to read and extract from. Provide this or text, not both."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data": {
      +      "description": "Extracted data, strictly conforming to the requested schema.",
      +      "type": "object"
      +    },
      +    "x402_receipt": {
      +      "description": "Billing and provenance receipt for this call.",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  3. Added

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, openWorldHint), yet the description adds genuinely non-obvious behavior: unsupported fields return null rather than invented or approximate values, and an unmatchable schema produces an explicit error. Those guarantees are exactly what an agent needs to trust the output and are not derivable from the annotations.

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 core behavior and its key guarantees are front-loaded in the first two clauses, and the tool-discovery pointers (sample endpoint, capabilities list) are appended rather than interleaved. It is slightly dense with promotional kit references, but every sentence carries information.

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?

With an output schema present and rich annotations, the description need not explain return values, and it still adds the error and null semantics that matter most for a schema-driven extractor. Nothing an agent needs to invoke it correctly is missing.

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 url, text, and schema are already fully documented in the structured fields. The description restates the url-or-raw-text choice but adds no syntax, format, or constraint detail beyond the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 opens with a specific verb+resource ('Extract structured data from a URL or raw text into strict JSON matching a schema you provide'), naming both accepted inputs and the output contract. This clearly separates it from loose-read siblings like read_web_page and read_pdf, which return content rather than schema-conformant JSON. An agent can identify the tool's job without opening the schema.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the tool is positioned inside the 'content kit' alongside pdf, web-read, summarize, and detect-language, but the description never explicitly says when to pick this over read_web_page or summarize. The 'Provide this or text, not both' guidance lives in the schema, not the description. No exclusions or alternative-selection criteria are 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.