Skip to main content
Glama
ochen1
by ochen1

select_page

Read-only

Choose a page to set as the active context for subsequent operations. Specify page ID and optionally bring the page to the foreground.

Instructions

Select a page as a context for future tool calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesThe ID of the page to select. Call list_pages to get available pages.
bringToFrontNoWhether to focus the page and bring it to the top.

Implementation Reference

  • Tool name constant definition for 'select_page' used throughout the system.
    const SELECT_PAGE_TOOL = 'select_page';
  • Core rewrite logic for select_page tool: validates pageId ownership, returns markSelectPageId so the daemon updates per-context page selection.
    // select_page: track selection per-ctx; forward with pageId so upstream doesn't
    // clobber its global selection for others.
    if (toolName === SELECT_PAGE_TOOL) {
      const requested = params.pageId as number | undefined;
      if (requested == null) {
        return {
          params,
          shortCircuitError: {code: -32602, message: 'pageId required'},
        };
      }
      if (!ctx.owns(requested)) {
        return {
          params,
          shortCircuitError: {
            code: -32602,
            message: `pageId ${requested} not owned by this context`,
          },
        };
      }
      return {params, markSelectPageId: requested};
    }
  • The markSelectPageId field in RewriteResult interface; after a successful select_page response, the daemon sets ctx.selectedPageId from this value.
      /** If true, after a successful response, treat as select_page for ctx. */
      markSelectPageId?: number;
    }
  • Post-call handler in daemon.ts: after upstream responds to select_page, updates the context's selectedPageId using rewrite.markSelectPageId.
    } else if (name === 'select_page' && rewrite.markSelectPageId != null) {
      ctx.selectedPageId = rewrite.markSelectPageId;
    }
  • Test harness implementation of the select_page tool handler used in tests.
    if (name === 'select_page') {
      const id = Number(toolArgs.pageId);
      if (!pages.has(id)) {
        return {error: {code: -32602, message: `no page ${id}`}};
      }
      setSelected(id);
      return {result: {content: [{type: 'text', text: pagesListText()}]}};
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description need not cover that. The description adds no further behavioral traits beyond the selection action, which is acceptable for a simple tool.

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?

A single sentence effectively communicates the tool's purpose without superfluous words.

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?

Given the tool's simplicity (2 params, no output schema), the description is adequate. It would benefit from clarifying that selected page persists for subsequent calls, but this is not a critical 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?

Both parameters are fully described in the input schema (100% coverage). The description adds value by referencing list_pages for pageId, but this is a minor addition beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool selects a page as context for future calls. It is specific and distinguishes from sibling tools like close_page or list_pages, though it could be more explicit about the browser automation context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., calling list_pages first) or when not to use it.

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/ochen1/chrome-devtools-mcp-mux'

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