Skip to main content
Glama

Agent Data Tools: Utilities

HTML table to JSON: extract tables from HTML

html_table_to_json
Read-only

Extract every table from an HTML fragment into JSON: header cells become keys and each body row an object (or raw arrays when there is no header row), with captions, colspans repeated and entities decoded. Give the HTML itself (up to 500 KB). Use to turn web or email tables into data an agent can sort and compute on; to fetch a page first use extract. Price $0.01/call via x402 USDC or a card key (/credits), first 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": {
      "html": "<html>"
    },
    "name": "html_table_to_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesHTML containing one or more <table> elements (up to 500 KB)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/destructive/openWorld false, but the description goes well beyond them: entity decoding, colspans repeated, caption handling, the 500 KB ceiling, and the fact that calls cost $0.01 with 10 free and failed calls free. The pricing sentence also explains why idempotentHint is false despite a pure read, which the annotation alone would leave ambiguous.

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?

Front-loaded with the action and output shape, then input constraint, then routing, then billing. Density is high and nearly every clause carries information, though the pricing details are appended as a run-on rather than separated, making the sentence slightly harder to scan.

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?

There is no output schema, so the description carries the return shape entirely and does so precisely (keys from headers, objects per row, raw arrays for headerless tables, captions, repeated colspans). Combined with the input limit and cost model, nothing an agent needs to call this correctly is missing.

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 coverage is 100% and the only parameter already documents "HTML containing one or more <table> elements (up to 500 KB)". The description's "Give the HTML itself (up to 500 KB)" largely restates that, adding only the nuance that the input is a fragment containing tables rather than a full page.

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?

"Extract every table from an HTML fragment into JSON" states a specific verb, resource and output form, then immediately specifies the mapping (header cells become keys, body rows become objects, raw arrays when no header). This separates it cleanly from html_to_text (text output) and extract (page fetching) without needing either schema.

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?

It gives a concrete input expectation ("Give the HTML itself (up to 500 KB)"), a use case (web or email tables into data an agent can sort and compute on), and an explicit alternative with its condition ("to fetch a page first use extract"). An agent with raw HTML vs. a URL can route correctly on this text alone.

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