Skip to main content
Glama

Set fill

set_fill
Idempotent

Set the fill color and opacity of specified SVG objects using hex, RGB, HSL, or named colors.

Instructions

Set the fill colour (and optional fill opacity) of one or more objects.

When to use: recolouring specific objects' fill (get the ids from find_objects). To change every instance of a colour document-wide use replace_color; for a whole theme use apply_palette; for the outline use set_stroke.

Key params: color accepts hex, rgb()/rgba()/hsl()/hsla(), a named colour, or a url(#id) paint-server reference — a gradient/pattern in <defs>, e.g. an id from add_linear_gradient / add_radial_gradient (optionally with a fallback colour: url(#id) red). External urls, javascript:, and CSS-injection punctuation are rejected. opacity, if given, in [0, 1].

Return shape: EditResultoperation_id, snapshot_id, changed (false if the colour was already present), before/after preview; the edit lands on the working copy only (reversible).

Example: set_fill(doc_id, ["logo"], "#3366cc")

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
colorYes
doc_idYes
opacityNo
object_idsYes

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?

Beyond annotations (idempotent, non-destructive), the description reveals the edit lands on a reversible working copy, advises rendering before trusting, and assigns a risk class, offering full behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with front-loaded purpose, followed by usage, key parameters, return shape, example, and caution. Every sentence adds value without unnecessary verbosity.

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?

Given the tool's complexity (4 params, output schema exists), the description covers usage, parameter details, return shape (EditResult fields), example, and risk advisory, leaving no gaps.

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?

With 0% schema coverage, the description compensates thoroughly: it explains color format (hex, rgb, named, url references), rejection of unsafe inputs, opacity range [0,1], and provides an example clarifying object_ids usage.

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 the tool sets the fill colour and optional opacity for one or more objects, distinguishing it from siblings like replace_color, apply_palette, and set_stroke by specifying scope.

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?

Explicitly states when to use (recolouring specific objects' fill) and when not (document-wide colour change or outline), providing specific alternative tools: replace_color, apply_palette, 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