Skip to main content
Glama

iframe 操作

browser_frame
Destructive

Access and interact inside cross-origin iframes that page snapshots cannot see. List frames, read text, extract elements with CSS selectors, evaluate JavaScript, or click, type and select within a specific frame.

Instructions

Operate inside any frame, including cross-origin iframes that browser_snapshot cannot see into (payment widgets, OAuth, embedded editors, third-party chat). action=list shows every frame with its id, URL and whether it is cross-origin. action=text reads that frame text, action=elements lists interactive elements with usable CSS selectors, action=evaluate runs an expression inside the frame, and action=click/type/select act on a CSS selector inside the frame. Always start with action=list.

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>"
    },
    "name": "browser_frame"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNo(type) text to enter
indexNo(click) which match to click, 0-based (default 0)
labelNo(select) option visible label
limitNo(elements) max elements to list (default 80)
tabIdNoTab id (default: active tab)
valueNo(select) option value
actionYesFrame operation
frameIdNoFrame id from action=list, e.g. "f3"
maxCharsNo(text) max characters to return (default 4000)
selectorNo(click/type/select) CSS selector inside that frame
expressionNo(evaluate) JavaScript expression evaluated inside the frame

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and non-idempotent, and the description does not contradict that; instead it explains the action taxonomy that causes those traits (click/type/select mutate, evaluate runs arbitrary JS inside the frame). It also discloses the discovery dependency (frameId comes from action=list) which is real behavioral context beyond annotations. What it doesn't add is any warning about the consequences of acting inside payment/OAuth widgets, despite naming them.

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?

Scope and the sibling exclusion are front-loaded in the first clause, then the action list is enumerated compactly with per-action parentheticals. Every sentence carries information; nothing is repeated from the title or schema verbatim.

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 an 11-parameter, destructive, no-output-schema tool, the description covers the action set, the discovery-first workflow, and even partial return content (frame id, URL, cross-origin flag). It omits how failures surface (frame not found, cross-origin evaluate blocked) and gives no caution about side effects on third-party widgets, which is the main residual gap.

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 coverage is 100% and every parameter already carries a description keyed to an action, so the schema does the heavy lifting. The description adds a useful mapping (frameId from action=list, selector applies inside that frame, elements yields "usable CSS selectors" for chaining into click/type/select) but no format or constraint detail beyond that. Baseline 3 is appropriate.

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 and resource ("Operate inside any frame") and immediately scopes it to cross-origin iframes that browser_snapshot cannot see into, naming concrete cases like payment widgets and OAuth. An agent can distinguish this from the main-frame tools without opening the schema.

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?

Explicitly names the alternative (browser_snapshot) and the condition that selects this tool (cross-origin frames it can't see into), plus a mandatory workflow rule: "Always start with action=list." The remaining gap is that it never states when to prefer the sibling browser_evaluate/browser_click for non-frame work, so the routing is one-directional.

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