Skip to main content
Glama

Apply palette

apply_palette
Destructive

Apply multiple color replacements in one reversible operation. Re-theme or rebrand a document's colors by mapping source colors to replacements, all under a single snapshot for easy undo.

Instructions

Apply many from -> to colour replacements in a single reversible operation.

When to use: re-theming / rebranding a document's colours in one shot. For a single colour swap use replace_color; to recolour specific objects use set_fill / set_stroke.

Key params: mapping maps each source colour to its replacement; every key AND value is strictly colour-validated UP FRONT — a typo'd or non-colour entry (e.g. notacolor) is rejected with a ToolError BEFORE any mutation, op record, or snapshot is created. Each reuses the replace_color matching logic. scope_ids, if given, confines all replacements to those elements' subtrees.

Return shape: EditResultoperation_id, snapshot_id, changed (a real before/after content diff), before/after preview; the whole palette is applied under one snapshot (reversible).

Example: apply_palette(doc_id, {"#ff0000": "#3366cc", "#00ff00": "#66cc33"})

Render and look before you trust this edit: render with render_preview (or live_render_view) and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.

Risk class: medium.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes
mappingYes
scope_idsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes
changedYes
summaryNo
snapshot_idYes
operation_idYes
preview_afterNo
preview_beforeNo
Behavior5/5

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

Annotations show destructiveHint=true; description adds validation fails before mutation, single snapshot for reversal, risk class, and return shape. Discloses preview recommendation.

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?

Well-structured with sections, but slightly lengthy. Front-loaded with purpose. Each sentence adds value.

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 purpose, usage, parameters, return shape, error handling, risk, and preview recommendation. Output schema exists, so return is explained. Complete for a complex mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema coverage, description explains mapping validation (typod colors rejected with ToolError), scope_ids confinement, and provides example. Fully compensates.

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?

Clear verb+resource: 'Apply many colour replacements in a single reversible operation.' Distinguishes from siblings like replace_color, set_fill, set_stroke.

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?

Explicit when-to-use: 're-theming / rebranding a document's colours in one shot.' Provides alternatives: for single swap use replace_color; for specific objects use set_fill/set_stroke.

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/jjjsood/inkscape-mcp-server'

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