Skip to main content
Glama

Extract a page's declared data

extract_declared
Read-onlyIdempotent

Extract structured data (JSON-LD, microdata, OpenGraph) a web page declares, showing the source and location of each value. Works from a URL or raw HTML.

Instructions

Read the structured data a page declares, with where each value came from.

html_or_url: an http(s) URL to fetch, or the HTML itself. induce: also read repeated rows (a listing, a feed) from a page that declares nothing about them; those fields say source "induced". at: a date (2024, 2024-06, 2024-06-01): read the URL as the Wayback Machine captured it nearest to then; "fetch" says which capture. respect_tdm: answer tdm_reserved instead of the page when the site reserves its text and data mining rights (TDMRep: its tdmrep.json, headers or meta tags). records: also return every record, not only the summary and what was normalised; false keeps the answer small. Records that would make the answer larger than 75,000 bytes are left out and counted in records_left_out. visible: also guess the title, author, publication and update dates the page shows a reader, in "visible", each {"value", "where", "rule"}; guesses, never part of the summary, which holds only what the page declares.

Returns {"ok", "url", "summary", "records", "sources"}, and "fetch" for a URL. records are typed fields, each {"value", "source", "where"}: source is the vocabulary that declared it (jsonld, microdata, opengraph, html, ...), where the XPath of the element that did -- for JSON-LD the block's, with a JSON pointer after "#" -- or null for a meta tag, whose key is its place. A nested value such as a price inside "offers" arrives whole. summary answers title, author, date, price and the rest, one value each, naming its source, key and where. conflicts lists each question the page answers two ways that mean different things -- a price of 41.90 in JSON-LD and 39.90 in OpenGraph -- the summary's answer first: say so rather than trusting either. On failure ok is false and "error" says why; there is never a record. An answer weighs at most 75,000 bytes: past it the records go first, counted in records_left_out, then the conflicts, counted in conflicts_left_out, then the heaviest summary, visible, normalised and links entries, each named in summary_left_out, visible_left_out, normalised_left_out or links_left_out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
atNoa date (2024, 2024-06, 2024-06-01): read the URL as the Wayback Machine captured it nearest to then; "fetch" says which capture.
induceNoalso read repeated rows (a listing, a feed) from a page that declares nothing about them; those fields say source "induced".
recordsNoalso return every record, not only the summary and what was normalised; false keeps the answer small. Records that would make the answer larger than 75,000 bytes are left out and counted in records_left_out.
visibleNoalso guess the title, author, publication and update dates the page shows a reader, in "visible", each {"value", "where", "rule"}; guesses, never part of the summary, which holds only what the page declares.
html_or_urlYesan http(s) URL to fetch, or the HTML itself.
respect_tdmNoanswer tdm_reserved instead of the page when the site reserves its text and data mining rights (TDMRep: its tdmrep.json, headers or meta tags).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
urlNo
errorNo
fetchNo
linksNo
rightsNo
recordsNo
sourcesNo
summaryNo
visibleNo
conflictsNo
normalisedNo
links_left_outNo
records_left_outNo
summary_left_outNo
visible_left_outNo
conflicts_left_outNo
normalised_left_outNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.9.0
    • changedOutput schema / $defs / ErrorDetail / description
      Previous value: -"Why a tool could not answer.\n\n``retryable`` is true only for ``fetch_failed``, and on a crawled page for\n``rate_limited``: the same call may work later. The others need something\nto change first -- an install, an input, or the caller's mind about a site\nthat said no."New value: +"Why a tool could not answer.\n\n``retryable`` is true only for ``fetch_failed``, and on a crawled page for\n``rate_limited``: the same call may work later. Not every ``fetch_failed``\nis: a redirect loop, or an encoding this install cannot read, would be\nmet again. The others need something to change first -- an install, an\ninput, or the caller's mind about a site that said no."
    • changedOutput schema / $defs / ErrorDetail / properties / code / enum
      Previous value: -[
      -  "missing_extra",
      -  "refused_by_robots",
      -  "refused_address",
      -  "fetch_failed",
      -  "too_large",
      -  "bad_input",
      -  "tdm_reserved"
      -]New value: +[
      +  "missing_extra",
      +  "refused_by_robots",
      +  "refused_by_site",
      +  "payment_required",
      +  "refused_address",
      +  "fetch_failed",
      +  "too_large",
      +  "bad_input",
      +  "tdm_reserved"
      +]
    • addedOutput schema / properties / conflicts_left_out
      Added value: +{
      +  "title": "Conflicts Left Out",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / links_left_out
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Links Left Out",
      +  "type": "array"
      +}
    • addedOutput schema / properties / normalised_left_out
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Normalised Left Out",
      +  "type": "array"
      +}
    • addedOutput schema / properties / summary_left_out
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Summary Left Out",
      +  "type": "array"
      +}
    • addedOutput schema / properties / visible_left_out
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Visible Left Out",
      +  "type": "array"
      +}
  2. Changed9 schema fields changedv0.7.0
    • addedInput schema / properties / at / description
      Added value: +"a date (2024, 2024-06, 2024-06-01): read the URL as the Wayback Machine captured it nearest to then; \"fetch\" says which capture."
    • addedInput schema / properties / html_or_url / description
      Added value: +"an http(s) URL to fetch, or the HTML itself."
    • addedInput schema / properties / induce / description
      Added value: +"also read repeated rows (a listing, a feed) from a page that declares nothing about them; those fields say source \"induced\"."
    • addedInput schema / properties / records
      Added value: +{
      +  "default": true,
      +  "description": "also return every record, not only the summary and what was normalised; false keeps the answer small. Records that would make the answer larger than 75,000 bytes are left out and counted in records_left_out.",
      +  "title": "Records",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / respect_tdm / description
      Added value: +"answer tdm_reserved instead of the page when the site reserves its text and data mining rights (TDMRep: its tdmrep.json, headers or meta tags)."
    • addedInput schema / properties / visible
      Added value: +{
      +  "default": false,
      +  "description": "also guess the title, author, publication and update dates the page shows a reader, in \"visible\", each {\"value\", \"where\", \"rule\"}; guesses, never part of the summary, which holds only what the page declares.",
      +  "title": "Visible",
      +  "type": "boolean"
      +}
    • addedOutput schema / $defs / GuessAnswer
      Added value: +{
      +  "description": "What a page shows and may not declare: a guess, its element and rule.",
      +  "properties": {
      +    "rule": {
      +      "title": "Rule",
      +      "type": "string"
      +    },
      +    "value": {
      +      "title": "Value",
      +      "type": "string"
      +    },
      +    "where": {
      +      "title": "Where",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "value",
      +    "where",
      +    "rule"
      +  ],
      +  "title": "GuessAnswer",
      +  "type": "object"
      +}
    • addedOutput schema / properties / records_left_out
      Added value: +{
      +  "title": "Records Left Out",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / visible
      Added value: +{
      +  "additionalProperties": {
      +    "$ref": "#/$defs/GuessAnswer"
      +  },
      +  "title": "Visible",
      +  "type": "object"
      +}
  3. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

The description goes far beyond the annotations (readOnlyHint, idempotentHint, destructiveHint) by disclosing detailed behaviors: the exact return shape, truncation at 75,000 bytes with counters for left-out items, conflict reporting, failure semantics, and TDM handling. This provides critical operational transparency the annotations do not cover.

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 description is long but well-structured: purpose first, then per-parameter details, then the return format and edge cases. It front-loads the core intent and uses a consistent layout, though the extensive prose about truncation and conflicts could be tightened. Overall it earns its place, but the length prevents a perfect score.

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?

Given the tool's complexity, the description is highly complete: it covers all six parameters, the return object (even though an output schema exists), failure modes, size limits, special options (Wayback, TDM), and conflict behavior. An agent has enough context to call the tool correctly even without examining the output schema.

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?

The schema description coverage is 100% and the tool description repeats the parameter descriptions verbatim without adding new parameter-specific meaning. The return-format discussion indirectly clarifies the effect of parameters like records and visible, but no additional parameter semantics are introduced beyond the schema.

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: 'Read the structured data a page declares, with where each value came from.' This clearly distinguishes the tool from siblings like run_extractor or read_feed by focusing on declared data with provenance. The title 'Extract a page's declared data' is consistent and informative.

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?

The description does not explicitly state when to use this tool versus alternatives such as run_extractor, read_feed, or extract_many. It implies usage through its purpose and parameter descriptions (e.g., at for Wayback, respect_tdm for TDM), but offers no direct guidance on sibling selection or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.