Skip to main content
Glama

frame

Switch into an iframe to access and interact with its embedded elements, then return to the main page to continue automation.

Instructions

Move into or out of an iframe. Elements inside an iframe (embedded widgets, rich-text editors, payment fields) cannot be found by other tools until you switch into it. switch = enter a frame by selector, index, or nameOrId; parent = go up one level; default = return to the main page. The switch lasts until you change it again or a new page loads, so switch back with default when you are done inside the frame.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoFor switch: zero-based position of the frame on the page. Used when no selector is given.
actionYesswitch = enter a frame (needs selector, index, or nameOrId); parent = up one level; default = back to the main page.
nameOrIdNoFor switch: the frame's name or id attribute. Used when neither selector nor index is given.
selectorNoFor switch: the <iframe> element, e.g. { by: 'css', value: 'iframe#editor' }. Most reliable way to pick a frame.
timeoutMsNoHow long to wait for the frame element when switching by selector, in milliseconds (default 10000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.3.0
    • addedInput schema / properties / action / description
      Added value: +"switch = enter a frame (needs selector, index, or nameOrId); parent = up one level; default = back to the main page."
    • addedInput schema / properties / index / description
      Added value: +"For switch: zero-based position of the frame on the page. Used when no selector is given."
    • addedInput schema / properties / nameOrId / description
      Added value: +"For switch: the frame's name or id attribute. Used when neither selector nor index is given."
    • addedInput schema / properties / selector / description
      Added value: +"For switch: the <iframe> element, e.g. { by: 'css', value: 'iframe#editor' }. Most reliable way to pick a frame."
    • addedInput schema / properties / selector / properties / by / description
      Added value: +"Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText."
    • addedInput schema / properties / selector / properties / value / description
      Added value: +"The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath."
    • addedInput schema / properties / timeoutMs / description
      Added value: +"How long to wait for the frame element when switching by selector, in milliseconds (default 10000)."
  2. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/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 disclose the key non-obvious trait: the switch is stateful and persists until changed or a new page load. That is exactly the kind of side effect an agent must know. It does not cover failure behavior (e.g., frame not found, timeout handling beyond the schema's timeoutMs) or return values, so it falls short of full transparency.

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?

Four sentences, front-loaded with the purpose and impact on other tools, then the action semantics, then the lifetime rule. No filler; every sentence contributes actionable information.

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?

For a stateful 5-parameter tool with a nested selector object, no annotations, and no output schema, the description covers purpose, per-action semantics, and the state lifetime plus how to revert. It omits error/timeout behavior and any indication of what a successful call returns, which keeps it just short of fully complete.

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 documents action, index, nameOrId, selector, and timeoutMs with the precedence rules ('used when no selector is given'). The description restates the action meanings and the selector/index/nameOrId alternatives but adds no format, precedence, or fallback detail beyond what the schema provides, so baseline 3 applies.

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?

States a specific verb+resource ('Move into or out of an iframe') and immediately scopes it against siblings by noting elements inside a frame cannot be found by other tools until you switch in. An agent can distinguish this from window, click, or find_element without opening any schema.

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?

Gives an explicit trigger (elements inside embedded widgets, rich-text editors, payment fields are invisible to other tools) and a clear cleanup rule ('switch back with default when you are done inside the frame'). Each action value is defined inline, so the when-to-use and how-to-exit guidance is complete.

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