Skip to main content
Glama

Extract tables from a PDF

pdf_extract_tables
Idempotent

Extract tables from PDFs, including ruled, shaded, borderless, and chart data, and save them as Excel, CSV, JSON, or Markdown for easy analysis.

Instructions

Find the tables in a PDF (ruled, shaded and borderless, plus charts drawn as vectors, as tables of their values) and write them as Excel (.xlsx, one sheet per table), CSV, JSON or Markdown. The output name must end in the format's extension (.xlsx, .csv, .json, .md).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesNoPage numbers or ranges, such as "1, 3-5". Omit for every page.
formatNoxlsx
outputYesPath for the new file, ending in .xlsx, .csv, .json or .md to match the format, inside an allowed folder. Must not exist yet.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesYes
formatYes
outputYes
tablesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare a non-read-only, non-destructive, idempotent write, and the description adds real context: it writes a new file, uses one sheet per table for xlsx, and requires the output name to match the format extension. One caveat: the schema's 'Must not exist yet' constraint on output sits awkwardly with idempotentHint=true, so a repeat call apparently fails - a subtle inconsistency the description doesn't resolve, though not a hard contradiction.

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, front-loaded with the core action before the output-format and naming details. The parenthetical enumerations are dense but each carries useful content; nothing is redundant filler.

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?

With an output schema present, return values needn't be explained, and annotations cover the safety profile. The description covers table types, output formats, and the naming constraint, leaving only minor gaps such as behavior on multi-page tables or overwrite handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75% (the format enum lacks a description), and the description compensates by explaining format-to-extension mapping and that xlsx produces one sheet per table. It reinforces the output naming rule, adding meaning beyond the schema's enum and minLength.

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 description states a precise verb and resource (find/extract tables in a PDF) and even enumerates the table types handled (ruled, shaded, borderless, vector charts). It also names the four output formats, so an agent can distinguish it from pdf_extract_structure and pdf_read_text without opening a 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?

Usage is implied (extract tabular data to a file) and the table-type breadth hints at coverage, but there is no explicit when-to-use or when-not-to-use guidance relative to siblings like pdf_extract_structure or pdf_read_text. The agent must infer that this is the tool for tabular data specifically.

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