Skip to main content
Glama

API Keg — DOM Harvest & Table Grid Extractor

Extract Records by Declarative CSS Schema

extract_by_schema
Read-onlyIdempotent

Deterministic CSS-selector record extractor supporting descendant/child/attribute/group selectors, relative URL resolution against baseUrl, numeric currency/comma coercion, boolean flags, inner HTML serialization, and multi-value arrays. Pricing: $0.001 USD per declarative CSS-schema extraction (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.

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": {
      "html": "<html>",
      "itemSelector": "<itemSelector>",
      "fields": "<fields>"
    },
    "name": "extract_by_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesRaw HTML page or fragment.
fieldsYesMap of output property names to declarative CSS selector + type coercion rules.
baseUrlNoOptional page URL used to resolve relative URLs when field type is 'url'.
itemSelectorYesCSS selector matching each repeating record element (or 'body' / 'html' for single-object page extraction).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the description earns credit for disclosing what they do not: a concrete per-call cost of $0.001 USD via x402 micropayment and a free dry-run validation path. The determinism claim is also meaningful behavior for an agent relying on repeatable output. It does not describe output shape or failure modes.

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?

Two sentences, front-loaded with the capability list and followed by the cost/validation note that an agent genuinely needs before calling. The capability enumeration is dense but each item maps to a real feature; nothing is padded.

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 paid, schema-driven extraction tool with a fully documented nested schema, the description covers capability, cost, and a free validation route — the pieces an agent needs to decide and call correctly. With no output schema, the only mild gap is that it doesn't state the return shape, but the fields map to output property names makes that inferable.

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% and the nested field-rule object already documents type, multiple, selector, and attribute, so the description largely restates schema content. It does add connective meaning — that url resolution is against baseUrl and that 'multiple' yields arrays — but nothing beyond what the schema states.

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 names a specific verb+resource combination ("Deterministic CSS-selector record extractor") and enumerates the selector and coercion capabilities, so an agent knows exactly what the tool produces. It stops short of distinguishing itself from the sibling harvest_page_structures, leaving the agent to infer which extraction tool fits.

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?

Usage is only implied through capability language (declarative CSS schema, coercion types) rather than explicit when-to-use guidance. The dry_run tip is a useful operational hint for validating a schema before paying, but it is framed for REST callers and no alternative tool or exclusion is named.

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