Skip to main content
Glama
pdf4me
by pdf4me

AI - Universal Document Data Extraction

process_universal_document

Extract specific named fields from documents with AI. Provide file path and field names; receive structured data in JSON.

Instructions

AI - Universal Document Data Extraction (processUniversalDocument): extract named fields via PDF4me POST /api/v2/ProcessUniversalDocument. docName = file basename if available, else doc_name, else 'document.pdf'. fields (required): at least one field name—use fields and/or fields_csv (comma-separated, trimmed). mode: 0 Standard (default) or 1 Strict. isAsync true. Optional documentType (omit if empty); optional profiles (sanitized). Provide pdf_file_path (local .pdf/.png/.jpg/.jpeg). 202 + Location poll; saves process_universal_document.json.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo
fieldsNo
doc_nameNo
profilesNo
fields_csvNo
output_dirNo
document_typeNo
pdf_file_pathNo
Behavior4/5

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

The description discloses key behaviors: isAsync true, 202 + Location polling, output file name, naming logic for docName, and required fields. Since annotations are absent, this carries the full burden, and it does so well, though it omits error scenarios and output content details.

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 paragraph with no fluff, but the packed technical details could be better structured. It is concise enough, with each clause carrying meaningful information.

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 tool with zero schema descriptions and no annotations, the description covers most operational aspects: input fields, async behavior, output file, and file types. However, it omits output_dir semantics, output JSON structure, and failure handling, leaving some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains fields and fields_csv (comma-separated, trimmed), mode (0 Standard/1 Strict), doc_name logic, document_type (omit if empty), profiles (sanitized), and pdf_file_path formats. However, output_dir is not mentioned, and the schema provides no descriptions, so this is a strong but incomplete compensation.

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 states 'extract named fields via PDF4me POST /api/v2/ProcessUniversalDocument' with a specific verb ('extract'), resource (document), and scope (named fields). It distinguishes from sibling process_* tools by emphasizing 'Universal' and user-specified fields, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to choose this tool over alternatives like process_invoice or parse_document. The description is purely technical, providing API details but not strategic use cases or exclusion criteria.

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