Skip to main content
Glama

extract

Extract structured data from a URL or raw HTML, targeting specific data points like tables, prices, or schema fields with modes for selectors, metadata, or brand profiling.

Instructions

Extract structured data from a URL or raw HTML. Use for specific data points (tables, prices, schema fields) rather than whole-page markdown.

Key parameters:

  • mode: "selector" (CSS → text) | "tables" | "metadata" (title/author/date/og_* + JSON-LD) | "schema" (pass a JSON Schema) | "structured" (one-shot: tables + definitions + JSON-LD + chart hints + key-value pairs) | "brand" (name/tagline/description/logo_url/favicon_url/og_image_url/social_links/fonts + CSS-var colors, each with explainable provenance).

  • css_selector: required for mode="selector".

  • schema: required for mode="schema".

  • multiple: return all matches (mode="selector" only).

Prefer mode="structured" over chaining multiple extract calls — one response carries { tables, definitions, jsonld, chart_hints, key_value_pairs }. chart_hints surfaces SVG titles, aria-labels, figcaptions for charts whose data is JS-rendered. Metadata parity with fetch (same og_/canonical_url shape). mode: "brand" walks JSON-LD Organization/Brand/WebSite → OG/Twitter Card meta → <link rel=icon> → CSS custom properties → heuristic header/footer DOM; provenance records the winning source. Provenance enums: logo ∈ {json-ld, og:logo, link[rel=icon], heuristic, unknown}; colors ∈ {css-vars, palette-extraction, unknown}; fonts ∈ {css-vars, css-rule, inline-style, google-fonts-link, unknown}. Honesty: name and logo_url are unset when no explicit source emits them — favicons never promote to logo_url. mode: "schema" is evidence-only: LLM-sourced fields not present in source text are returned as null with a warning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to fetch and extract from
htmlNoRaw HTML to extract from (url takes priority if both provided)
modeNoselector | tables | metadata | schema (LLM-sourced fields verified against source; hallucinated values returned as null) | structured | brand (logo/favicon/colors/fonts/social_links with provenance; favicons never promote to logo_url)
schemaNoJSON Schema defining fields to extract. Field names are matched against page content via CSS classes, ARIA labels, microdata, and JSON-LD. Required when mode="schema".
multipleNoReturn array of all matches instead of first (default: false, only for mode="selector")
css_selectorNoCSS selector to match (required when mode="selector")
named_schemaNoExtract page data into a strict named schema (heuristic only; no LLM required). Mutually exclusive with `schema`.
max_tokens_outNoToken-budget cap on extracted output (cl100k-base BPE). Trims structured/table/schema results to fit; trailing rows or heavy keys are dropped first.
Behavior5/5

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

Despite no annotations, the description fully discloses behavioral details: how each mode works (e.g., brand mode walks JSON-LD then OG meta), provenance tracking, handling of LLM-sourced null values with warning, token budget capping with trimming behavior, and limitations like favicons never promoting to logo_url. This is highly transparent.

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 densely informative, with clear structure using headers for key parameters. Every sentence adds value, though some sections (e.g., brand mode provenance) could be slightly more concise. Overall, it is appropriately sized for the tool's complexity.

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?

Despite lacking an output schema and annotations, the description covers the behavior of all 8 parameters, multiple modes, edge cases (nulls, token trimming), and interplay between parameters (e.g., url/priority, mutually exclusive schema options). It provides a complete mental model for using the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, baseline is 3, but the description adds significant semantic depth: explaining the behavior of each mode, the provenance enums, the interaction of parameters, and the structure of returned data. This goes well beyond what the schema provides, justifying a higher score.

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 clearly states that the tool extracts structured data from a URL or raw HTML, and distinguishes it from whole-page markdown retrieval. It lists multiple modes with specific use cases, making the purpose unambiguous and differentiated from siblings like fetch and crawl.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use each mode, recommending mode='structured' over chaining multiple calls. It also notes metadata parity with fetch, helping an agent choose between tools. Although it does not explicitly state when not to use, the detailed mode descriptions imply appropriate contexts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KnockOutEZ/wigolo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server