Skip to main content
Glama

switch_to_frame

Switch the active browser context to an iframe by index, name/id, or CSS/XPath selector so subsequent actions target its elements.

Instructions

Switch focus into an iframe. Provide index (integer), name/id (string), or a CSS/XPath selector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNocss
nameNoFrame name or id attribute
indexNoFrame index
timeoutNo
selectorNoCSS/XPath to locate the iframe element

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure, but it does not mention that the frame context persists after the call and that the agent must switch back to default content. It also omits what happens on failure or timeout, which is important for a state-changing navigation tool.

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 entire description is one focused sentence with no filler or repeated schema content. The primary action is front-loaded and the parameter guidance is compact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Frame switching is behaviorally tricky: after switching, subsequent commands target the iframe, and the agent must later return. The description does not mention this, nor does it guide the agent to switch_to_default_content. Given zero annotations and no output schema, this is a meaningful completeness gap.

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?

The description adds meaningful grouping to the schema by stating that an index, name/id, or CSS/XPath selector can be provided. This compensates for the lack of required fields and clarifies how the loosely-coupled parameters relate to each other, though it does not explain the 'by' or 'timeout' parameters in detail.

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 uses a specific verb ('Switch') and a clear resource ('iframe'), making it obvious this tool changes the active browsing context to a frame. It also enumerates the three acceptable locating strategies, which distinguishes it from window-related siblings like switch_to_window.

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 description clearly implies when to use it: whenever an agent needs to interact with content inside an iframe. It does not explicitly name alternatives or exclusion conditions, but the iframe focus is specific enough to route an agent correctly among the many sibling tools.

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

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/hakanngul/testfly-mcp'

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