Skip to main content
Glama

Remote Desktop Commander

write_pdf

Destructive
                    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.

                    Paths refer to the selected device. Relative paths depend on that device's 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

NameRequiredDescriptionDefault
pathYes
contentYes
optionsNo
deviceIdNoThe ID of the device to run this tool on (from list_devices). Required when more than one device is online; may be omitted when only one device is connected.
outputPathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds crucial context: modifications preserve the original PDF and require a new outputPath, and operation is limited to allowed directories. That goes beyond the annotation, though it doesn't discuss error behavior or return payload shape.

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?

Front-loads the core purpose and modes well, but carries redundancy ('Dedicated PDF creation and modification tool' repeats the opening) and trailing boilerplate about 'DC:' references that doesn't help correct invocation. The examples earn their space, but trimming would improve it.

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 mutation tool with no output schema and nested operation objects, the description covers modes, operations, page breaks, styling, and path constraints thoroughly. The opaque 'options' parameter is left undocumented, which keeps it from fully complete.

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 coverage is only 20%, so the description must compensate and largely does: it explains path, the dual string/array nature of content with worked examples, the required outputPath for new files, and the exact operation object shapes (delete/insert with pageIndexes/pageIndex/markdown/sourcePdfPath). It leaves 'options' and 'deviceId' unexplained, keeping it from a 5.

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 ('Create a new PDF file or modify an existing one') and reinforces it as a 'Dedicated PDF creation and modification tool.' An agent can immediately tell this apart from the generic write_file sibling because it operates on PDFs specifically.

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?

Explicitly lays out two modes (CREATE NEW vs MODIFY EXISTING) and the condition selecting each: a string content for creation, an array of operations for modification. It also states the constraint that modification requires a different filename. It does not compare against write_file or other siblings, so not a 5.

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.