Skip to main content
Glama

Evaluate JavaScript expression

web_debug_evaluate
Destructive

Evaluate JavaScript expressions in the local page runtime to inspect or modify state. Side effects are blocked unless explicitly allowed, ensuring safe debugging.

Instructions

Evaluate an expression in the local page runtime. Side effects are rejected unless explicitly enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes
expressionYes
allowSideEffectsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNo
errorNo
warningsYes
artifactsYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed5 schema fields changedv0.7.0
    • addedOutput schema / properties / data / additionalProperties
      Added value: +false
    • removedOutput schema / properties / data / allOf
      Removed value: -[
      -  {
      -    "$ref": "#/definitions/__schema0"
      -  }
      -]
    • addedOutput schema / properties / data / properties
      Added value: +{
      +  "description": {
      +    "anyOf": [
      +      {
      +        "maxLength": 2000,
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ]
      +  },
      +  "type": {
      +    "anyOf": [
      +      {
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ]
      +  },
      +  "value": {
      +    "$ref": "#/definitions/__schema0"
      +  }
      +}
    • addedOutput schema / properties / data / required
      Added value: +[
      +  "value",
      +  "type",
      +  "description"
      +]
    • addedOutput schema / properties / data / type
      Added value: +"object"
  2. First observedv0.5.0-next.0

TDQS

A3.5/5.0
Behavior4/5

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

The description adds important behavioral context beyond the annotations: side effects are rejected by default and only allowed when explicitly enabled. This is valuable for a tool with destructiveHint=true and readOnlyHint=false, as it clarifies the default safety posture. It does not detail all consequences of enabling side effects, but the annotations already flag destructiveness.

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?

The description is concise and front-loaded: the first sentence states the core action and target, and the second sentence provides a critical safety constraint. There is no redundant or filler content.

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?

The description is adequate for understanding the basic operation and the default side-effect policy, and an output schema exists to document return values. However, it omits details such as session prerequisites, how to handle rejected side effects, and any limitations of evaluated expressions. Given the complexity and potential destructiveness of JavaScript evaluation, more context would improve completeness.

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?

The input schema has 0% description coverage, so the description must compensate. It adds meaning to the expression parameter by specifying that it runs in the local page runtime, and it explains the allowSideEffects behavior by stating side effects are rejected unless explicitly enabled. However, the sessionId parameter is not described at all, and the description does not clarify how an active session is used or required.

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?

The description clearly states that the tool evaluates an expression in the local page runtime, and the title adds that it is a JavaScript expression. This is a specific verb and resource, though it does not explicitly distinguish itself from sibling tools beyond the unique action of evaluating an expression.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as web_debug_control, web_next_inspect, or web_browser_action. The only usage-related hint is that side effects are rejected unless explicitly enabled, but there is no mention of appropriate scenarios or exclusions.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarlonJD/web-debug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server