Skip to main content
Glama
Paperboy

Paperboy

Official
by sudostash

extract_tables

Read-onlyIdempotent

Extracts tables from PDF pages and returns each as rows of cell text, using line- or alignment-based detection to support structured data parsing.

Instructions

Find tables on all pages or a page spec (e.g. "1-3,7") and return each as rows of cell text (empty and merged cells are ""). strategy "lines" finds tables drawn with lines between cells; "text" finds tables laid out by alignment only (rougher). Returns up to max_tables (1-200; 50,000 cells in all; 1,000 characters per cell); truncated means there are more (complete is then still true). Pages that can't be read safely (too much content, lines too dense to analyse, damaged, or too slow) are listed in pages_skipped with the reason; complete is false if the 60 s limit per call stopped it before every page was read. Scanned pages have no text to read. To save tables as CSV, use export_tables. Needs the owner password if the PDF forbids copying.

Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.

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": {
      "input_path": "<input_path>"
    },
    "name": "extract_tables"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesNo
passwordNo
strategyNolines
input_pathYes
max_tablesNo

Output Schema

NameRequiredDescriptionDefault
pathYes
tablesYes
completeYes
truncatedYes
pages_skippedYes
pages_searchedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses hard limits (1-200 tables, 50,000 cells, 1,000 chars per cell), truncation semantics, the meaning of complete vs pages_skipped with skip reasons, the 60 s per-call limit, and that scanned pages yield no text. It also surfaces the owner-password requirement when copying is forbidden and the "ask" password flow, which annotations cannot express.

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 limits, then failure modes, then the sibling redirect; nearly every clause carries operational information. It is dense and slightly run-on across semicolons, but there is no filler that could be cut without losing a constraint.

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?

An output schema exists, yet the description still explains the non-obvious result fields (truncated, complete, pages_skipped) that an agent must interpret to know whether to retry. For a tool with password handling, page ranges, size caps and partial-failure states, nothing needed for correct invocation or result interpretation is missing.

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

Parameters5/5

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

Schema description coverage is 0%, yet the description supplies the essential semantics for nearly every parameter: the page-spec syntax ("1-3,7"), the two strategy values and their tradeoff, the max_tables range (1-200), and the password behavior including the special "ask" value. This compensates fully for the undocumented 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 specific verb and resource ("Find tables ... and return each as rows of cell text") with an explicit scope (all pages or a page spec) and output shape (rows of cell text, empty/merged cells as ""). It also distinguishes the two detection modes, so the agent knows exactly which capability it is selecting apart from text/page extractors.

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?

Gives clear when-to-use context for the two strategies ("lines" for ruled tables, "text" for alignment-only, described as rougher) and an explicit redirect to export_tables when CSV output is wanted. It does not contrast against sibling text extractors such as extract_text or extract_pages, so the alternative set is only partially covered.

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