Skip to main content
Glama

pilot_frame_select

Switch browser automation context to a specific iframe by index or name, enabling subsequent interactions like clicking and filling forms within that frame.

Instructions

Switch context to an iframe by index or name. After switching, pilot_snapshot/click/fill will operate inside that iframe. Use pilot_frames to list available frames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoFrame index from pilot_frames output
nameNoFrame name attribute

Implementation Reference

  • The handler implementation for the 'pilot_frame_select' tool, which takes an index or name to switch the browser context to a specific iframe.
    server.tool(
      'pilot_frame_select',
      'Switch context to an iframe by index or name. After switching, pilot_snapshot/click/fill will operate inside that iframe. Use pilot_frames to list available frames.',
      {
        index: z.number().optional().describe('Frame index from pilot_frames output'),
        name: z.string().optional().describe('Frame name attribute'),
      },
      async ({ index, name }) => {
        await bm.ensureBrowser();
        try {
          if (index !== undefined) {
            const frame = bm.selectFrameByIndex(index);
            return { content: [{ type: 'text' as const, text: `Switched to frame ${index} (${frame.url()}). Refs cleared — run pilot_snapshot for fresh refs.` }] };
          }
          if (name) {
            const frame = bm.selectFrameByName(name);
            return { content: [{ type: 'text' as const, text: `Switched to frame "${name}" (${frame.url()}). Refs cleared — run pilot_snapshot for fresh refs.` }] };
          }
          return { content: [{ type: 'text' as const, text: 'Provide index or name. Use pilot_frames to list available frames.' }], isError: true };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
Behavior4/5

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

No annotations provided, so description carries full burden. Successfully discloses key behavioral trait: context switch persists and affects subsequent tool operations. Minor gap: doesn't mention persistence duration or explicit reset mechanism (pilot_frame_reset sibling).

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?

Three sentences, zero waste: action sentence, behavioral consequence sentence, prerequisite sentence. Front-loaded with primary action. No redundant words or schema repetition.

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?

Adequate for a navigation context tool with side effects. Covers prerequisites, affected siblings, and scope change. Minor gap: doesn't reference pilot_frame_reset for returning to main context, though discoverable via sibling list.

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?

Schema coverage is 100%, establishing baseline 3. Description adds value by clarifying these are alternative identification methods ('index or name') rather than cumulative filters. Could clarify mutual exclusivity requirement given both are technically optional in 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?

Excellent specific verb ('Switch') + resource ('iframe') + mechanism ('by index or name'). Clearly distinguishes from sibling 'pilot_frames' (listing vs switching) and implies context change.

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?

Explicit prerequisite workflow: 'Use pilot_frames to list available frames.' Clear scope explanation: subsequent operations on pilot_snapshot/click/fill operate inside the iframe. Names specific affected siblings.

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/TacosyHorchata/Pilot'

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