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()}]}};
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.2
    • addedInput schema / properties / pageId
      Added value: +{
      +  "description": "The ID of the page to select. Call list_pages to get available pages.",
      +  "type": "number"
      +}
    • changedInput schema / required
      Previous value: -[]New value: +[
      +  "pageId"
      +]
  2. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

The description adds a useful behavioral note—that selecting a page sets it as a context for subsequent calls—which goes beyond the readOnlyHint annotation. However, it does not disclose whether the selection persists across calls, whether bringToFront has any side effects on the browser, or any limitations. The readOnlyHint is consistent with the tool's purpose, so there is no contradiction.

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 a single, concise sentence with no filler or redundancy. It front-loads the core purpose immediately and earns every word, making it highly efficient.

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?

Given the tool's simplicity (2 params, no output schema, simple annotations), the description is mostly adequate. However, it lacks important usage context such as when to select a page before other actions, how the selection affects sibling tools, and whether the selection persists. These gaps make it slightly incomplete for an agent deciding how to sequence calls.

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?

The schema already provides descriptions for both pageId and bringToFront, covering 100% of the parameters. The tool description does not add parameter-specific information, but the phrase 'context for future tool calls' gives a small amount of context to pageId, implying it becomes the active page target. This is enough to merit the baseline score of 3.

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 action (select), the resource (a page), and the purpose (as a context for future tool calls). This distinguishes select_page from sibling tools like new_page, close_page, and navigate_page, which have different operations on pages.

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

Usage Guidelines3/5

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

The phrase 'as a context for future tool calls' implies that select_page should be used before other tools that operate on a page, but it does not explicitly state when to use it or name alternatives. The schema's pageId description suggests calling list_pages for valid IDs, but there is no direct guidance on when not to use this tool or how it compares to other page-related actions.

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