Skip to main content
Glama
JustasMonkev

MCP Accessibility Scanner

browser_close

Read-only

Automatically closes web pages after completing accessibility scans to ensure efficient resource management during WCAG compliance testing with MCP Accessibility Scanner.

Instructions

Close the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the browser_close tool logic. It closes the browser context via context.closeBrowserContext(), includes tabs in the response, and adds code to close the page.
    handle: async (context, params, response) => {
      await context.closeBrowserContext();
      response.setIncludeTabs();
      response.addCode(`await page.close()`);
    },
  • Schema definition for the browser_close tool, specifying name, title, description, empty input schema (no parameters), and readOnly type.
    schema: {
      name: 'browser_close',
      title: 'Close browser',
      description: 'Close the page',
      inputSchema: z.object({}),
      type: 'readOnly',
    },
  • Tool definition and registration using defineTool, including capability, schema, and handler. Exported in the module's default array.
    const close = defineTool({
      capability: 'core',
      schema: {
        name: 'browser_close',
        title: 'Close browser',
        description: 'Close the page',
        inputSchema: z.object({}),
        type: 'readOnly',
      },
    
      handle: async (context, params, response) => {
        await context.closeBrowserContext();
        response.setIncludeTabs();
        response.addCode(`await page.close()`);
      },
    });
  • src/tools.ts:38-56 (registration)
    Aggregation of all tools, including those from common.ts (which contains browser_close), into allTools array for use in the backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...form,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
      ...verify,
    ];
Behavior4/5

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

Annotations indicate readOnlyHint=true, destructiveHint=false, and openWorldHint=true, suggesting a safe, non-destructive operation that might open new contexts. The description 'Close the page' aligns with these annotations (closing is typically non-destructive in browsers, and openWorldHint could imply handling new tabs/windows). However, the description adds minimal context beyond annotations—it doesn't specify what happens after closing (e.g., if it returns to a previous page, affects browser state, or has side effects). With annotations covering safety, the bar is lower, but more behavioral detail would be helpful.

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 'Close the page' is extremely concise—three words that directly state the action. It's front-loaded with no unnecessary details, making it easy for an agent to parse. Every word earns its place, and there's no waste or redundancy.

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 (0 parameters, no output schema) and annotations providing safety info, the description is somewhat complete but lacks depth. It doesn't explain what 'page' means in context of sibling tools (e.g., vs. 'browser_tab_close'), potential return values, or behavioral nuances. For a close operation, more context on effects would improve completeness, but annotations help fill gaps.

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?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't mention any parameters, which is appropriate. Baseline is 4 for zero parameters, as the description doesn't need to compensate for missing schema info.

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

Purpose3/5

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

The description 'Close the page' states a clear action (close) on a resource (page), but it's vague about what 'page' refers to (current tab, specific page, etc.). It doesn't distinguish from sibling tools like 'browser_tab_close' or 'browser_close' (if there were multiple close tools), though the sibling list shows 'browser_tab_close' as a distinct tool, suggesting this might close the current page/tab. The description is minimal but conveys the basic purpose.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't specify if this closes the current page/tab, all pages, or how it differs from 'browser_tab_close' (which is a sibling tool). There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.

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

Related 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/JustasMonkev/mcp-accessibility-scanner'

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