Skip to main content
Glama
pdf4me
by pdf4me

add_html_header_footer_to_pdf

Add custom HTML as header, footer, or both on PDF pages, with options to target specific pages, set margins, and skip the first page.

Instructions

Add HTML as header, footer, or both on PDF pages using PDF4me AddHtmlHeaderFooter (/api/v2/AddHtmlHeaderFooter). html_content is a plain HTML string (not base64). header_footer_location is Header, Footer, or Both. Optional: pages (empty string = all), skip_first_page, pixel margins, output path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNo
margin_topNo
output_dirNo
margin_leftNo
html_contentYes
margin_rightNo
margin_bottomNo
pdf_file_pathYes
skip_first_pageNo
output_file_nameNo
request_doc_nameNo
header_footer_locationYes
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses important format constraints (html_content is plain HTML, not base64), the meaning of pages (empty string = all), and mentions optional parameters like skip_first_page and margins. However, it does not state whether the operation modifies the input PDF in place or creates a new output file, nor does it mention authentication, rate limits, or side effects like overwriting files. Some behavioral context is provided, but not complete.

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 three sentences, front-loaded with the core purpose, and lists key parameters without fluff. Every sentence carries information, and it avoids excessive detail or repetition. It is appropriately sized for the tool's complexity.

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

Completeness3/5

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

For a 12-parameter tool with no annotations and no output schema, the description is not fully complete. It covers the main required and some optional parameters, but leaves several parameters unexplained (output_dir, output_file_name, request_doc_name) and does not describe expected behavior on failure or output format. The description gives a good starting point but would benefit from more detail to ensure correct invocation in all cases.

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 must compensate. It adds significant meaning for key parameters: html_content format, header_footer_location enum values, pages default to all, skip_first_page, pixel margins, and output path. However, it does not fully clarify all 12 parameters, especially the distinction between output_dir, output_file_name, and request_doc_name, or the specific margin parameter names. It provides substantial value beyond the bare schema, but leaves some ambiguity.

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: adding HTML as a header, footer, or both to PDF pages. It names the specific API endpoint (AddHtmlHeaderFooter), and the verb-resource combination ('Add HTML as header, footer, or both on PDF pages') distinguishes it from sibling tools like add_page_number_to_pdf or add_image_stamp_to_pdf.

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?

The description implies usage by explaining what the tool does and key parameters, but it does not explicitly state when to use this tool over alternatives or provide exclusions. For example, it does not mention that this tool is for custom HTML content rather than simple page numbers or stamps, or that it might not be suitable for other header/footer needs. The context is clear enough for an agent to infer, but explicit guidance is missing.

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