Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

write_pdf

Destructive

Create new PDFs from markdown or modify existing PDFs by deleting or inserting pages with support for advanced styling.

Instructions

                    Create a new PDF file or modify an existing one.

                    THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES.

                    RULES ABOUT FILENAMES:
                    - When creating a new PDF, 'outputPath' MUST be provided and MUST use a new unique 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'.
                       - NEVER overwrite the original file.
                       - ALWAYS provide a new filename in 'outputPath'.
                       - After modifying, show original file path and new file path to user.

                       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.

                    IMPORTANT: Always use absolute paths for reliability. Paths are automatically normalized regardless of slash direction. Relative paths may fail as they depend on the current working directory. Tilde paths (~/...) might not work in all contexts. Unless the user explicitly asks for relative paths, use absolute paths.
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes
outputPathNo
optionsNo
Behavior5/5

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

Beyond the destructiveHint annotation, the description details behavioral traits: file naming rules, modes, operations, page breaks, styling support, path handling (absolute paths recommended, relative may fail), and directory restrictions.

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?

The description is front-loaded with purpose and rules, then details modes and operations. While comprehensive, it is lengthy; however, the complexity of the tool justifies the verbosity. Remains well-structured.

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?

For a tool with two modes, multiple operations, and advanced styling, the description is exceptionally complete. It covers all critical aspects including page breaks, styling, path guidance, and examples, leaving no significant 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?

With 0% schema description coverage, the description thoroughly explains 'path' (via examples), 'content' (with modes and operation schemas), and 'outputPath' (mandatory for modify). However, 'options' parameter is not explained, slightly reducing completeness.

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 'Create a new PDF file or modify an existing one' and explicitly declares 'THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES,' distinguishing it from sibling tools.

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?

Provides explicit when-to-use guidance, including rules for filenames, modes (create vs modify), and contrasts with other tools by declaring exclusivity. Also includes instructions like never overwrite original files.

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/wonderwhy-er/DesktopCommanderMCP'

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