Skip to main content
Glama

Run a script over the shop tools

run_code
Destructive

Runs a JavaScript function body in a sandbox with no network, files or environment. Each tool is a function shop.<tool>(args) that returns the tool's parsed result; return sets the result of the run, and console output is returned as logs. A run may make up to 30 tool calls and lasts at most 30 seconds. Every call is checked and rate limited exactly like a direct call to that tool, so a run can create, update and cancel checkouts as well as read.

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

Input Schema

NameRequiredDescriptionDefault
codeYesThe body of an async function, e.g. `const r = await shop.find_stores({ query: "shoes" }); return r.stores.length;`.
timeout_msNoOptional time limit in milliseconds (default 15000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: no network, files or environment access; a 30-call cap; a 30-second wall clock; and rate limiting identical to direct calls. It also confirms the run can create, update and cancel checkouts, which is consistent with destructiveHint=true. The remaining gap is that the description does not say whether the code parameter is retried or what happens on partial failure mid-run.

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?

Four tightly packed sentences, front-loaded with the sandbox model before the limits and safety notes. Every sentence carries information an agent needs; nothing is redundant with the annotations.

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 meta-tool with no output schema, the description covers execution environment, calling convention, result semantics, log return, and hard limits. An agent has everything needed to write a correct call without further disclosure.

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% and both parameters are already well documented, so the baseline is 3. The description still adds genuine meaning by explaining that `code` is an async function body whose return value becomes the run result and whose console output is surfaced as logs — semantics the schema only hints at via its example.

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?

States a specific verb and resource ('runs a JavaScript function body in a sandbox') and immediately defines the execution model — tools exposed as `shop.<tool>(args)`, `return` sets the result, console output becomes logs. This is unmistakably distinct from every direct-call sibling listed.

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 use case (orchestrating multiple tool calls and composing results in one run) but never states it explicitly, nor does it say when an agent should call this instead of invoking siblings directly. The 30-call and 30-second limits hint at batching but leave the choice to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.