Skip to main content
Glama

ruyi_select_frame

Select a target iframe/frame using its context ID or CSS selector. This enables subsequent scripts to run within the chosen frame by referencing its frameContextId.

Instructions

选择指定的 iframe/frame。contextId(从 ruyi_list_frames 获取)最稳定;也可传 selector,由 ruyiPage 1.2.54 通过 iframe.contentWindow 精确映射 srcdoc 或同 URL frame。选择后的 frame 可在后续 evaluate_script 中通过 frameContextId 参数操作。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdxNo标签页索引
selectorNoiframe/frame 元素选择器;与 contextId 二选一
contextIdNoframe 的 browsing context ID
Behavior3/5

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

Without annotations, the description carries the full burden. It adds useful context about the stability of contextId and the mapping mechanism via iframe.contentWindow for srcdoc or same-URL frames. However, it does not disclose potential side effects, failure modes, or whether the selection is persistent beyond the evaluate_script context.

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 description is two sentences, front-loaded with the primary purpose, and provides essential detail without waste. Every sentence earns its place.

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?

The description explains the primary flow and integration with evaluate_script, but with no output schema and no annotations, it omits information about return values, error cases, and whether the selection persists across multiple calls. For a relatively simple selection tool, the essentials are present but not fully complete.

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 schema already has 100% coverage, so baseline is 3. The description adds value by explaining that contextId is the most stable option and that selector uses iframe.contentWindow mapping, which enriches the understanding of parameter choice. It does not mention pageIdx, but that is already described in the schema.

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 the tool's function: selecting a specified iframe/frame. It distinguishes from siblings by specifying that contextId comes from ruyi_list_frames and that the selected frame is used in subsequent evaluate_script calls.

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?

It provides explicit guidance on when to use contextId vs selector, noting contextId is most stable. It also explains the follow-up usage with evaluate_script via frameContextId, giving a clear workflow context. It does not explicitly name alternative tools for exclusion, but the integration hint is sufficient.

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/Facetomyself/ruyi-mcp'

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