Skip to main content
Glama
nzjami

Playwright MCP

by nzjami

browser_console_messages

Read-only

Retrieve browser console messages from automated web pages to monitor errors, warnings, and debug information during testing.

Instructions

Returns all console messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoLevel of the console messages to return. Each level includes the messages of more severe levels. Defaults to "info".info

Implementation Reference

  • The core handler logic for the 'browser_console_messages' tool. It retrieves all console messages from the current tab and adds each as a result to the response.
    handle: async (tab, params, response) => {
      tab.consoleMessages().map(message => response.addResult(message.toString()));
    },
  • Schema definition for the 'browser_console_messages' tool, specifying name, title, description, empty input schema, and readOnly type.
    schema: {
      name: 'browser_console_messages',
      title: 'Get console messages',
      description: 'Returns all console messages',
      inputSchema: z.object({}),
      type: 'readOnly',
    },
  • Exports the defined console tool for inclusion in the aggregate tools list.
    export default [
      console,
    ];
  • src/tools.ts:36-52 (registration)
    Registers the console tool (via spread) into the central allTools array used by the browser server backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
Behavior3/5

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

Annotations already indicate readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds minimal context beyond this, stating it 'returns all console messages' but not detailing format, ordering, or limitations (e.g., buffer size, real-time vs. historical). No contradiction with annotations.

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 extremely concise with a single sentence ('Returns all console messages'), which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (interacting with browser console), lack of output schema, and minimal annotations, the description is insufficient. It doesn't explain return format (e.g., array of objects with properties like message, level, timestamp), potential for empty results, or how it integrates with browser state, leaving gaps for agent usage.

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 'level' parameter fully documented in the schema (enum, default, description). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for high coverage without extra value.

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 'Returns all console messages' clearly states the verb ('returns') and resource ('console messages'), but it's vague about scope and doesn't differentiate from siblings like browser_network_requests. It doesn't specify whether this returns messages from the current page, all tabs, or a specific timeframe.

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 is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requires an active browser session), timing considerations (e.g., after page load), or how it relates to sibling tools like browser_evaluate or browser_run_code for debugging purposes.

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/nzjami/mcpPlaywright'

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