Skip to main content
Glama
yinnho

AginxBrowser

session_eval

Execute JavaScript in a live browser session and return the result, preserving DOM mutations, globals, and storage across calls for stateful page interaction.

Instructions

Execute arbitrary JavaScript in a live browser session and return the result. Runs in the session's current page, so DOM mutations, globals and storage persist across calls — unlike the stateless eval tool, which loads its own throwaway page each call. Script-driven navigation moves the session's URL. JS exceptions are reported with name, line/column and stack.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript code to execute
session_idYesSession ID
timeout_msNoAwait budget for the script's promise in ms (default 5000, clamped 100..120000). Pass a larger budget for slow page-side work such as uploads through the page's own fetch; on expiry the tool errors with EVAL_TIMEOUT (the script may still be running) instead of returning a null result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.1
    • addedInput schema / properties / timeout_ms
      Added value: +{
      +  "default": null,
      +  "description": "Await budget for the script's promise in ms (default 5000, clamped\n100..120000). Pass a larger budget for slow page-side work such as\nuploads through the page's own fetch; on expiry the tool errors with\nEVAL_TIMEOUT (the script may still be running) instead of returning\na null result.",
      +  "format": "uint64",
      +  "minimum": 0,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • removedInput schema / title
      Removed value: -"SessionEvalParams"
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

There are no relevant annotations beyond the title, so the description carries the full burden. It discloses persistence of DOM mutations, globals, and storage across calls, the navigation side effect, and exception reporting details. It does not explicitly warn that arbitrary JavaScript can be destructive to the session, but the persistence statement effectively conveys the risk.

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 four concise sentences, each adding distinct value: core action, persistence behavior, contrast with eval, and error reporting. There is no filler or redundancy, and the most important information is front-loaded.

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?

Given the tool's complexity, the description covers execution context, side effects, and error behavior, which is substantial for a 3-parameter tool with no output schema. It does not detail the exact return serialization format, but for an eval tool that returns a JavaScript result, this is a minor gap.

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 description coverage is 100%, so the schema already documents script, session_id, and timeout_ms including defaults and clamping behavior. The description adds execution-environment context but not new parameter-level semantics, so a baseline score of 3 is appropriate.

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?

The description states a specific verb and resource: it executes arbitrary JavaScript in a live browser session and returns the result. It also explicitly distinguishes itself from the sibling eval tool by contrasting persistent session state with a throwaway page, making the tool's purpose unambiguous.

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?

The description clearly tells the agent when to prefer this tool over the alternative eval: use session_eval when running in the current session page where mutations, globals, and storage persist, and use eval when a stateless isolated page is desired. It also notes that script-driven navigation changes the session URL, which is critical for choosing the tool.

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