Skip to main content
Glama

Extract JSON from a web page

extract_page_json
Read-only

Read one public web page and fill a JSON object from it. Pass a JSON Schema in schema, a prompt in plain words, or both. A small model reads the first 12000 characters of the page's Markdown and fills the object; code then checks it against the schema's type, required, properties, items and enum keywords, and returns null with a warning when it does not match. Every value comes with its source: the start and end of the same text in the page, or found false when the page does not say it word for word. robots.txt, the per-site pace and the daily caps are the same as fetch_page.

Input Schema

NameRequiredDescriptionDefault
urlYesFull address of one public web page, such as "https://example.com/pricing". http is upgraded to https.
promptNoWhat to pull from the page, in plain words. Needed when there is no schema.
schemaNoA JSON Schema for the answer, such as {"type":"object","properties":{"price":{"type":"string"}},"required":["price"]}. The answer is checked against its type, required, properties, items and enum keywords. At most 8000 characters of JSON.
include_markdownNoSet true to also return the Markdown the model read. Default false.

Output Schema

NameRequiredDescriptionDefault
urlYes
jsonNo
noteYes
as_ofYesISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch.
modelNo
notesNo
titleNo
reasonNo
sourceYesWho the data comes from, to cite and to check it against.
statusYes
messageNo
sourcesNo
warningNo
groundedNo
markdownNo
final_urlNo
fetched_atNo
from_cacheNo
untrusted_sourceYes
retry_after_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / url / maxLength
      Previous value: -400New value: +2000
  2. Changed3 schema fields changed
    • addedOutput schema / properties / as_of
      Added value: +{
      +  "description": "ISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / source
      Added value: +{
      +  "description": "Who the data comes from, to cite and to check it against.",
      +  "properties": {
      +    "name": {
      +      "type": "string"
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "name",
      +    "url"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "url",
      -  "status",
      -  "untrusted_source",
      -  "note"
      -]New value: +[
      +  "url",
      +  "status",
      +  "untrusted_source",
      +  "note",
      +  "as_of",
      +  "source"
      +]
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations: it discloses the 12000-character read window, that a small model does the filling, which schema keywords are enforced, and that a mismatch returns null with a warning rather than an error. The source-span/found:false behavior is exactly the kind of caveat an agent could not infer from structured fields.

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?

Four sentences, front-loaded with the core action, and each carries new information (input modes, model window, validation, provenance, fetch parity). Some sentences are long and pack multiple facts, but nothing is redundant.

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 nested-schema, open-world extraction tool with an output schema, it covers everything an agent needs: input modes, size limits, validation rules, failure mode, and provenance of returned values. Return-shape detail is rightly left to the output schema.

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 value by explaining the relationship between schema and prompt (either or both) and the fallback/validation semantics attached to the schema parameter. It doesn't revisit url or include_markdown, which is fine since the schema covers them.

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 and resource — read one public web page and fill a JSON object — plus the extraction mechanism and validation step. It also implicitly separates itself from fetch_page by citing the shared robots.txt/pacing rules, so an agent can tell the two apart.

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?

"Pass a JSON Schema in schema, a prompt in plain words, or both" gives clear input-combination guidance, and the mention of the same robots.txt/pace/caps as fetch_page signals context. It stops short of explicitly saying when to prefer fetch_page or another sibling instead.

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.