Skip to main content
Glama

Extract Structured Data

extract
Read-onlyIdempotent

Fetches a public page and returns, in data, JSON that matches the supplied JSON Schema. Only fields listed in required are guaranteed; optional nulls are omitted. Use it to get specific fields as structured data. Not for plain page text: use scrape_url. Reddit and Amazon pages are refused (use read_reddit or amazon_product). 40 credits per successful call, whatever the options; an answer that does not match the schema returns EXTRACTION_FAILED and is not charged. Required: url, schema.

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": {
      "url": "<url>",
      "schema": "<schema>"
    },
    "name": "extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPublic http or https page URL, at most 8192 characters, e.g. "https://example.com/product/42". Reddit and Amazon pages, private addresses and sign-in pages are refused without charge.
schemaYesJSON Schema (draft 2020-12 subset) of the JSON to return, e.g. {"type":"object","required":["title","price"],"properties":{"title":{"type":"string"},"price":{"type":"number"}}}. Root type object or array; at most 8 KB, 5 levels and 50 properties; local $ref only.
premiumNoFetch through residential proxies, for pages that come back blocked. Boolean, default false; same price.
render_jsNoRun the page's JavaScript in a browser before extracting, for pages built in the browser. Boolean, default false; same price.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / premium / description
      Previous value: -"Use premium proxies, for pages that come back blocked. Same price."New value: +"Fetch through residential proxies, for pages that come back blocked. Boolean, default false; same price."
    • changedInput schema / properties / render_js / description
      Previous value: -"Render the page with JavaScript before extracting. Same price."New value: +"Run the page's JavaScript in a browser before extracting, for pages built in the browser. Boolean, default false; same price."
    • changedInput schema / properties / schema / description
      Previous value: -"JSON Schema (draft 2020-12 subset) of the JSON to return: root type object or array, at most 8 KB, 5 levels and 50 properties, local $ref only."New value: +"JSON Schema (draft 2020-12 subset) of the JSON to return, e.g. {\"type\":\"object\",\"required\":[\"title\",\"price\"],\"properties\":{\"title\":{\"type\":\"string\"},\"price\":{\"type\":\"number\"}}}. Root type object or array; at most 8 KB, 5 levels and 50 properties; local $ref only."
    • changedInput schema / properties / url / description
      Previous value: -"Public HTTP or HTTPS page URL to extract from. Reddit and Amazon pages are refused."New value: +"Public http or https page URL, at most 8192 characters, e.g. \"https://example.com/product/42\". Reddit and Amazon pages, private addresses and sign-in pages are refused without charge."
  2. Changed1 schema field changed
    • changedInput schema / properties / url / description
      Previous value: -"Public HTTP or HTTPS page URL to extract from. Some marketplace and social pages are refused."New value: +"Public HTTP or HTTPS page URL to extract from. Reddit and Amazon pages are refused."
  3. Changed1 schema field changed
    • changedInput schema / properties / url / description
      Previous value: -"Public HTTP or HTTPS page URL to extract from. Reddit and Amazon pages are refused."New value: +"Public HTTP or HTTPS page URL to extract from. Some marketplace and social pages are refused."
  4. Added

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/idempotent annotations: discloses the 40-credit price and that it is charged regardless of options, that a schema-mismatched answer returns EXTRACTION_FAILED and is not charged, and that only `required` fields are guaranteed with optional nulls omitted. That is exactly the cost/failure/permission context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five short sentences, front-loaded with what it returns, then the differentiation, then cost/failure, then required params. Nothing is repeated and no sentence is filler.

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 4-param open-world fetch tool with no output schema, the description covers return shape (JSON in `data`), cost, failure mode, domain restrictions and alternatives. An agent has everything needed to decide and invoke correctly.

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; the description adds real meaning by explaining the contract of the `schema` parameter — only fields listed in `required` are guaranteed and optional nulls are dropped. It also restates the two required params, which is redundant but harmless.

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 (fetches a public page, returns JSON matching a supplied JSON Schema) and explicitly delimits itself from scrape_url, read_reddit and amazon_product. An agent can distinguish it from every sibling 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 ("get specific fields as structured data"), explicit when-not ("Not for plain page text: use scrape_url") and named alternatives for the refused domains (read_reddit, amazon_product). Both positive and negative routing are covered.

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