Skip to main content
Glama

write_webroot_js

Writes JavaScript files into the WebRoot folder for built Banter scenes, enabling browser runtime logic using the BS.* API.

Instructions

Write JavaScript code to the WebRoot folder for built Banter scenes. This JS runs at runtime in the browser context.

Use BS.* API for all Banter functionality.

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>",
      "filename": "<filename>"
    },
    "name": "write_webroot_js"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesJavaScript code to write
filenameYesFilename (e.g., 'main.js', 'game-logic.js')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.7

TDQS

B3.4/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. It does disclose the write target (WebRoot folder), that the code executes at runtime in the browser, and that the BS.* API must be used. It omits key behaviors for a write tool: whether existing files are overwritten, whether the scene must be built first, and any path or permission constraints.

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?

Three short lines, front-loaded with the action and destination, then the execution context, then the API constraint. No filler sentences, though the third line could be folded into the first without loss.

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 simple two-parameter write tool with full schema coverage and no output schema, the description covers purpose, target, and runtime context. It falls short on mutation semantics (overwrite behavior, prerequisites like a built scene) that an agent would want before writing files.

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 coverage is 100%, with both `code` and `filename` documented in the schema, so the baseline is 3. The description adds one meaningful constraint beyond the schema — that the code must use the BS.* API — which shapes what belongs in `code`, but says nothing extra about filename conventions or path resolution.

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 destination: write JavaScript code to the WebRoot folder, scoped to built Banter scenes. It also clarifies the execution context (runtime, browser), so an agent knows this produces browser-side runtime code rather than editor code. It does not explicitly distinguish itself from siblings like write_vs_graph, but the resource is specific enough to be unambiguous.

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 phrase 'for built Banter scenes' implies the precondition (a built scene must exist) and the runtime/browser context hints at when this applies. However, there is no explicit when-to-use vs when-not guidance and no named alternative for editor-side or non-Banter scripting, so the agent must infer usage boundaries.

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