Skip to main content
Glama

execute

Run JavaScript code or a .js file in a fresh JsMacros context for Minecraft automation, returning a task ID and buffered output to monitor or stop long-running scripts.

Instructions

Run JS code OR a .js file in a fresh JsMacros context. Relative file paths resolve from the MCP working directory. Native JsMacros and installed mod Java APIs are available. console.log/print are captured. Waits up to wait_ms for the script body to finish, then returns a task ID and buffered output; retain the ID for read_output or stop when running or active. args is available as mcp.args. keep_alive retains the context after the script body returns; defaults to false. Reaching the wait deadline leaves the script running.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
codeNo
fileNo
wait_msNo
keep_aliveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / keep_alive
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv0.4.0
    • addedInput schema / properties / args
      Added value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
    • removedInput schema / properties / code / maxLength
      Removed value: -900000
    • changedInput schema / properties / wait_ms / maximum
      Previous value: -10000New value: +30000
  3. First observedv0.2.1

TDQS

A4.7/5.0
Behavior5/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 does so: it discloses context isolation (fresh context), path resolution (relative to the MCP working directory), the capability surface (native JsMacros and mod Java APIs), output capture (console.log/print), blocking semantics (waits up to wait_ms), and post-deadline behavior (script keeps running). The keep_alive/context-retention semantics and its false default are stated explicitly, which is exactly the non-obvious behavior an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence carries distinct information and the purpose is front-loaded in the first clause. The density is high and the wait/keep_alive semantics are packed into a long run-on sentence, so a small amount of structural separation would improve scanability, but there is no filler.

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

Completeness5/5

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

For a five-parameter execution tool with no annotations and no output schema, the description covers everything an agent needs: how to supply code, how the call blocks and returns (task ID plus buffered output), and how to follow up via read_output or stop. Return values are explained in lieu of an output schema, and the deadline/keep_alive interaction is resolved.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate for all five parameters and it does: code and file are defined by the opening sentence, file paths are qualified as working-directory-relative, wait_ms is given a role in the blocking behavior, keep_alive is explained with its default, and args is mapped to the in-script binding mcp.args. That is meaning beyond the bare JSON types.

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?

The opening sentence names a specific verb (run) and two concrete resources (inline JS code or a .js file) plus the execution environment (a fresh JsMacros context). An agent immediately knows this is the code-execution entry point, distinct from siblings like read_output and stop which are explicitly named later.

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?

It routes the agent clearly: retain the returned task ID for read_output or stop 'when running or active', which tells the agent exactly when to reach for those siblings. It stops short of stating when to prefer inline code over a file, or when not to use this tool at all, so it is strong but not exhaustive.

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

Deploy Server

Other Tools