Skip to main content
Glama
ochen1
by ochen1

list_pages

Read-only

Get a list of all browser tabs open in the shared Chrome instance, enabling identification and selection for further actions.

Instructions

Get a list of pages open in the browser.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Definition of the constant LIST_PAGES_TOOL, used to identify the 'list_pages' tool throughout the codebase.
    const LIST_PAGES_TOOL = 'list_pages';
    const CLOSE_PAGE_TOOL = 'close_page';
    const SELECT_PAGE_TOOL = 'select_page';
  • Handler in rewriteToolCall: list_pages passes through params without pageId injection; response filtering is done post-call in the daemon.
    // list_pages: no pageId injection, response filtering happens elsewhere.
    if (toolName === LIST_PAGES_TOOL) {
      return {params};
    }
  • Core handler: filters the list_pages response to include only pages owned by the requesting context.
    export function filterListPagesResult(
      result: {content?: Array<{type: string; text?: string}>} | null | undefined,
      ctx: MuxContext,
    ): unknown {
      if (!result || !Array.isArray(result.content)) return result;
      const newContent = result.content.map((block) => {
        if (block.type !== 'text' || !block.text) return block;
        return {...block, text: filterPagesSection(block.text, ctx)};
      });
      return {...result, content: newContent};
    }
  • Registration/usage: when a 'list_pages' tool call returns, the result is filtered to owned pages.
    } else if (name === 'list_pages') {
      result = filterListPagesResult(result, ctx);
    } else if (name === 'close_page') {
  • Helper function that parses page lines and drops those not owned by the context.
    export function filterPagesSection(text: string, ctx: MuxContext): string {
      // Split by line. Rewrite any line that matches a "pageId: url" pattern to
      // omit rows not in the ctx ownership set. Preserve non-matching lines.
      const lines = text.split('\n');
      const out: string[] = [];
      for (const line of lines) {
        const m = line.match(/^(\s*)(?:Page\s+(?:idx\s+)?)?(\d+)\s*:\s*/);
        if (m) {
          const id = Number(m[2]);
          if (ctx.owns(id)) out.push(line);
          // else: drop
          continue;
        }
        out.push(line);
      }
      return out.join('\n');
    }
Behavior3/5

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

The description states it gets a list, consistent with the readOnlyHint=true annotation. It adds no further behavioral details (e.g., whether it refreshes, performance impact). Since annotations already cover the safety profile, the description adds minimal value but is not contradictory.

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, clear sentence with no unnecessary words. It is front-loaded with the action and resource.

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 tool is simple, but the description does not specify the output format (e.g., page IDs, URLs, titles). Given that sibling tools like 'select_page' require page identifiers, knowing the output structure would be helpful. Missing this context lowers completeness.

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?

There are no parameters, so the input schema is empty (100% coverage). The description does not need to add parameter details. Baseline score of 4 is appropriate for zero-parameter tools.

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 'Get a list of pages open in the browser' clearly states the tool's action and resource. It distinguishes from sibling tools like 'select_page' (which selects a specific page) and 'navigate_page' (which navigates), but does not specify the output format (e.g., URLs, titles).

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?

No explicit usage guidelines are provided. The description implies usage when a list of open pages is needed, but does not mention when not to use it or suggest alternatives. The usage context is inferred.

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