Skip to main content
Glama

Create rectangle

create_rect

Insert a rectangle into the document at specified x, y coordinates with width, height, and optional corner radii. Supports fill and stroke styling in one step.

Instructions

Create a <rect> at (x, y) sized width / height (> 0), with optional corner radii.

When to use: drawing a rectangle / square / box. For an ellipse use create_circle / create_ellipse; for a freeform shape use create_path.

Key params: width / height > 0; rx / ry optional corner radii; inserted into parent_id (must exist) or the document default parent (first layer, else root); object_id to pin the id. Optional fill / stroke / stroke_width paint the shape IN THIS CALL — validated exactly like set_fill / set_stroke (colour or url(#id); CSS length) — so no mandatory second styling call (default None = unpainted, prior behaviour).

Return shape: CreateResultobject_id (new id), analytic bbox, plus the pipeline fields (operation_id, snapshot_id, changed, before/after preview).

Example: create_rect(doc_id, 10, 10, 100, 60, rx=8, fill="#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 (reversible write-new on the working copy; original untouched).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
rxNo
ryNo
fillNo
widthYes
doc_idYes
heightYes
strokeNo
object_idNo
parent_idNo
stroke_widthNo

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?

Annotations indicate write operation (readOnlyHint false) but not destructive. Description adds context: 'reversible write-new', validation of fill/stroke like set_fill/set_stroke, and advice to preview before trusting. However, annotations already convey the basic safety profile.

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?

Description is well-structured with core purpose, usage, params, return, example, risk. Front-loaded but includes some redundancy (e.g., validation detail). Efficient overall.

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 12 parameters, output schema exists, and annotations provide base info, the description adds all needed context: return shape, example, risk class, validation behavior. No gaps.

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?

Schema coverage is 0%, but description explains key parameters: width/height >0, rx/ry optional, parent_id must exist, object_id pins id, fill/stroke validated like set_fill. Provides meaningful guidance beyond raw 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?

Description clearly states it creates a `<rect>` element with position, size, and optional radii. Distinguishes from siblings like create_circle, create_ellipse, create_path by explicitly naming alternatives.

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 ('drawing a rectangle / square / box') and when not (ellipse, freeform). Also provides risk class and revertibility advice.

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