Skip to main content
Glama

select_frame

List all frames and iframes on a page, or select one by index to target subsequent commands like clicking elements or evaluating scripts.

Instructions

Lists or selects frames, including iframes, within the current page. Use it when the target element, page-defined global, script, or execution context may live in an iframe: first list frames, then pass frameIdx before click_element or evaluate_script. Omitting frameIdx lists 20 frames per page without changing context; passing frameIdx changes the shared frame target, with 0 restoring the main frame. It does not switch browser tabs or navigate—use select_page or navigate_page for those actions—and listPageIdx only paginates this listing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameIdxNoFrame index from the latest frame listing. Pass it to target later frame-aware tools; 0 restores the main frame. Omit it to list frames without changing context, and re-list after navigation or frame attachment/detachment because indices can shift.
pageSizeNoMaximum frames to list per response. Defaults to 20.
listPageIdxNoZero-based pagination index for the frame listing only. This is not the frameIdx used to select a frame. Defaults to 0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool completed successfully.
dataNo
toolYesStable MCP tool name.
errorNo
summaryYesConcise human-readable outcome.
Behavior5/5

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

Discloses behavioral traits beyond annotations: omitting frameIdx lists without changing context; passing frameIdx changes target; indices shift after navigation or frame changes. No contradiction with readOnlyHint=false (mutates state) and destructiveHint=false.

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?

Single dense paragraph front-loads purpose, then usage, then behavior, then exclusions. Each sentence adds value; no fluff.

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

Completeness5/5

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

Given the complexity (3 params, output schema), the description covers purpose, workflow, side effects, and exclusions. It references sibling tools for related actions.

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%, so baseline is 3. The description adds workflow context but does not significantly expand parameter meaning beyond what the schema provides.

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 clearly states 'Lists or selects frames, including iframes, within the current page.' It specifies the verb (lists or selects) and resource (frames within current page), and distinguishes from siblings like select_page and navigate_page.

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?

Explicitly tells when to use: 'when the target element... may live in an iframe' and provides a workflow: first list frames, then pass frameIdx before click_element or evaluate_script. Also tells when not to use: 'It does not switch browser tabs or navigate—use select_page or navigate_page for those actions.'

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

Install Server

Other Tools

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/zhizhuodemao/js-reverse-mcp'

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