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)

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.
scriptYesA function body that returns.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations, the description discloses concrete sandbox limits (no requests, clicks, submissions, cookie or storage access) and the Cotlet-specific quirk that filled field values read as '[hidden by Cotlet].' It does not explicitly warn that arbitrary JS can still mutate page state, which sits in tension with the destructiveHint=true annotation, but it does not contradict it either.

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?

Three compact sentences: purpose first, usage routing second, constraints and a concrete example last. Every clause carries information and nothing is redundant with the title.

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 the return contract (JSON of the return value) and supplies a worked example. Minor gaps remain around execution limits or what happens on script errors, but for a two-parameter evaluation tool the definition is sufficient to call it correctly.

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 already high, and the description adds meaning by showing the expected shape of the script ('return [...document.querySelectorAll(...)].map(...)') and clarifying that it is a function body that returns. The optional app parameter is left entirely to the schema, which is adequate given its own detailed description.

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 opens with a specific verb and resource: runs a JavaScript function body on the page and returns the result as JSON. It also distinguishes the tool from its siblings by saying 'act with the other tools,' so an agent knows this is the extraction path rather than the click/fill path.

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?

It states when to use this tool ('extract data the page holds — a table, a list, attributes') and when not to, routing actions to the other browser tools. The example of scraping h2 elements reinforces the intended usage pattern without ambiguity.

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.