Skip to main content
Glama

perch_eval

Evaluate a JavaScript expression in a Perchance generator's preview or editor frame and return its value.

Instructions

Run a JS expression and return its value. Default frame is the running generator ('preview'); use frame:'editor' for the editor page.

Input Schema

NameRequiredDescriptionDefault
jsYesJS expression to evaluate
frameNoDefault preview

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden. It states the return ('its value') and the frame default, but says nothing about executing arbitrary code in the page context, any side effects, permissions, or failure behavior. For a code-evaluation tool this is a significant gap.

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?

Two tight sentences with no filler. The core action is front-loaded and the frame guidance follows immediately, so an agent can act on the first clause alone.

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?

There is no output schema, and the description does cover the return shape ('its value') reasonably. Still, with no annotations and no disclosure of execution context, side effects, or error behavior, it is adequate but leaves notable gaps for a code-execution tool.

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 documented there, but the description adds real meaning the schema lacks: it clarifies what 'preview' actually refers to (the running generator) and when to pick 'editor'. That is value beyond the bare enum labels.

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 a JS expression and return its value.' This clearly distinguishes eval from read-oriented siblings like perch_read or perch_console, though it never names an alternative explicitly. The core purpose is unmistakable.

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 explains the frame default ('preview') and when to override it ('editor'), which is genuine usage guidance. However, it gives no context on when to reach for perch_eval versus adjacent tools like perch_console, perch_read, or perch_grep, so selection guidance is only partial.

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