Skip to main content
Glama

Heal an extractor

heal_extractor
Read-onlyIdempotent

Repair a web data extractor after a page redesign by relearning from new pages and identifying where each field moved, including lost data that needs manual attention.

Instructions

Learn pages again after a redesign, and say what moved where.

extractor: the object compile_extractor returned. pages: http(s) URLs, or the HTML itself, of the redesigned pages.

Returns {"ok", "extractor", "changes", "lost"}. A field that moved keeps its old name, so rows read with the healed extractor keep their columns, and its change carries the evidence: how many of the values it was learnt with were found in the new place. "lost" is true when a change is data the page no longer has -- vanished, summary-lost, type-lost, listing-lost, or broken: a selector written by hand that the pages no longer bear out, which heal never rewrites -- and then ok is false: the old extractor, which keeps failing, is the safer one to keep until a person looks. A healed extractor heavier than 75,000 bytes is too_large.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesYeshttp(s) URLs, or the HTML itself, of the redesigned pages.
extractorYesthe object compile_extractor returned.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
lostNo
errorNo
changesNo
extractorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 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"
      +]
  2. Changed2 schema fields changedv0.7.0
    • addedInput schema / properties / extractor / description
      Added value: +"the object compile_extractor returned."
    • addedInput schema / properties / pages / description
      Added value: +"http(s) URLs, or the HTML itself, of the redesigned pages."
  3. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

The description thoroughly discloses behavior beyond the annotations: it details the return structure (ok, extractor, changes, lost), explains the semantics of 'lost' and 'ok' being false, notes the 75,000-byte size limit, and clarifies that hand-written selectors are never rewritten. This significantly enriches the read-only and non-destructive annotations. No contradiction.

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 efficiently packed; every sentence contributes to understanding the tool's purpose, inputs, outputs, and edge cases. It front-loads the core purpose and then systematically explains parameters and return behavior. No filler or redundancy.

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?

The description is comprehensive for the tool's complexity. It covers prerequisites (extractor from compile_extractor), input types, output fields and their meanings, error conditions (lost data, ok false), and the size limit. With an output schema present, the description fully equips an agent to call the tool correctly.

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%, with both parameters already described in the input schema. The description repeats the same information (extractor is from compile_extractor, pages are URLs or HTML) without adding new semantics. Baseline 3 is appropriate since the schema carries the full burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the purpose: heal an extractor by learning pages after a redesign and reporting changes. It specifies the resource (extractor) and action (learn/heal) precisely. While it doesn't explicitly differentiate from sibling tools like run_extractor or compile_extractor, the purpose is distinct and unambiguous.

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?

The description gives clear context: use this tool after a redesign to relearn pages and identify what moved. It doesn't mention alternatives or exclusions, but the trigger condition ('after a redesign') is explicit, providing sufficient guidance for an agent to decide when to use it.

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