Skip to main content
Glama

Rebuild a book's PDF

generate_pdf

Build or rebuild the printable PDF for a book from its current page images, or for a paperback cover from its current sides. Call it once a cover is IMAGES_READY to get the cover's print PDF, and again after fit_cover_to_kdp or regenerate_image on it. Needed after regenerate_image: regenerating a page replaces that page's image but does NOT rebuild the PDF, so the download stays stale until this runs. Regenerate every page you want to fix first, wait for get_job_status to show IMAGES_READY, then call this once: it is refused while a page is still being redrawn. Poll get_job_status with the same jobId for the new pdfUrl. Costs no credits.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "jobId": "<jobId>"
    },
    "name": "generate_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobIdYesThe jobId of the book to rebuild, as returned by a book creation tool or get_job_status.
storyFontSizePointsNoStory coloring books only, and only when the person asked for a different text size: rebuild with the story text at this size in points, kept for later rebuilds. null goes back to the size chosen by the reader's age. Leave it out to keep the book's current size. Works on a finished book too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / storyFontSizePoints
      Added value: +{
      +  "description": "Story coloring books only, and only when the person asked for a different text size: rebuild with the story text at this size in points, kept for later rebuilds. null goes back to the size chosen by the reader's age. Leave it out to keep the book's current size. Works on a finished book too.",
      +  "enum": [
      +    14,
      +    16,
      +    18,
      +    20,
      +    22,
      +    24,
      +    26,
      +    28,
      +    30,
      +    32,
      +    34,
      +    36,
      +    null
      +  ],
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, destructiveHint=false and openWorldHint=false; the description goes well beyond them by disclosing that regenerating a page does NOT rebuild the PDF (so the download stays stale), that the call is refused mid-redraw, that the result is retrieved asynchronously via get_job_status/pdfUrl, and that it costs no credits.

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?

Front-loaded with the core action, then the sequencing rules, then cost. Most sentences carry new information, though the stale-download explanation and the 'regenerate every page first / wait for IMAGES_READY' sentence overlap somewhat and could be tightened.

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

Completeness5/5

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

Covers everything an agent needs for a two-parameter, asynchronous rebuild: preconditions, ordering, refusal behavior, how to retrieve the result, and cost. With no output schema, the pointer to get_job_status for the new pdfUrl fills the return-value gap.

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 both jobId and storyFontSizePoints (including the null-reset and omit-to-keep semantics) are already fully documented in the schema. The description adds only the incidental note that the same jobId is used when polling; it says nothing extra about the font-size parameter. Baseline 3 applies.

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?

States a specific verb and resource — build/rebuild the printable PDF for a book from current page images, or a cover PDF from current sides — and implicitly separates itself from regenerate_image (which changes images) and fit_cover_to_kdp (which resizes the cover). An agent can identify the operation without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit triggers (call once a cover is IMAGES_READY, again after fit_cover_to_kdp or regenerate_image) and an explicit sequencing rule (regenerate all pages first, wait for IMAGES_READY, then call once). It also names the blocking condition — the call is refused while a page is still being redrawn — and the follow-up action, polling get_job_status with the same jobId.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources