Skip to main content
Glama

Set stroke

set_stroke
Idempotent

Set the stroke color, width, or opacity of selected objects to style their outline or border.

Instructions

Set the stroke colour, width, and/or opacity of one or more objects.

When to use: styling an object's outline/border. For the interior use set_fill; to turn a stroke into a filled outline path use stroke_to_path.

Key params: at least one of color, width, opacity must be supplied. color accepts a colour OR a url(#id) paint-server reference (gradient/pattern in <defs>, optionally with a fallback colour); width is a CSS length (number + optional unit); opacity must be in [0, 1]. External urls, javascript:, and CSS-injection punctuation are rejected.

Return shape: EditResultoperation_id, snapshot_id, changed, before/after preview; the edit lands on the working copy only (reversible).

Example: set_stroke(doc_id, ["border"], color="#000", width="2")

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
colorNo
widthNo
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?

Annotations already declare idempotentHint=true and destructiveHint=false. Description adds critical behavioral details: edit lands on working copy only (reversible), security constraints (rejection of external urls, javascript:, CSS-injection), and a 'Risk class: medium' tag. No contradictions.

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?

Well-structured with clear sections: main action, when to use, key params, return shape, example, rendering advice, risk. Every sentence is informative and earns its place. Front-loaded with the primary purpose.

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 presence of output schema (EditResult), description focuses on usage and behavior. Covers parameter constraints, security, reversibility, and post-edit validation. Complete for a styling tool with moderate complexity.

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?

Schema coverage is 0%, so description must carry full burden. It explains key params: 'at least one of color, width, opacity must be supplied', describes color as a colour or url(#id) reference, width as CSS length, opacity in [0,1], and security filtering. This adds substantial meaning beyond the schema types.

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 explicitly states 'Set the stroke colour, width, and/or opacity of one or more objects' with a specific verb and resource. It distinguishes from siblings by mentioning 'set_fill' for interior and 'stroke_to_path' for converting to outline.

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?

Includes a 'When to use' section (styling outline/border) and clear alternatives: 'For the interior use set_fill; to turn a stroke into a filled outline path use stroke_to_path'. Also advises to render and inspect before trusting, and to use restore_snapshot for reversion.

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