Skip to main content
Glama

browser_console_messages

Retrieve console messages from web pages to monitor JavaScript errors, warnings, and logs during browser automation testing with Playwright.

Instructions

Returns all console messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'browser_console_messages' tool. It iterates over 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 tool, specifying name, title, description, no input parameters, and read-only type.
    schema: { name: 'browser_console_messages', title: 'Get console messages', description: 'Returns all console messages', inputSchema: z.object({}), type: 'readOnly', },
  • Local registration: exports the defined tool in an array for aggregation.
    export default [ console, ];
  • src/tools.ts:36-52 (registration)
    Global registration: imports and spreads the console tool (among others) into the allTools array, which is used to provide the complete set of tools.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];

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