Skip to main content
Glama
Antigravity in Chrome MCP Server

Antigravity in Chrome MCP Server

by sxqib

javascript_tool

Execute JavaScript in the page MAIN world to inspect page state, measure DOM elements, or debug browser behavior, supporting async/await and returning JSON-serializable results.

Instructions

Execute JavaScript code in the page MAIN world context (supports async/await and returns JSON-serializable results). Use for inspecting page state, DOM measurements, or debugging.

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": {
      "action": "<action>",
      "text": "<text>"
    },
    "name": "javascript_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesJavaScript expression or async function body to execute.
tabIdNoTarget tab ID (defaults to active managed tab).
actionYesMust be "javascript_exec".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does add real behavioral detail: MAIN world context, async/await support, and JSON-serializable return values. It omits important traits for an arbitrary-code-execution tool — whether it can mutate page state, error/timeout behavior, and whether results are truncated or coerced for non-serializable values.

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?

Two tight sentences, front-loaded with the execution model and followed by use cases; every phrase carries information and nothing is padded.

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?

For a three-parameter tool with full schema coverage and no output schema, the description covers execution context and return serialization but leaves out failure modes and side-effect risk. An agent could call it correctly but without understanding the consequences of arbitrary code execution.

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 'text' as an expression or async function body, 'tabId' as defaulting to the active managed tab, and the required enum value for 'action'. The description adds no parameter-level meaning beyond that, making the 3 baseline appropriate.

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?

The description states a specific verb and resource ('Execute JavaScript code') and pins down the execution context ('page MAIN world'), which is a meaningful distinction from higher-level read tools in the sibling list. It does not name any sibling to contrast against, so the differentiation is implicit rather than explicit.

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?

It gives concrete usage contexts: inspecting page state, DOM measurements, and debugging. That is clear when-to-use guidance, but there are no exclusions or pointers to alternatives such as read_page or get_page_text, which overlap with simple state inspection.

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