Skip to main content
Glama
pdf4me
by pdf4me

AI-Process Contract

process_contract

Extract structured data from contract PDFs or images, returning JSON output via the PDF4me API.

Instructions

AI-Process Contract: extract structured data from a contract via PDF4me POST /api/v2/ProcessContract. Request JSON has only docContent, docName, and IsAsync (must be true); this action does not send customFieldKeys or CustomFieldKeys. Provide pdf_file_path (local .pdf/.png/.jpg/.jpeg as Base64). doc_name: logical file name (e.g. contract.pdf); optional (defaults to basename). Async: 202 + Location poll until JSON; saves process_contract.json.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_nameNo
output_dirNo
pdf_file_pathNo
Behavior4/5

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

With no annotations, the description discloses important behavior: only docContent/docName/IsAsync are sent, IsAsync must be true, the API returns 202 with a Location to poll, and the result is saved as process_contract.json. It does not cover errors or auth, but the core async behavior and side effect are clear.

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 dense and informative, front-loading the purpose and then giving params and async flow. There is minor redundancy/confusion around 'customFieldKeys or CustomFieldKeys', but overall it is well-structured for a tool with no output schema.

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 3 params, no annotations, and no output schema, the description covers the endpoint, the only params it sends, supported input formats, async behavior, and the saved output file. Missing output_dir semantics and return structure keep it from a 5.

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 (local file, formats, Base64) and doc_name (logical name, optional, defaults to basename), but says nothing about output_dir. Since schema coverage is 0%, this leaves one of three parameters undocumented, so it is useful but incomplete.

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 'extract structured data from a contract via PDF4me POST /api/v2/ProcessContract', which names a specific verb, resource, and target document type. This clearly distinguishes it from sibling process_* tools for invoices, receipts, and bank statements.

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 provides clear context: this is for contracts, takes a local file path, and uses an async polling flow. However, it does not explicitly say when not to use it or name alternatives like process_universal_document, so it misses the top tier.

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