Skip to main content
Glama

Extraer tablas de HTML

html-tables-extract
Read-onlyIdempotent

Extrae tablas de un HTML como filas de texto, detectando encabezados (thead o una primera fila de th), expandiendo colspan y, opcionalmente, como objetos por encabezado. Las tablas anidadas se extraen por separado. Cuándo: hay que leer, construir o revisar con exactitud una URL, una cabecera HTTP, un token, una versión, un rango de IP, un documento HTML o Markdown o un archivo para agentes. No para: extraer y clasificar los enlaces de un documento HTML (html-links-extract). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Extracts elements from HTML into rows of cell text, with header detection (thead or a first row of th), colspan expansion and optional row objects keyed by header. Nested tables are extracted separately. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
htmlYesHTML (string; required).
as_objectsNoAlso return rows as objects keyed by header (boolean; optional; default false).
max_tablesNoMax tables (integer; optional; default 20; min 1; max 100).

Output Schema

NameRequiredDescriptionDefault
countNo
tablesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / html / examples
      Added value: +[
      +  "<p>x</p><table><tr><td colspan=\"2\">Total &amp; IVA</td></tr><tr><td>a</td><td>b</td></tr></table>"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Extracts <table> elements from HTML into rows of cell text, with header detection (thead or a first row of th), colspan expansion and optional row objects keyed by header. Nested tables are extracted separately. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. Not for: extracting and classifying the links of an HTML document (html-links-extract). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-open-world and non-destructive, so the 'sin efectos secundarios' sentence is mostly redundant, but the description adds real behavior beyond them: nested tables are extracted separately, colspan is expanded, headers are detected from thead or a first th row, and it declares hard limits (64 KB input, 1 s, 1 MB result) and determinism. Minor inconsistency: the prose says JSON input up to 64 KB while the schema sets html maxLength to 1 MB, which an agent may find confusing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well front-loaded with labeled sections (Cuándo / No para / Efectos / Determinista / Límites), and the first sentence carries the essential mechanics. But the content is duplicated in Spanish and English, and the English portion is a pointer to inputSchema.description rather than new information, which wastes substantial space in an otherwise short field.

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?

An output schema exists, so return values need not be described; the prose still covers header semantics, colspan, nested tables, determinism and resource limits, which is what an agent needs to call it correctly. The only real gap is the stale/contradictory input-size limit versus the 1 MB schema maxLength.

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 the baseline is 3 and the schema already documents html, as_objects (default false, keyed by header) and max_tables (1-100, default 20). The prose reinforces as_objects and header-keying but never mentions max_tables or the practical consequences of truncating at that cap, adding little beyond the schema.

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?

States a concrete verb and resource (extract <table> elements from HTML into rows of cell text) plus the specific mechanics: header detection via thead or a first th row, colspan expansion, optional header-keyed objects. It also carves itself away from html-links-extract, so an agent can distinguish it from siblings without opening any schema.

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?

The 'No para' clause is a genuine, explicit exclusion naming the sibling html-links-extract and the condition that selects it. However, the 'Cuándo' clause is generic boilerplate (URL, HTTP header, token, IP range, agent-readiness file) that barely relates to HTML table extraction and gives no real signal about when to pick this over html-to-text or html-to-markdown. Usage direction is therefore half-explicit, half-filler.

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