Skip to main content
Glama
pdf4me
by pdf4me

AI-Invoice Parser

process_invoice

Extract structured invoice data from PDF or image files via AI-powered parsing, returning key fields like invoice number, vendor, and total.

Instructions

AI-Invoice Parser: extract structured invoice data from a document via PDF4me POST /api/v2/ProcessInvoice (async: 202 + Location poll until JSON result). Provide pdf_file_path (local .pdf/.png/.jpg/.jpeg read as Base64). doc_name: logical document name for the API (e.g. invoice.pdf); optional (defaults to the file basename). Optional custom_field_keys: non-empty list of extra field names for the model to extract; omit the parameter when you have no custom keys (empty lists are not sent). Saves the full API JSON to process_invoice.json and returns key fields (invoiceNumber, vendorName, total, success, …).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_nameNo
output_dirNo
pdf_file_pathNo
custom_field_keysNo
Behavior4/5

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

With no annotations, the description carries full burden and discloses async behavior (202 + Location poll until JSON), the side effect of saving JSON to process_invoice.json, and the returned key fields. It also notes that empty custom_field_keys are omitted. It does not cover failure modes or rate limits, but core behavior is well explained.

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 dense but efficient: each sentence adds essential information—purpose, async flow, parameter usage, and output behavior. There is no filler or 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?

For a 4-param tool with no annotations or output schema, the description covers input handling, async polling, file output, and return fields. The missing output_dir parameter and lack of error-handling details keep it from being fully complete, but it is sufficiently rich for an agent to invoke the tool correctly.

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?

The description explains pdf_file_path (accepted file types, Base64 reading), doc_name (optional, defaults to basename), and custom_field_keys (omit when no custom keys). However, output_dir is completely undocumented while schema coverage is 0%, leaving one of four parameters without semantic guidance.

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 opens with a specific verb+resource: 'extract structured invoice data from a document' and names the exact PDF4me endpoint. This clearly distinguishes it from sibling tools like process_receipt and process_universal_document by focusing on invoices.

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?

Provides clear operational context: when extracting invoice data, supply pdf_file_path, with optional doc_name and custom_field_keys. It does not explicitly name alternatives or exclusion criteria, but the invoice-specific scope makes usage clear; slight deduction for no 'when not to use' guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdf4me/pdf4me-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server