Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

by wonderwhy-er

write_pdf

Destructive

Create a new PDF file or modify an existing one.

Instructions

                    Create a new PDF file or modify an existing one.

                    Dedicated PDF creation and modification tool.

                    OUTPUT FILES:
                    - Creating a PDF requires 'outputPath' with a new filename (e.g., "result_01.pdf", "analysis_2025_01.pdf", etc.).

                    MODES:
                    1. CREATE NEW PDF:
                       - Pass a markdown string as 'content'.
                       write_pdf(path="doc.pdf", content="# Title\n\nBody text...")

                    2. MODIFY EXISTING PDF:
                       - Pass array of operations as 'content'.
                       - Modifications preserve the original PDF and require a different filename in 'outputPath'.
                       - The result includes the original and output paths for reference.

                       write_pdf(path="doc.pdf", content=[
                           { type: "delete", pageIndexes: [0, 2] },
                           { type: "insert", pageIndex: 1, markdown: "# New Page" }
                       ])

                    OPERATIONS:
                    - delete: Remove pages by 0-based index.
                      { type: "delete", pageIndexes: [0, 1, 5] }

                    - insert: Add pages at a specific 0-based index.
                      { type: "insert", pageIndex: 0, markdown: "..." }
                      { type: "insert", pageIndex: 5, sourcePdfPath: "/path/to/source.pdf" }

                    PAGE BREAKS:
                    To force a page break, use this HTML element:
                    <div style="page-break-before: always;"></div>
                    
                    Example:
                    "# Page 1\n\n<div style=\"page-break-before: always;\"></div>\n\n# Page 2"

                    ADVANCED STYLING:
                    HTML/CSS and inline SVG are supported for:
                    - Text styling: colors, sizes, alignment, highlights
                    - Boxes: borders, backgrounds, padding, rounded corners
                    - SVG graphics: charts, diagrams, icons, shapes
                    - Images: <img src="/absolute/path/image.jpg" width="300" /> or ![alt](/path/image.jpg)

                    Supports standard markdown features including headers, lists, code blocks, tables, and basic formatting.

                    Only works within allowed directories.

                    Absolute paths are the most reliable because they do not depend on the current working directory. Paths are automatically normalized regardless of slash direction. Relative paths depend on the current working directory, and tilde paths (~/...) may not resolve in every context. Absolute paths are generally the most reliable.
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes
optionsNo
outputPathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.17

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, openWorldHint=false. The description adds meaningful context beyond them: modifications preserve the original PDF and require a distinct output filename, the result returns both original and output paths, and access is restricted to allowed directories. This is solid behavioral disclosure, though it doesn't clarify overwrite behavior at outputPath.

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 sectioning (MODES, OPERATIONS, PAGE BREAKS, ADVANCED STYLING) is well organized and front-loaded. However it is bloated: the final paragraph restates 'Absolute paths are the most reliable' twice, and the trailing 'DC: ...' boilerplate adds no invocation value. Wasteful repetition holds it to a 3.

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?

For a tool with no output schema and a nested anyOf parameter, the description supplies the essential operational detail: mode selection, both content shapes, operation syntax, page-break mechanism, and file path requirements. Only the unexplained 'options' parameter and overwrite semantics leave minor gaps.

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, and it largely does: 'content' is fully explained (markdown string for create, operations array for modify), 'path' vs 'outputPath' roles are spelled out, and the insert/delete operation shapes are documented with examples. The 'options' and 'pdfOptions' parameters remain entirely unexplained, keeping this from a 5.

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?

The description opens with a specific verb+resource ('Create a new PDF file or modify an existing one') and reinforces it with 'Dedicated PDF creation and modification tool.' This is clearly distinguished from generic file tools in concept, but it never explicitly names or contrasts with the sibling write_file, so it earns a 4 rather than a 5.

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?

It clearly separates the two modes (CREATE NEW vs MODIFY EXISTING) and gives the condition selecting each, plus concrete invocation examples. What's missing is any explicit when-not guidance or reference to alternative tools (e.g., write_file for non-PDF output), so it stops short of the 5 level.

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