Skip to main content
Glama

pdf_generate

Convert HTML content to PDF documents using IteraTools MCP. This tool processes HTML input to create formatted PDF files for documentation, reports, or sharing purposes.

Instructions

Generate a PDF from HTML content ($0.003)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYes

Implementation Reference

  • index.js:50-79 (handler)
    The generic `callTool` function handles all tool executions by dispatching them to the IteraTools API endpoint corresponding to the tool definition.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
  • index.js:34-34 (registration)
    Registration of the 'pdf_generate' tool in the TOOLS array, defining its schema, endpoint, and price.
    { name: 'pdf_generate', description: 'Generate a PDF from HTML content', inputSchema: { type: 'object', properties: { html: { type: 'string' } }, required: ['html'] }, endpoint: '/pdf/generate', price: '$0.003' },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses pricing ($0.003) but fails to specify critical behavioral traits: the return format (URL, file ID, or binary data), file size limits, supported CSS, or error handling for malformed HTML.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is front-loaded with the action and includes cost information efficiently. However, given the lack of schema descriptions and output schema, it is inappropriately brief—verging on under-specification rather than effective conciseness.

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 no output schema, no annotations, and 0% parameter coverage, the description is incomplete. It omits essential information about what the tool returns (critical for a generation tool) and parameter validation rules, leaving significant gaps.

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

Parameters2/5

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

Schema description coverage is 0%, requiring the description to compensate. While it identifies the 'html' parameter's general purpose (HTML content), it lacks constraints, expected format (full document vs fragment), encoding details, or size limits necessary for correct invocation.

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?

States a specific verb (Generate), resource (PDF), and input format (HTML content). The name and verb distinguish it from sibling pdf_extract, though it doesn't explicitly mention this distinction in the text.

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?

Provides no guidance on when to use this tool versus alternatives (e.g., when to use pdf_extract), no prerequisites, and no exclusions. The cost hint ($0.003) is useful but does not constitute usage guidance.

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/fredpsantos33/itera-tools-mcp'

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