Skip to main content
Glama

Web Eval

web_eval
Destructive

Runs arbitrary JavaScript in a web session and returns the last expression's value, which must be a plain JSON value (async code is not awaited: return JSON.stringify(...) or store the result and read it in a second call). Requires confirm=true; without it you get a preview of the code and nothing runs. Disabled when LMCP is in read-only mode. POWER-USER tool — a page could feed malicious code, so prefer web_find / web_read / web_extract for normal use.

Input Schema

NameRequiredDescriptionDefault
jsYesJavaScript to evaluate on the page; the last expression's value is returned.
confirmNoMust be true to run the code. Without it, returns a preview and runs nothing.
sessionNoSession name (default 'default').
rememberNoWith confirm: true, also stop asking for this kind of action from now on. Only when the person said so ("don't ask again"). The person can revoke it in LMCP or with set_always_allowed.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / remember
      Added value: +{
      +  "description": "With confirm: true, also stop asking for this kind of action from now on. Only when the person said so (\"don't ask again\"). The person can revoke it in LMCP or with set_always_allowed.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Must be true to run the code. Without it, returns a preview and runs nothing.",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. Added
  5. Removed
  6. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds non-obvious behavior the schema cannot express: async code is not awaited, results must be JSON-serializable, a second call may be needed to read stored results, the confirm gate produces a preview instead of an execution, and the tool is unavailable in read-only mode. It also explains why it is dangerous (a page could feed malicious code), which is genuine risk context rather than annotation restatement.

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?

Front-loaded with the core action and return contract, then prerequisites, then safety routing. Dense but every clause carries information; the nested parenthetical about async handling is the only spot that costs readability.

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 destructive, open-world code-execution tool, the description covers the execution model, return-value constraints, confirmation gating, mode restrictions, and safer alternatives. An output schema exists, so not unpacking the response shape further is appropriate.

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 the baseline is 3, but the description adds real meaning for `js` beyond the schema: the async-not-awaited constraint and the JSON.stringify workaround change how an agent writes the code. Confirm's preview behavior is largely duplicative of the schema text, keeping this below 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 ('Runs arbitrary JavaScript in a web session') plus the return contract (last expression's value, must be a plain JSON value). It explicitly positions itself against web_find / web_read / web_extract, so an agent can distinguish it from the read-oriented web siblings without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use (power-user needs), when-not-to-use ('prefer web_find / web_read / web_extract for normal use'), a hard prerequisite (confirm=true or you only get a preview), and an environment exclusion (disabled in read-only mode). This is the full when/when-not/alternatives triad.

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.

Resources