Skip to main content
Glama

script

Run sandboxed Rhai code on a binary snapshot to query resources and preview or apply proposed names when no built-in tool answers.

Instructions

Run a sandboxed Rhai script on a snapshot of the program: query(uri) and rows(uri) read any resource. Use it when no single tool answers. Proposed names apply only with dry_run=false; a failed script applies nothing.

Input Schema

NameRequiredDescriptionDefault
codeYesRhai source.
dry_runNoPreview only (default true); false applies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and destructiveHint=false but say nothing about atomicity; the description adds the important guarantee 'a failed script applies nothing' and that name changes require dry_run=false (default true). It still doesn't say whether query/rows can mutate, or what the script returns.

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?

Three short sentences, front-loaded with the action and the API surface, then the selection rule, then the safety semantics. No filler; every clause carries information the agent needs before writing a script.

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

Completeness4/5

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

For a two-parameter, potentially mutating escape hatch with no output schema, the description covers purpose, selection, and mutation semantics. It leaves a gap around what the script returns and what URI forms are valid, which matters for a tool whose whole job is arbitrary composition.

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%, so baseline is 3, but the description adds meaning the schema cannot: it tells the agent what to actually write inside 'code' (query(uri) and rows(uri)) and reiterates the dry_run gating in context. The dry_run explanation partly duplicates the schema text, keeping it from a 5.

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 ('Run a sandboxed Rhai script on a snapshot of the program') and goes further by naming the in-script API surface (query(uri), rows(uri)). This is clearly distinguishable from every sibling, which are all fixed-purpose analysis tools, not a general scripting escape hatch.

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?

'Use it when no single tool answers' sets an explicit selection condition that implicitly excludes cases where a dedicated sibling (query, read, xrefs, etc.) already covers the need. It's a strong fallback rule, though it stops short of naming which siblings to prefer for which tasks.

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