draw_polygon
The Polygon tool, and the Contour tool (freehand outline: pass the traced points with filled=true): draw a polygon through points ([[x, y], ...], at least 2). Closed by default; filled fills it; closed=false draws an open polyline.
This record as markdown: /tools/pixmith-mcp/draw-polygon.md
What draw_polygon does on Pixmith
AI agents call draw_polygon as a supporting operation in Pixmith workflows.
| Parameter | Type | Required | Description |
|---|---|---|---|
doc | string | — | Document id (see doc_list); optional when only one document is open. |
ink | string | — | simple (default; replaces pixels, transparent erases), alpha (blend over), lock_alpha (recolor only opaque pixels), behind (paint under existing pixels), shadin |
color | string | Yes | Color as "#RRGGBB" or "#RRGGBBAA" (also "#RGB", "#RGBA", "rgb(r,g,b)", "rgba(r,g,b,a)" with a in 0-1 or 0-255, a CSS basic name like "red", or "transparent"). A |
frame | integer | — | Frame (default: the active frame). |
layer | object | — | Layer index or name (default: the active layer). Must not be a group. |
closed | boolean | — | Join the last point back to the first (default true). |
filled | boolean | — | Fill the interior (closed polygons only). |
mirror | string | — | Symmetry: also draw mirrored (horizontal = left/right, vertical = top/bottom) across the canvas center, or across `mirror_axis_x` / `mirror_axis_y`. |
points | array | Yes | Vertices [[x, y], ...], at least 2, at most 4096. |
brush_size | integer | — | Brush size in pixels, 1-64 (default 1). |
brush_shape | string | — | square (default) or circle (round brush for sizes above 1). |
shading_ramp | array | — | Colors the shading ink steps through (default: the palette). |
Parameters from the server's own tool schema.
Why draw_polygon is rated Low
Without any rule in front of it, every call an agent makes to draw_polygon happens silently: no trail, no cap, no way to know it misbehaved until something breaks downstream.
Risk signalsHigh parameter count (15 properties)
Attacks that exploit this kind of access
The rule that runs draw_polygon safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Pixmith, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For draw_polygon, this is the rule to start with:
draw_polygon gets a rate cap, and everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Pixmith, apply this rule, and every draw_polygon call is checked against it from then on.
Questions about draw_polygon
The Polygon tool, and the Contour tool (freehand outline: pass the traced points with filled=true): draw a polygon through points ([[x, y], ...], at least 2). Closed by default; filled fills it; closed=false draws an open polyline. It is categorised as a Other tool in the Pixmith MCP Server, which means it performs auxiliary operations.
draw_polygon accepts 12 parameters: doc, ink, color, frame, layer, closed, filled, mirror, points, brush_size, brush_shape, shading_ramp. Required: color, points. The full parameter table on this page comes from the server's own tool schema.
Register the Pixmith MCP server in PolicyLayer and add a rule for draw_polygon: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Pixmith. Nothing to install.
draw_polygon is a Other tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the draw_polygon rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for draw_polygon. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
draw_polygon is provided by the Pixmith MCP server (pixmith-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Pixmith, and thousands of servers like it.
This server
Across the catalogue