Skip to main content
Glama

Run a script on the page

cotlet_browser_evaluate
Destructive

Runs a JavaScript function body on the page and answers what it returns, as JSON. Use it to extract data the page holds (a table, a list, attributes); act with the other tools. It cannot send requests, click, submit, or read cookies or storage; a filled field's value reads [hidden by Cotlet]. Example: return [...document.querySelectorAll('h2')].map(h => h.innerText)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "script": "<script>"
    },
    "name": "cotlet_browser_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoLeave it out: the step runs in the user's web browser. Only when cotlet_app_guide names an app's own Cloud Browser, that app's slug, e.g. milanote.
tabNoThe Tab id of the last answer. The step acts only while that tab is the shown one; if the user or another client showed another tab, it does nothing and answers tab_changed. Leave it out to act on the shown tab.
scriptYesA function body that returns.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / tab
      Added value: +{
      +  "description": "The Tab id of the last answer. The step acts only while that tab is the shown one; if the user or another client showed another tab, it does nothing and answers tab_changed. Leave it out to act on the shown tab.",
      +  "maxLength": 64,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The description adds real behavioral limits beyond annotations: no requests, no clicks/submits, no cookie or storage access, and filled-field values read as "[hidden by Cotlet]" — the last is critical for interpreting returned data. The one gap is that it does not explain why the tool is flagged destructiveHint=true (arbitrary JS can mutate page state), and the "cannot send requests/click" phrasing could lead an agent to underestimate the risk. Not a contradiction, but an unaddressed tension.

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?

Front-loaded with what it does and its return type, then constraints, then a single compact example. No padding sentences; every clause carries information an agent needs.

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?

With no output schema, the description correctly explains that the return value is JSON and demonstrates the shape. It leaves tab/app scoping to the schema descriptions, which fully cover them, so only the destructive/mutation risk profile is under-explained for a tool that executes arbitrary code.

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 app, tab, and script are already fully documented, making 3 the baseline. The description earns above baseline by clarifying that the script is a function body that must return and supplying a worked example, which disambiguates the expected input shape.

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?

"Runs a JavaScript function body on the page and answers what it returns, as JSON" gives a specific verb, resource, and return contract, and the phrase "act with the other tools" separates it from the click/type/navigate siblings. An agent can distinguish this from cotlet_browser_read or cotlet_browser_click without opening another schema.

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 to extract data the page holds (a table, a list, attributes)" states the positive case with concrete examples, and "act with the other tools" sets the boundary. It stops short of naming a specific sibling or stating when a simpler read tool would suffice, so it is clear context without explicit alternatives.

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