Skip to main content
Glama

Extract structured data

extract
Read-only

Pull links, tables, JSON-LD, meta, text, or CSS-mapped fields from the current page deterministically without an LLM; use snapshots to locate selectors first.

Instructions

Deterministic extraction from the current page. Modes: links, tables, jsonld, meta, selector (CSS map), text. No LLM involved; pair with snapshot/markdown when you need to locate a selector first.

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": {
      "mode": "<mode>"
    },
    "name": "extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYes
limitNoMax items (default 100).
selectorNoFor mode=selector: { field: "css" | { selector, attr?, all? } }
max_charsNoJSON output cap (default 16000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description adds substantive behavior: extraction is deterministic, no LLM is involved, and it operates on the current page rather than arbitrary URLs. It does not mention truncation behavior or that large result sets are capped, though max_chars/limit in the schema partially cover that.

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?

Three short sentences, front-loaded with the core action, then the mode list, then the caveat about locating selectors. No filler and nothing that restates the tool name.

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

Completeness4/5

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

With four parameters, a nested object, and no output schema, the definition covers mode selection and the important selector-pairing workflow. It could say more about the returned JSON shape per mode (e.g., what a links entry contains), which matters since no output schema exists.

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 75% and documents limit, max_chars, and the selector object, so the baseline would be 3. The description earns the extra point by glossing selector mode as "CSS map," clarifying the nested field-to-CSS structure at a glance and tying each enum value to a requestable data type.

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?

"Deterministic extraction from the current page" gives a specific verb plus resource and scope, and the mode enumeration (links, tables, jsonld, meta, selector, text) tells an agent exactly the shapes of output available. The added contrast with snapshot/markdown makes the boundary with siblings concrete rather than inferred.

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?

It provides a clear rule for combining tools — "pair with snapshot/markdown when you need to locate a selector first" — which is genuine routing guidance. It stops short of stating when NOT to use extract (e.g., prefer markdown for whole-page prose, evaluate for custom logic), so it is strong but not fully exhaustive.

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