Skip to main content
Glama

Switch frame

browser_frame_switch

Scope semantic locators to a specific frame by index, name, or URL substring, or return to the main frame. Refs keep working across frames without extra switching.

Instructions

Scope semantic locators to a frame (by index, name or URL substring), or back to main=true. Refs work across frames without switching.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_frame_switch"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
mainNo
nameNo
indexNo
pageIdNo
sessionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds one genuinely useful behavioral fact (refs are frame-agnostic) but omits whether the switch persists across subsequent calls, how selector conflicts resolve, and what happens on a failed match.

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 dense sentences, front-loaded with the action and followed by the key caveat. No filler or restatement of the title.

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 six-parameter, zero-coverage, no-output-schema tool, the description covers the core semantics but leaves two parameters and the failure/conflict behavior undocumented. An agent could call it for the common case but would be guessing on edge cases.

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?

With 0% schema description coverage the description must carry the load, and it does explain four of six parameters, including that url is a substring match and main is a boolean reset. pageId and session are left entirely undefined, and the mutual exclusivity of the selector parameters is unstated.

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 specific verb and resource: scope semantic locators to a frame, with the three selector modes (index, name, URL substring) and the reset path (main=true). An agent can tell this apart from browser_frames (listing) or browser_tab_switch, though no sibling is named explicitly.

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?

Gives a clear condition for use and an implicit condition to skip it: 'Refs work across frames without switching' tells the agent it may not need this tool at all. It does not state precedence when multiple selectors are supplied, nor what to do if the frame is not found.

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