Skip to main content
Glama

Extract Tables

extract_tables
Read-onlyIdempotent

Extract tables and forms as Markdown from a PDF or image (base64-encoded). Use when the document contains structured tabular data such as financial statements, data sheets, or forms. For plain prose documents, use extract_text instead. Returns: { pages: number, text: string } — text contains Markdown-formatted tables. Example prompts:

  • "Extract the tables from this financial statement."

  • "Pull the data table from this PDF into Markdown format."

  • "Get the tabular data from this form document."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mime_typeYesMIME type of the document. Example: "application/pdf" for PDF bank statements, "image/jpeg" for photo of a form.
document_base64YesBase64-encoded PDF or image bytes (max ~15 MB). Example: "JVBERi0xLjcNJeLjz9MNCj..." (truncated PDF base64)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
pagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "pages": {
      +      "type": "number"
      +    },
      +    "text": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "pages",
      +    "text"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Base64-encoded PDF or image bytes (max ~15 MB)"New value: +"Base64-encoded PDF or image bytes (max ~15 MB). Example: \"JVBERi0xLjcNJeLjz9MNCj...\" (truncated PDF base64)"
    • changedInput schema / properties / mime_type / description
      Previous value: -"MIME type: application/pdf | image/jpeg | image/png | image/webp"New value: +"MIME type of the document. Example: \"application/pdf\" for PDF bank statements, \"image/jpeg\" for photo of a form."
  5. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds that input may be a base64 image or PDF and that output is Markdown, but it adds no operational detail beyond the schema/annotations (size limits, OCR behavior, multi-page handling) even though the size cap lives only in the schema description.

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, usage condition, and alternative in the first two sentences, then the return shape. The three example prompts are somewhat redundant with the usage sentence already given, which keeps it just short of a 5.

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?

An output schema exists and the description gratuitously restates the return shape, which is unnecessary but harmless. Combined with the sibling routing and complete parameter docs, an agent has everything needed; the only minor gap is that no behavioral edge cases (large files, non-tabular pages) are mentioned.

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 both parameters are fully documented in the schema, including the mime_type enum. The description only restates that the document is base64-encoded, adding no syntax or format meaning beyond what is already there, so the baseline 3 applies.

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 ('Extract tables and forms as Markdown'), names the input types (PDF or base64 image), and explicitly distinguishes itself from the sibling extract_text. An agent can route between the two without opening 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?

Gives an explicit use condition ('when the document contains structured tabular data such as financial statements, data sheets, or forms') and a named alternative for the opposite case ('For plain prose documents, use extract_text instead'). This is textbook when/when-not/alternative guidance.

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