Skip to main content
Glama

exec_run

Destructive

Run custom JavaScript against the full Figma Plugin API to handle tasks the standard tools cannot, such as targeted design edits or data extraction; requires the kit bridge plugin in the target file.

Instructions

Run JavaScript in the plugin with the full Figma Plugin API (figma), for what the other tools cannot do. The body of an async function: return a small JSON-serializable value, not nodes. Keep each call small (a few hundred nodes); build big designs in several calls. Needs the kit bridge plugin running in that file (read_bridge).

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": {
      "file": "<file>",
      "code": "<code>"
    },
    "name": "exec_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
fileYesFigma file URL or key

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds real context beyond them: the code is the body of an async function, must return a small JSON-serializable value rather than nodes, calls should stay to a few hundred nodes, and the bridge plugin must be running. It never mentions error behavior, timeouts, or that a bad call can damage the file despite the destructive hint, so not a 5.

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?

Three tight sentences, front-loaded with the capability, then the return contract, then the size and prerequisite constraints. No filler or restated title.

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

Completeness4/5

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

For a high-risk universal escape hatch with only two parameters and no output schema, the definition covers capability, return contract, sizing, and the bridge prerequisite. Gaps remain around failure handling and what state a run can mutate, which matters given destructiveHint=true.

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 only 50% – `file` is documented in the schema, `code` is only constrained by minLength. The description compensates for the undocumented parameter by explaining that `code` is an async function body that must return a small JSON-serializable value, not nodes, which is exactly the semantic an agent needs.

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?

Specific verb and resource: 'Run JavaScript in the plugin with the full Figma Plugin API (`figma`)'. The clause 'for what the other tools cannot do' positions it relative to the read_*/write_* siblings as an escape hatch, so an agent can tell when this is the right tool without opening any schema.

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

Usage Guidelines4/5

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

Gives a clear routing rule ('for what the other tools cannot do'), a sizing guideline ('keep each call small... build big designs in several calls'), and a prerequisite ('needs the kit bridge plugin running in that file (read_bridge)'). No explicit when-not or failure-mode exclusions, so it falls short of a 5.

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