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).

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": {
      "type": "<type>"
    },
    "name": "extract_data"
  }
}

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. Changed6 schema fields changed
    • removedOutput schema / properties / file / properties / bytes / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / file / properties / bytes / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / file / properties / download_url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / file / properties / download_url / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / file / properties / pages / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / file / properties / pages / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds genuinely new behavioral context beyond that: the work is AI-driven but self-checked in code ('totals, added up', 'balances compared', 'cell by cell'), which tells an agent how trustworthy and how granular the output is. Minor gap: it does not clarify that excel/csv production creates an output artifact, which an agent might want to know given the read-only hint.

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?

The description is a single dense but well-ordered sentence pair: mode enumeration first, output-format behavior last, which matches the decision order an agent faces. No filler sentences. It is packed tightly enough that the parentheticals are slightly clipped, but nothing is wasted.

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?

For an 8-parameter tool with a nested file object, the description covers the two enum switches well and an output schema handles return values. What it omits is meaningful: the instructions parameter has no description anywhere, and the four ways to point at a file are undocumented in the description. An agent could still call it correctly for the common case, but not confidently for the file-input or instructions cases.

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%, and the description does explain the semantics of the two most important parameters: the four type modes and the three output modes, including the non-obvious constraint that excel/csv only applies to tables and statement. That is real value the schema does not carry, since type and output have no descriptions. But it says nothing about the four file-input variants or the instructions parameter, leaving those to schema alone.

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?

The description gives a specific verb and resource ('Read structured data with AI and check it in code') and then enumerates the four extraction modes with parenthetical detail: invoice with fields/lines/totals, statement with transactions and balance comparison, tables cell by cell, and custom JSON Schema. That makes it clearly a structured-extraction tool rather than a chat/Q&A tool like ask_pdf or summarize_pdf. It stops short of naming a sibling explicitly, so it lands at 4 rather than 5.

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?

There is useful conditional guidance on the output side: json returns data inline, while excel or csv additionally produces a spreadsheet and only applies to tables and statement. That is a real when-to-use rule. However, nothing says when to choose this over ask_pdf, summarize_pdf, or ocr_pdf, and nothing explains when to supply file vs file_id vs file_url vs library_file_id.

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.