Skip to main content
Glama

js_eval

Execute JavaScript in Deadlock's Panorama UI to inspect panels, test live changes, and return JSON-serialized results; keep contexts alive for event handlers and scheduled callbacks.

Instructions

Run JavaScript inside Deadlock's Panorama UI and return the result (JSON-serialised; panels are described as {panel: {...}}).

A single expression is returned automatically; multi-statement code must return a value. In scope: $ (Panorama API), $panel (target panel; default the bridge panel), $root (top-level panel), $find(id), $query(structuredSelector), $children(p), $describe(p). target: panel id ('#Foo' or 'Foo'), 'root', or 'bridge'. keep_context=True keeps the script's context alive so event handlers / $.Schedule callbacks it registers keep working (otherwise contexts are recycled after ~64 requests).

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

Input Schema

NameRequiredDescriptionDefault
uiNoauto
codeYes
targetNo
timeoutNo
keep_contextNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden, and it does disclose real behavior: JSON-serialized returns, panel wrapping, and context recycling after roughly 64 requests unless keep_context is set. However, it never mentions that this executes arbitrary code against the live game UI (side effects, mutations, risks), nor what happens on errors or when `timeout` is exceeded.

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 purpose and return format, then scope, then per-parameter notes. The in-scope list is dense but each entry is a distinct usable symbol, and the keep_context sentence carries two non-obvious facts (handler survival, ~64-request recycling) in one line.

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?

An output schema exists so return values needn't be re-explained, and the core usage model is covered. For an arbitrary-code-execution tool with zero annotation coverage and two undocumented parameters (`ui`, `timeout`), the omission of error/failure behavior and side-effect risk leaves it short of complete.

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 0% for five parameters, so the description must compensate — it documents `code`, `target` (with accepted value forms), and `keep_context` with the concrete consequence of each. The `ui` parameter (default 'auto') and the `timeout` units/semantics are left entirely to the bare schema.

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 — 'Run JavaScript inside Deadlock's Panorama UI and return the result' — plus the exact return shape (JSON-serialised, panels as {panel: {...}}). It does not name a contrasting sibling such as panel_find or panel_tree, so an agent must infer when direct JS is preferable to the structured panel tools.

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?

Explains how to use it: a single expression is auto-returned while multi-statement code must `return`, and valid `target` values are enumerated ('#Foo', 'Foo', 'root', 'bridge'). It also describes the keep_context use case for event handlers and $.Schedule callbacks. It stops short of saying when to prefer a sibling tool over writing JS.

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