Skip to main content
Glama

select_page

Read-only

Set a specific browser page as the active context for subsequent Chrome DevTools automation commands, enabling targeted debugging and inspection tasks.

Instructions

Select a page as a context for future tool calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdxYesThe index of the page to select. Call list_pages to list pages.

Implementation Reference

  • Handler function that retrieves the page by index using context.getPageByIdx, brings it to the front, sets it as the selected page, and instructs the response to include pages.
    handler: async (request, response, context) => {
      const page = context.getPageByIdx(request.params.pageIdx);
      await page.bringToFront();
      context.setSelectedPageIdx(request.params.pageIdx);
      response.setIncludePages(true);
    },
  • Input schema defining pageIdx as a number, with description instructing to use list_pages first.
    schema: {
      pageIdx: z
        .number()
        .describe(
          'The index of the page to select. Call list_pages to list pages.',
        ),
    },
  • Full tool definition and export using defineTool, including name 'select_page', description, annotations, schema, and handler. This registers the tool.
    export const selectPage = defineTool({
      name: 'select_page',
      description: `Select a page as a context for future tool calls.`,
      annotations: {
        category: ToolCategories.NAVIGATION_AUTOMATION,
        readOnlyHint: true,
      },
      schema: {
        pageIdx: z
          .number()
          .describe(
            'The index of the page to select. Call list_pages to list pages.',
          ),
      },
      handler: async (request, response, context) => {
        const page = context.getPageByIdx(request.params.pageIdx);
        await page.bringToFront();
        context.setSelectedPageIdx(request.params.pageIdx);
        response.setIncludePages(true);
      },
    });
Behavior3/5

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

Annotations provide readOnlyHint=true, indicating this is a safe read operation. The description adds context about setting a page as context for future tool calls, which is useful behavioral information not covered by annotations. However, it doesn't detail what 'context' entails (e.g., whether it persists across sessions or affects other tools) or any limitations.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and purpose, making it easy to understand quickly.

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 moderate complexity (setting context for future calls), annotations cover safety (read-only), and schema fully documents the single parameter. However, there is no output schema, and the description doesn't explain what 'selecting a page' returns or how the context affects subsequent operations, leaving some gaps in understanding the tool's full behavior.

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 description coverage is 100%, with the parameter 'pageIdx' clearly documented in the schema as 'The index of the page to select. Call list_pages to list pages.' The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage.

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 action ('Select a page') and purpose ('as a context for future tool calls'), which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from similar sibling tools like 'navigate_page' or 'list_pages', which could also involve page selection or context setting.

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 description implies usage by stating it sets context for future tool calls, and the input schema references 'list_pages' to get page indices, providing some guidance. However, it doesn't explicitly state when to use this tool versus alternatives like 'navigate_page' or 'new_page', nor does it mention prerequisites or exclusions.

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/SHAY5555-gif/chrome-devtools-mcp'

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