Skip to main content
Glama

Add radial gradient

add_radial_gradient

Define a radial gradient centered at (cx, cy) with radius r and optional focal point. After defining, apply the gradient as a fill using set_fill.

Instructions

Add a <radialGradient> to the document <defs> (created if absent).

When to use: defining a centred/radial colour fade to paint with. For a directional fade use add_linear_gradient; after defining, apply via set_fill(doc_id, ids, "url(#gradient-id)").

Key params: stops is a list of {offset, color, opacity?} (≥ 1), as for the linear gradient. Centred at (cx, cy) with radius r (numbers or percentages; default a centred 50% circle); fx / fy optionally set the focal point.

Return shape: CreateResultobject_id is the gradient id (use as url(#id) paint), bbox=None, plus the pipeline fields.

Example: add_radial_gradient(doc_id, [{"offset": 0, "color": "#fff"}, {"offset": 1, "color": "#000"}])

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 (reversible write-new on the working copy; original untouched).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rNo50%
cxNo50%
cyNo50%
fxNo
fyNo
stopsYes
doc_idYes
object_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bboxNo
doc_idYes
changedYes
summaryNo
object_idYes
snapshot_idYes
operation_idYes
preview_afterNo
preview_beforeNo
Behavior4/5

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

Describes return shape (CreateResult with object_id and pipeline fields), warns about rendering before trusting, and classifies risk as medium (reversible write-new). This adds context beyond annotations, though no auth or rate limit details.

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?

Compact yet comprehensive: one paragraph with clear sections (action, usage, key params, return shape, example, risk warning). Every sentence adds value, no fluff.

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 has an output schema, the description covers everything needed: what it does, when to use, parameter details, return shape, example, and safety warning. No gaps for an agent to misuse.

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?

With 0% schema description coverage, the description compensates well by explaining stops (with format), cx, cy, r, fx, fy and their defaults. An example is provided. However, doc_id and object_id are not explained, but they are standard parameters.

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 it adds a radialGradient to the document defs, and distinguishes from the sibling tool add_linear_gradient by specifying when to use each.

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 specifies when to use (centred/radial colour fade), when not to (directional fade -> use add_linear_gradient), and how to apply the gradient afterwards with set_fill.

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