Skip to main content
Glama
FigeloMCP
by mmonzera

execute_figma_js

Run custom async JavaScript inside the Figma plugin sandbox with figma and params in scope, returning structured error details and created node IDs for safe retries.

Instructions

Execute custom async JavaScript inside the Figma Plugin sandbox with figma and params in scope. On error, returns structured { ok: false, error, safeToRetryWithoutCanvasRead, createdNodeIds } metadata.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "execute_figma_js"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesAsync function body receiving (figma, params). Return a JSON-serializable value.
paramsNoOptional parameters passed to the script
channelNoOptional Figma document channel, fileKey, or documentName when multiple Figma files are open

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose real behavior: the code runs async in the plugin sandbox with `figma` and `params` injected, and errors return structured metadata including `safeToRetryWithoutCanvasRead` and `createdNodeIds`. However it never states whether the script mutates the live document, whether changes are committed or reversible, or what a successful call returns — significant gaps for a tool that can evidently create nodes.

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?

Two sentences, front-loaded with the capability and its execution context, followed by the error contract. Every clause carries information — the injected scope variables and the structured error field names all earn their place, with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a powerful arbitrary-code executor with no annotations and no output schema, the description covers the sandbox contract and the error shape but leaves the success path, mutation/commit semantics, and the default channel behavior unaddressed. It is adequate but not sufficient for an agent to call this safely without inspecting the schema or experimenting.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all three parameters including that `code` is an async function body receiving (figma, params). The description reinforces the injection contract but adds no syntax guidance, no example, and says nothing about `channel` or what happens when multiple documents are open. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: execute custom async JavaScript inside the Figma Plugin sandbox, with `figma` and `params` in scope. That is clearly distinct from the sibling catalog of named, purpose-built operations (create_frame, get_node, etc.). It stops short of explicitly framing itself as the escape hatch when no dedicated tool fits, which is the one thing that would sharpen differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance at all. Nothing tells the agent to prefer a dedicated sibling tool over raw scripting, or under what conditions this general-purpose executor is the right choice. Usage is only implied by the tool's nature as a sandbox script runner.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.