Skip to main content
Glama

Extract data from a PDF

extract_data
Read-onlyIdempotent

Read structured data with AI and check it in code: invoice (fields, lines and totals, added up), statement (bank transactions, balances compared), tables (every table, cell by cell), or schema (your own JSON Schema). Output json returns the data here; excel or csv also makes a spreadsheet file (tables and statement).

Input Schema

NameRequiredDescriptionDefault
fileNoA file the person attached in ChatGPT (filled in by ChatGPT).
typeYes
outputNo
schemaNoFor type schema: a JSON Schema object.
file_idNoA FynePDF file_id from upload_file, import_file_from_url or an earlier tool.
file_urlNoA public link to the file.
instructionsNo
library_file_idNoA file from the person's FynePDF Library (from list_library_files).

Output Schema

NameRequiredDescriptionDefault
dataNo
fileNo
typeYes
checksNo
job_idNo
messageYes
unverifiedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so safety is covered. The description adds valuable behavioral context beyond annotations: AI-based validation, arithmetic checks for invoice totals and statement balances, cell-by-cell table extraction, and the difference between json output and spreadsheet-file creation for excel/csv.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core action, then quickly covers extraction modes and output implications. Every clause contributes useful information without unnecessary repetition.

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?

Given the complexity of 8 parameters, nested file object, output schema, and annotations, the description is largely complete for the main extraction modes and output behavior. It is less complete on input source selection and the instructions parameter, but the schema covers some of those gaps and the output schema removes the need to describe return values.

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 63%, so the schema carries much of the parameter documentation. The description adds meaning for the type enum options and output behavior, but it does not explain file source parameters like file_id, file_url, library_file_id, the nested file object, or instructions, leaving several parameters reliant on schema text.

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 specific verb and resource — read structured data from a PDF with AI — and enumerates the distinct extraction modes (invoice, statement, tables, schema). An agent can distinguish this from siblings like ask_pdf or summarize_pdf based on the structured extraction focus.

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?

It clearly explains the available extraction modes and output choices, giving useful context for selecting type and output. However, it does not explicitly name alternatives such as ask_pdf for questions or ocr_pdf for scanned documents, nor does it state when not to use the tool.

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.