Skip to main content
Glama

Table Extraction API - Extract HTML, Markdown & PDF Tables to JSON

table_extraction
Read-onlyIdempotent

Extract structured tables from HTML, Markdown, CSV/TSV text, public web URLs, or base64 PDFs into clean JSON records, CSV, or Markdown. Expands HTML colspan and rowspan cells, preserves captions and page numbers, infers numeric and boolean types while keeping leading-zero IDs intact, and enforces strict SSRF limits on URLs. Deterministic local parsing (BeautifulSoup, lxml, pdfplumber), 0 AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.002/call via x402 at https://radarbg.com/x402/table-extraction.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "html": "<table><caption>Q4 Pricing</caption><thead><tr><th>SKU</th><th>Product</th><th>Price</th><th>InStock</th></tr></thead><tbody><tr><td>00412</td><td>Pro Plan</td><td>49.00</td><td>true</td></tr><tr><td>00413</td><td>Business Plan</td><td>129.00</td><td>true</td></tr></tbody></table>",
      "format": "json",
      "detectTypes": true
    },
    "name": "table_extraction"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOptional public http(s) URL to fetch and extract HTML tables from (honest UA, SSRF-protected)
htmlNoHTML document or fragment containing one or more <table> elements (max 2 MB)
textNoAuto-detected HTML, Markdown, or CSV/TSV delimited table text (max 2 MB)
formatNoOutput format for table rowsjson
markdownNoMarkdown text containing one or more GFM pipe tables (max 2 MB)
maxTablesNoMaximum number of tables to return (1-50)
pdfBase64NoOptional base64-encoded PDF file to extract structured tables from (max 15 MB)
detectTypesNoConvert numeric and boolean cell values in JSON records
includeRawRowsNoInclude raw 2D string cell matrix alongside JSON records
maxRowsPerTableNoMaximum data rows per table (1-2000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, and openWorld, but the description adds substantial behavior the annotations do not cover: colspan/rowspan expansion, caption and page-number retention, type inference that preserves leading-zero IDs, SSRF protection with a fetch UA, deterministic local parsing with no AI, and no storage of inputs. It also discloses concrete operational limits — 5 free calls/day per IP and the two paid auth paths (X-API-Key or x402) — which is exactly the kind of cost/auth context an agent needs before calling.

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?

Three front-loaded sentences: what it does, how it behaves, and access/pricing terms. Dense but every clause carries information; the pricing sentence is long and partly promotional, though rate limits and auth method are legitimately useful for call planning.

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?

For a ten-parameter, no-output-schema tool, the description covers inputs, output formats, transformation behavior, safety posture, and access terms. It stops short of describing error behavior (e.g. what happens on a blocked URL or a PDF with no tables) or whether multiple tables are returned in a wrapper object, which would matter given the absent output 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%, so every one of the ten parameters is already documented with types, defaults, and limits; baseline is 3. The description adds interpretive context around type inference and rowspan expansion that helps an agent reason about detectTypes and includeRawRows, but it never maps behavior to specific parameter names or interaction rules (e.g. precedence when both html and url are supplied).

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 first sentence states a specific verb (Extract) and resource (structured tables), enumerates the accepted input forms (HTML, Markdown, CSV/TSV, public URLs, base64 PDFs), and names the three output formats. That scope cleanly separates it from siblings such as pdf_to_csv or image_to_excel_table, which handle a single narrower input path.

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?

Enumerating accepted inputs implicitly tells an agent when this tool applies: any time the table source is HTML, Markdown, delimited text, a URL, or a PDF. What is missing is an explicit exclusion or named alternative (e.g. 'for image screenshots of tables use image_to_excel_table'), so the routing decision still requires inference.

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