Skip to main content
Glama

firefox_eval

Runs a JavaScript expression in a Firefox page and returns the JSON result as a fallback when other browser-control tools are insufficient.

Instructions

Run a JavaScript expression in the page and return the JSON result. Fallback when other tools are not enough.

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": {
      "js": "<js>"
    },
    "name": "firefox_eval"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsYesExpression or IIFE, e.g. "document.title" or "(() => [...document.links].length)()"
tabIdNoTab id from firefox_tabs. Default: the tab last used, else the visible one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations supply readOnlyHint=false and openWorldHint=true, so the safety profile is partly covered, and the description adds the return format ('JSON result'). However, for an arbitrary-code-execution tool it says nothing about side effects on page state, whether the promise result is awaited, or what happens on thrown errors — the exact behaviors an agent most needs here.

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?

Two short front-loaded sentences with no redundant restatement of the title. The second sentence is slightly vague phrasing, but it earns its place by establishing tool ordering.

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?

There is no output schema, and for a mutable, open-world eval tool the description does not describe error/exception behavior, whether async expressions are awaited, or serialization constraints on the JSON result. Annotations and a fully documented schema carry part of the load, but meaningful operational gaps remain.

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% and the schema already explains both 'js' (expression or IIFE, with examples) and 'tabId' (tab id from firefox_tabs, with default). The description adds no parameter meaning beyond that, so the baseline 3 applies.

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?

States a concrete verb and resource: run a JavaScript expression in the page and return the JSON result. That is clearly distinguishable from the click/type/read siblings, though the differentiating clause ('fallback when other tools are not enough') is a positioning statement rather than a description of what makes eval distinct.

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?

The phrase 'fallback when other tools are not enough' explicitly establishes this as a last-resort tool, which is real when-to-use guidance rather than none. It stops short of naming concrete conditions or which sibling to prefer for a given task, so the agent must infer the boundary.

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