Skip to main content
Glama
pdf4me
by pdf4me

generate_document_single

Generate a single document from a template by supplying template file and data, then save the result as PDF, DOCX, or HTML.

Instructions

Generate a single document from a template using PDF4me GenerateDocumentSingle API (POST /api/v2/GenerateDocumentSingle). Supports template file, document data text/file, output type, and async polling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_dirYesDirectory to save output (required).
output_typeYesOne of backend-supported values: PDF, Docx, Html.
file_meta_dataNoOptional fileMetaData string.
meta_data_jsonNoOptional metaDataJson string.
output_file_nameYesOutput file name (required).
document_data_typeYesOne of backend-supported values: Json, XML, or Text (plain text data).
template_file_nameYesTemplate file name sent to API.
template_file_pathYesLocal path to template file (html/docx/pdf/etc).
template_file_typeYesOne of backend-supported values: Docx, Html, Pdf, MailMerge, GoogleDocs.
document_data_file_pathNoLocal data file path to send as base64 documentDataFile.
document_data_text_pathNoLocal path to text data (JSON/XML text) for documentDataText.
Behavior3/5

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

No annotations exist, so the description carries the full burden. It adds some behavioral context by mentioning 'async polling' and supported input types, but it does not disclose auth requirements, output file behavior (e.g., overwriting), or error handling.

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?

A single, front-loaded sentence that efficiently conveys the tool's purpose, API reference, and key supported features. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 11 parameters, no output schema, and no annotations, the description is too thin. It fails to clarify the 'async polling' mechanism (does the tool wait or return a job ID?), how to choose between document_data_file_path and document_data_text_path, or the meaning of required fields. The high parameter complexity demands more guidance.

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 100%, so every parameter already has a description. The description only summarizes categories (template file, document data text/file, output type) without adding new meaning or clarifying relationships between optional parameters.

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 the tool's function: generating a single document from a template, with the specific API endpoint. The word 'single' distinguishes it from sibling tool generate_documents_multiple.

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?

It implies use for single-document generation but does not explicitly mention when to use alternatives (e.g., generate_documents_multiple for multiple documents) or provide exclusions. No explicit guidance is 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/pdf4me/pdf4me-mcp'

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