Skip to main content
Glama

Extract Structured Data

extract_structured_data
Read-only

Extract structured data from web pages via CSS selectors or LLM, including tables, and persist full results as JSON.

Instructions

Extract structured data using CSS selectors or LLM. Use output_path to persist the full extraction (including table_data) to disk as JSON and receive a slim response.

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": {
      "url": "<url>"
    },
    "name": "extract_structured_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesTarget URL
timeoutNoTimeout in seconds
overwriteNoOverwrite an existing output file at output_path. Defaults to False.
output_pathNoAbsolute file path (auto .json extension) to persist the full extracted_data + table_data as JSON. When set, the response is slimmed (content, markdown, table_data, extracted_data.raw_content removed).
wait_for_jsNoWait for JavaScript
css_selectorsNoCSS selector mapping
extraction_typeNo'css'|'llm'|'table'css
extraction_schemaNoSchema definition
generate_markdownNoGenerate markdown
table_chunking_strategyNo'intelligent'|'fixed'|'semantic'intelligent
use_llm_table_extractionNoUse LLM table extraction
include_content_in_responseNoWhen True (with output_path set), also keep extracted_data/table_data/content in the response. Defaults to False.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Addedv0.3.2
  3. Removedv0.1.6
  4. First observedv0.1.7

TDQS

C2.9/5.0
Behavior2/5

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

The description does disclose the important side effect that output_path writes JSON to disk and slims the response, and the overwrite parameter implies file replacement. However, that file write conflicts with the readOnlyHint=true annotation, which claims the tool does not modify its environment. Annotations therefore carry the wrong safety signal for a tool that can overwrite a file, and the description does not correct it explicitly.

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, no filler, and the primary capability is front-loaded before the output_path caveat. Nothing is wasted, though the second sentence is purely an output_path note rather than something that improves selection.

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

Completeness2/5

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

This is a 12-parameter tool with three distinct extraction modes and an output schema, yet the description never explains the css_selectors vs extraction_schema relationship, what 'intelligent' table chunking means, or when LLM extraction is warranted over CSS. An output schema exists so return values need not be described, but the mode-selection and configuration burden is left entirely to the schema.

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 parameter descriptions already spell out output_path persistence, the slim response, overwrite, and keep-content behavior in more detail than the description does. The one added value is calling out table_data as part of what gets persisted, but that is also present in the schema. Baseline 3 applies since the schema does the heavy lifting.

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 uses a specific verb and resource, 'Extract structured data', and names the two driving mechanisms, CSS selectors or LLM, which matches the extraction_type parameter. It says nothing about how this differs from closely named siblings such as intelligent_extract, extract_entities, or crawl_url, so an agent cannot disambiguate without opening schemas.

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

Usage Guidelines2/5

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

The only usage guidance is conditional on output_path, 'Use output_path to persist the full extraction'. There is no statement of when to pick css vs llm vs table, and no when-not or alternative-tool routing despite several sibling extraction tools that overlap heavily.

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