Skip to main content
Glama
freema

Firefox DevTools MCP

by freema

evaluate_script

Runs a JavaScript function in the page and returns the result, enabling targeted reads like text, computed styles, or element existence without a full snapshot.

Instructions

Run a JS function in the page and return its result. Prefer this for targeted reads (a value, text, computed style, whether an element exists) instead of a full take_snapshot. Use the UID interaction tools for clicking, typing, and filling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoUIDs to pass as function arguments
saveToNoSave the result to a file as JSON instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-devtools-mcp/output/). Relative paths resolve against the current working directory.
previewNoNumber of characters of the saved result to return inline as a preview when saveTo is used. Omit for no preview.
timeoutNoTimeout in ms (default: 5000)
functionYesJS function string, e.g. () => document.title
Behavior4/5

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

The description indicates running JS code, which implies potential mutations, and annotations already set readOnlyHint: false. However, the description does not elaborate on execution context, security implications, or side effects beyond what is obvious. It adds marginal value over the annotation.

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 extremely concise, consisting of two short sentences that convey all essential information without extra words. It is front-loaded with the core purpose.

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 (5 parameters, no output schema), the description covers the primary use case and alternatives well. However, it omits details about the return result format and error handling, which would be helpful for an agent. The schema provides param details, but completeness is slightly hindered by lacking return value description.

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 baseline is 3. The description does not add additional meaning beyond the schema; parameter details are adequately covered in the schema itself. No extra context is provided for the 'function' string or 'args' usage.

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 clearly states what the tool does: 'Run a JS function in the page and return its result.' It uses a specific verb and resource, and distinguishes itself from siblings by directing targeted reads away from take_snapshot and recommending UID tools for interactions.

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 explicitly provides when to use ('Prefer this for targeted reads') and when not to ('Use the UID interaction tools for clicking, typing, and filling'), including a clear alternative (take_snapshot), making the usage context very clear.

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

Install Server

Other Tools

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/freema/firefox-devtools-mcp'

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