Skip to main content
Glama

Run MCBE Script

mcbe_run_script

Execute JavaScript inside a Minecraft Bedrock region to place or fill blocks with loops, variables, and conditionals. Use relative coordinates and block states to automate builds.

Instructions

Execute a JS script inside a region. Coordinates are relative (0,0,0 = region min corner). Provides setBlock(rx,ry,rz,blockId,states?) and fillBlock(rx1,ry1,rz1,rx2,ry2,rz2,blockId,states?). Supports loops, conditionals, variables. Common MCBE block states: facing_direction(0-5=down/up/north/south/west/east), weirdo_direction(0-3), upside_down_bit(true/false), open_bit(true/false), pillar_axis(x/y/z), direction(0-3). Example: setBlock(0,0,0,'minecraft:oak_stairs',{weirdo_direction:0,upside_down_bit:true})

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": {
      "name": "<name>",
      "script": "<script>"
    },
    "name": "mcbe_run_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesTarget region name
scriptYesJavaScript code using setBlock() and fillBlock() globals
timeoutNoTimeout in seconds

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden and does disclose a meaningful amount: the script runs in region-relative coordinates, exposes exactly two globals, and documents valid block-state keys and ranges. It does not say what happens to blocks at those coordinates (overwrite semantics), whether a failing script leaves partial edits, whether the call blocks until completion, or what the response contains — important gaps for a mutation tool.

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?

Front-loaded with the action and the coordinate rule, then the API surface, then a concrete example. The block-state enumeration is long but earns its place because the schema exposes no enums for those values, and the worked example removes ambiguity about argument order.

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 destructive, un-annotated script executor with no output schema, the definition covers the input side well but stops short of the outcome side: no statement of return value, error behavior, partial-failure semantics, or the effect of the 30-second timeout. An agent knows how to call it but not entirely what to expect back.

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 100%, so the schema already documents name, script, and timeout. The description nonetheless adds real meaning for the script parameter by enumerating the available globals and their signatures plus the valid MCBE block-state names and value ranges, which is exactly the information an agent needs to write a correct script body.

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?

The description states a specific verb and resource: executing a JavaScript script with the setBlock/fillBlock API inside a named region, including the coordinate convention (0,0,0 = region min corner). It is clearly distinct from a plain command executor, but it never names mcbe_run_command or explains how the scripting path differs from it, so the sibling distinction is only implied.

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

Usage Guidelines3/5

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

Usage is implied by the disclosed API (loops, conditionals, block state maps) — an agent can infer that this is the tool for multi-block procedural edits rather than single commands. There is no explicit when-to-use/when-not statement, no mention of prerequisites such as the region existing or being loaded, and no guidance on when to prefer mcbe_run_command.

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