Skip to main content
Glama

browser_console_messages

Capture and retrieve all console messages from web pages using structured accessibility snapshots, enabling efficient debugging and monitoring within the Playwright MCP server environment.

Instructions

Returns all console messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that retrieves all console messages from the browser tab and adds them as tool results.
    handle: async (tab, params, response) => { tab.consoleMessages().map(message => response.addResult(message.toString())); },
  • JSON Schema definition for the tool, specifying name, title, description, empty input schema, and read-only type.
    schema: { name: 'browser_console_messages', title: 'Get console messages', description: 'Returns all console messages', inputSchema: z.object({}), type: 'readOnly', },
  • Full tool definition using defineTabTool and export for MCP tool registration.
    const console = defineTabTool({ capability: 'core', schema: { name: 'browser_console_messages', title: 'Get console messages', description: 'Returns all console messages', inputSchema: z.object({}), type: 'readOnly', }, handle: async (tab, params, response) => { tab.consoleMessages().map(message => response.addResult(message.toString())); }, }); export default [ console, ];

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/maywzh/playwright-mcp'

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