Skip to main content
Glama

RunScript

Runs JavaScript in QuickJS with access to session MCP tools, enabling scripts to call tools via mcp.call and return results.

Instructions

Runs JavaScript in QuickJS with access to the session's MCP tools, including resource tools when available. In the program, mcp.call(name, args) calls a tool and resolves to its result; every tool of the session is callable but the session-bound ones (long and leftover sessions, batch mode, recorded reads, the debugger), the background-run tools and the script tools.

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": "RunScript"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptNoThe program's body, run as an async function: mcp.call(name, args) calls a tool of this session and resolves to the tool's result; the value the body gives back with return is the run's result.
script_uriNoThe URI of a resource of kind script. Supply either script or script_uri.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv26.5.0

TDQS

B3.3/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 burden, and it does disclose the execution environment (QuickJS), the async-function body model, and the exclusion list of uncallable tools. It omits execution limits (timeouts, resource caps), error/failure semantics, whether side effects of called tools persist, and concurrency behavior, which are significant for an arbitrary-code-execution tool.

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

Conciseness3/5

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

The purpose is front-loaded in one clear sentence. The second sentence is long and grammatically broken ('every tool ... is callable but the session-bound ones ..., the background-run tools and the script tools'), leaving the exclusion rule ambiguous and forcing re-reading.

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 an arbitrary-code-execution tool with no annotations and no output schema, the definition covers the capability surface and calling convention but not safety, limits, or what the run result contains. It is adequate to attempt a call, but an agent cannot predict timeout or error behavior.

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 description coverage is 100%, so both parameters are already documented, and the description adds only a restatement of the mcp.call convention. The script_uri parameter and the 'supply either' exclusivity are left entirely to the schema, so no value is added beyond it.

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: runs JavaScript in QuickJS with access to the session's MCP tools. That is far more specific than a bare name, and the second sentence clarifies the calling convention inside the script. It does not explicitly differentiate itself from siblings such as RunATC or RunProgramUnitTest, which keeps it from a 5.

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?

The description implies the tool's niche is scripting/chaining other MCP tools via mcp.call, and it enumerates categories of tools that cannot be called from inside a script. However, it never states when an agent should pick RunScript over a direct sibling call, nor any prerequisites or preconditions for use.

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