Skip to main content
Glama

heal-scraper

Self-Healing Scraper & DOM-to-JSON Compiler — Synthesizes durable CSS selectors (Cheerio; no XPath) for a target JSON schema, proves them against the live DOM in-request, and returns the extracted data plus a ready-to-run TypeScript Cheerio extractor.

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": {
      "targetSchema": "<targetSchema>"
    },
    "name": "heal-scraper"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPage to fetch. Provide url or html.
htmlNoRaw HTML to use instead of fetching.
targetSchemaYesJSON Schema of the fields to extract: an object whose properties are string/number/integer/boolean (or arrays of those), or an array whose items are such an object for list pages. The pattern keyword is not allowed.
previousBrokenSelectorsNoMap of field name to the CSS selector that stopped working.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose several behaviors beyond the obvious: in-request proofing against the live DOM, CSS-only selector synthesis, and a code artifact in the response. It does not say what happens when proofing fails (error vs. partial result), whether the page is fetched with redirects/timeouts, or that only static HTML is parsed.

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?

A single front-loaded sentence whose clauses each carry distinct information: mechanism, selector strategy, validation step, and return payload. No filler or repetition of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers inputs and outputs reasonably well despite there being no output schema, naming both the extracted data and the generated extractor. However, for a network-fetching scraper with a nested targetSchema and no annotations, it omits failure behavior and the important static-HTML-only limitation, leaving real gaps for correct invocation.

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 all four parameters are already documented, including the url-or-html alternative and the targetSchema constraints. The description adds no syntax, format, or value details beyond what the schema states, so the baseline of 3 applies.

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 names a specific verb-and-resource chain: it synthesizes durable CSS selectors for a target JSON schema, proves them against the live DOM, and returns extracted data plus a TypeScript Cheerio extractor. The parenthetical '(Cheerio; no XPath)' further pins down the mechanism, so an agent knows exactly what it gets back.

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 workflow context is clear: supply a targetSchema plus either url or html, and optionally previousBrokenSelectors to heal broken selectors. It stops short of explicit when-not guidance (e.g. that dynamic JS-rendered pages are out of scope because Cheerio does not execute script), which is the main omission.

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