Skip to main content
Glama

Resize canvas

resize_canvas
Idempotent

Resize the document canvas to new width and height, with optional viewBox adjustment or print bleed.

Instructions

Set the document canvas width / height to validated CSS lengths.

When to use: changing the PAGE size. To crop the page to the art use fit_to_content, to repair the viewBox use normalize_viewbox, to resize one OBJECT use scale_object.

Key params: width/height are validated CSS lengths; child geometry is not altered. By default an existing viewBox is preserved (synthesized only when absent). adjust_viewbox=True RETARGETS the viewBox to "0 0 W H" so it tracks the new canvas (opt-in; changes the coordinate system). BLEED (opt-in): bleed > 0 ALSO grows the viewBox outward by that many user units on every side and paints the new border strip with bleed_color (validated colour, default white) via one background <rect> behind all content — a print-bleed resize in ONE call instead of a second scale_object/background step. bleed needs a valid existing or derivable viewBox and is mutually exclusive with adjust_viewbox.

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

Example: resize_canvas(doc_id, "800", "600"); with bleed: resize_canvas(doc_id, "800", "600", bleed=8, bleed_color="#fff")

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
bleedNo
widthYes
doc_idYes
heightYes
bleed_colorNo#ffffff
adjust_viewboxNo

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?

Description covers all behavioral traits: child geometry unchanged, viewBox preservation vs adjustment, bleed behavior with viewBox growth and background rect, mutual exclusivity of bleed and adjust_viewbox, and return shape with EditResult. Annotations provide readOnlyHint, destructiveHint, idempotentHint; description adds risk class and working copy edit 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?

Well-structured with clear sections, each sentence adds value. No filler. Includes purpose, usage, key params, return shape, example, and caution.

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?

Complete coverage for a 6-parameter tool with 3 required, no nested objects, and output schema. Describes all parameters, edge cases, return value, and provides example. Agent has sufficient info to invoke correctly.

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 description coverage is 0%, so description fully compensates. It explains each parameter in detail: width/height as validated CSS lengths, bleed opt-in with viewBox growth and color, adjust_viewbox default false, mutual exclusivity, and example 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?

Description explicitly states 'Set the document canvas width/height to validated CSS lengths' and distinguishes from sibling tools like fit_to_content, normalize_viewbox, and scale_object.

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?

Provides clear 'When to use' directive for changing PAGE size and explicitly lists when not to use with alternative tools. Also includes caution to render preview before trusting and notes reversibility.

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