Skip to main content
Glama

Extract Tables, Key-Values & Custom JSON from PDF

extract_pdf
Read-onlyIdempotent

Extract structured tables and key-values from PDFs or scanned images using auto, table, or JSON schema modes, with page ranges and multi-page table stitching.

Instructions

Zero-retention general-purpose PDF and scanned document extraction (POST /v1/pdf-extract, 2 credits per succeeded page, failed pages automatically refunded). Supports PDF, JPG, PNG, and WebP up to 10 MB / 20 pages with multi-page table stitching and optional custom JSON schema.

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": {
      "file": "<file>"
    },
    "name": "extract_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesLocal file path, base64 string, or data URL of the PDF or document image (PDF/JPG/PNG/WebP, max 10 MB).
modeNoExtraction mode: "auto" (tables + key-values, default), "tables" (spreadsheet tables), or "json" (key-value/schema extraction).
pagesNoOptional 1-based page range, e.g. "1-5" or "1,3,5-8".
schemaNoOptional custom JSON schema object to guide structured extraction.
stitch_tablesNoWhether to stitch tables that continue across consecutive pages.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds genuinely non-inferable behavior: zero data retention, 2 credits per succeeded page, automatic refund for failed pages, and the 10 MB / 20-page ceilings. It stops short of describing latency, batch behavior, or failure modes beyond refunds.

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?

A single front-loaded sentence with the retention guarantee and endpoint first, followed by a compact parenthetical on pricing and limits. It is dense but every clause carries information; the parenthetical is slightly overloaded but not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five parameters, full schema coverage, and rich annotations, most of the definitional burden is met. However, with no output schema and no statement of what extraction actually returns (tables as markdown/CSV, key-value JSON shape), an agent cannot plan downstream handling, which is a meaningful gap for an extraction tool.

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%, and the description mostly restates what the schema already documents (formats, size limit, custom JSON schema, stitching). The baseline of 3 applies; no new parameter semantics such as mode precedence or page-range interaction with the page cap are added.

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: extraction of tables, key-values, and custom JSON from PDFs and scanned document images, with the endpoint (POST /v1/pdf-extract) named. It does not, however, distinguish itself from siblings like scan_document or image_to_excel, so an agent must still infer why this is the 'general-purpose' option.

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?

The phrase 'general-purpose' implies broad applicability and the supported formats/size caps hint at scope, but there is no explicit when-to-use vs when-to-use-a-sibling guidance and no exclusions. Use for multi-page table work with stitching is only implied.

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