Skip to main content
Glama

extract_tables_pdf

Extract tables from a PDF (url or base64) into JSON, CSV or XLSX using the text layer, with page numbers. Paid via x402 ($0.01 USDC on Base mainnet (also Polygon, Arbitrum and Solana)) on this tools/call request. Includes asOf and source. Invalid input is rejected without payment.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "extract_tables_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPublic PDF link (max 3 MB). Send url or pdf_base64.
limitNoMaximum tables to return (default 20).
pagesNoPages to scan, e.g. 1-5 or 1,3,7-9 (default first 15; max 30).
tableNoReturn only this table (1-based index from a previous call).
formatNojson (default), csv (one CSV string per table) or xlsx (one workbook, one sheet per table, base64).
headerNoauto (default: <th>/<thead> for HTML, first non-numeric row for PDF), first = treat the first row as header, none.
orientNojson only: rows = arrays (default) or records = one object per row keyed by header.
numbersNojson only: convert plain numbers such as 1,200 or 3.5 to numbers (default false). XLSX always stores them as numbers.
min_rowsNoSkip tables with fewer rows, header included (default 2).
pdf_base64NoThe PDF file, base64-encoded (max 3 MB).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the x402 payment ($0.01 USDC on Base mainnet, plus Polygon/Arbitrum/Solana), that billing occurs on this tools/call request, that invalid input is rejected without charge, and that responses include asOf and source. It does not address non-text-layer (scanned) PDFs, rate limits, or what a failure looks like beyond invalid input.

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 purpose, then output formats, then commercial/error terms — every sentence carries information. The nested parenthetical of alternate chains is slightly cluttered but still readable.

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 10-parameter tool with no output schema and no annotations, the definition covers pricing, billing timing, input rejection behavior, and the two response metadata fields. The main remaining gap is the behavior on scanned PDFs where the text layer is absent.

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 all ten parameters including enums and defaults are already documented; the description adds no parameter-level detail beyond restating url/base64 and the format choices. Baseline 3 applies when 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?

States a specific verb+resource ('Extract tables from a PDF'), the two input modes (url or base64), the three output formats, and the mechanism ('using the text layer'). It doesn't distinguish itself from the sibling extract_tables, so an agent can't be fully certain which to pick without opening both.

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?

Implicit guidance exists: 'using the text layer' signals text-based PDFs rather than scans, and the payment note signals this is the metered path. But there is no explicit when-to-use/when-not or named alternative, so routing between this and extract_tables is left to 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