Skip to main content
Glama

pdf_invert_colors

Recolor PDF pages into dark mode, true invert, high contrast, or sepia for night reading and accessibility. Converts white-background PDFs into eye-friendly output by modifying page color streams.

Instructions

Recolor PDF pages into dark mode, true inverted colors, high contrast, or sepia palette for night reading or accessibility. When to use: transforming white-background PDFs into eye-friendly dark mode, sepia, or high-contrast output. Difference from related tools: modifies PDF page color streams directly rather than rendering static images (use pdf_render) or compressing streams (use pdf_compress). Key parameters: input, output; optional mode ('dark_mode', 'true_invert', 'high_contrast', 'sepia'; default 'dark_mode'), pages (1-based CSV). [Input: PDF (.pdf) | Output: PDF (.pdf)]

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": {
      "input": "<input>",
      "output": "<output>"
    },
    "name": "pdf_invert_colors"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoColor transform preset (default 'dark_mode').dark_mode
inputYesPath to the input PDF file.
pagesNoOptional comma-separated 1-based page numbers (e.g., '1,3,5'); defaults to all pages.
outputYesDestination path for the color-transformed .pdf file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does volunteer the mechanism (direct page color-stream modification) and that the result goes to a new output path, but says nothing about overwrite behavior when output already exists, whether input is touched, permission/encryption prerequisites, or that raster pages pass through unchanged.

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 purpose, then labeled sections for when-to-use, sibling differentiation, and parameters, with a compact format line at the end. The 'When to use' phrase partly echoes the opening sentence, a small redundancy, but overall it is dense with no filler.

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 four-parameter transform tool with no output schema and no annotations, the description covers purpose, alternatives, mode values, page selection, and the PDF-in/PDF-out contract. The remaining gap is failure modes (scanned pages, encrypted PDFs, in-place overwrite), which an agent would want before committing.

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 coverage is 100% and the schema already documents mode, its enum, the default, and the 1-based CSV format for pages, so the description is largely restating structured data. It adds no semantics the schema lacks, such as whether page numbers are validated against the document length or how out-of-range values are handled.

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 ('Recolor') and resource ('PDF pages') plus the four output palettes, and explicitly distinguishes itself from pdf_render and pdf_compress by naming the mechanism ('modifies PDF page color streams directly'). An agent can tell this apart from siblings without opening any schema.

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?

Gives an explicit 'When to use' clause scoped to white-background PDFs and names two alternatives with the conditions that select them (image rendering -> pdf_render, stream size -> pdf_compress). It stops short of any exclusion for the case that actually matters here: image-only or scanned PDFs, where color-stream rewriting does nothing.

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