doc_new
Create a new blank sprite (one transparent layer "Layer 1", one 100 ms frame) and return its document id. Optionally fill it with a background color, pick the color mode, or load a built-in palette. Coordinates everywhere are pixels, 0-based from the top-left; layers and frames are 0-based (layer...
This record as markdown: /tools/pixmith-mcp/doc-new.md
What doc_new does on Pixmith
AI agents invoke doc_new to trigger actions in Pixmith. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | — | Display name (default "Untitled N"). |
width | integer | Yes | Canvas width in pixels (1-16384). |
height | integer | Yes | Canvas height in pixels (1-16384). |
target | string | — | "app" (default; the sprite opens in a new tab of the Pixmith app, which is started when it is not running, so the user sees it) or "headless" (kept inside this |
background | string | — | Fill layer 1 with this color (default: transparent). |
color_mode | string | — | Color mode (default rgba). indexed snaps every color to the palette. |
palette_preset | string | — | Load a built-in palette by name (see palette action list_presets), e.g. "PICO-8". |
Parameters from the server's own tool schema.
Why doc_new is rated High
doc_new triggers real processes with real consequences. An agent gone sideways doesn't fire it once. It starts dozens of builds, sends mass notifications, or burns through compute before anyone looks up.
Attacks that exploit this kind of access
The rule that runs doc_new 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 doc_new, this is the rule to start with:
doc_new stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. 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 doc_new call is checked against it from then on.
Questions about doc_new
Create a new blank sprite (one transparent layer "Layer 1", one 100 ms frame) and return its document id. Optionally fill it with a background color, pick the color mode, or load a built-in palette. Coordinates everywhere are pixels, 0-based from the top-left; layers and frames are 0-based (layer 0 = bottom of the stack). It is categorised as a Execute tool in the Pixmith MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
doc_new accepts 7 parameters: name, width, height, target, background, color_mode, palette_preset. Required: width, height. 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 doc_new: 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.
doc_new is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the doc_new 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 doc_new. 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.
doc_new 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.
Across the catalogue