Skip to main content
Glama

receipt_to_document

Extract data from receipt images and generate expense reports as PDF, DOCX, or ODT in one step, using AI extraction and customizable templates.

Instructions

Extract receipt data and generate an expense report document.

Combines AI extraction with document generation in a single step.

Args: image_base64: Base64-encoded receipt image or PDF. filename: Original filename. content_type: MIME type (default: image/jpeg). output_format: Output format – PDF, DOCX, or ODT (default: PDF). title: Document title (default: "Spesenbeleg"). template_name: Optional template for the expense report layout.

Returns: JSON with extracted data and base64-encoded document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_base64Yes
filenameNoreceipt.jpg
content_typeNoimage/jpeg
output_formatNoPDF
titleNoSpesenbeleg
template_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries full burden. It mentions AI extraction and document generation, and states the output format (JSON + base64 document). However, it does not disclose potential side effects, costs, or limitations (e.g., supported image types, file size limits).

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 fairly concise, with a purpose sentence and a clear argument list. It front-loads the key benefit ('single step'). Minor improvement: the args list could be better formatted for readability, but overall it is efficient.

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 6 parameters (1 required), absence of annotations, and existence of an output schema, the description adequately covers the tool's functionality and parameter semantics. It could be improved by mentioning error handling or supported receipt types, but it is sufficient for an AI agent.

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?

Schema description coverage is 0%, so the description's brief explanations for each parameter add necessary context. For example, it explains that image_base64 is base64-encoded receipt image or PDF, and output_format lists possible formats. However, it could be more specific (e.g., valid MIME types for content_type).

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 clearly states it combines receipt data extraction and expense report document generation into one step, distinguishing it from sibling tools that do only extraction (extract_receipt) or only document generation (generate_document).

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?

The description implies usage as a single-step end-to-end solution, but does not explicitly state when to use it over the two-step alternative (extract_receipt then generate_document). No when-not or alternative conditions are given.

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/dokmatiq/docgen-sdks'

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