browser_console_messages
Retrieve and manage all console messages from browser interactions using Playwright MCP, enabling detailed debugging and monitoring of web activities.
Instructions
Returns all console messages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/console.ts:29-31 (handler)The handler function that executes the tool logic: retrieves console messages from the tab and adds them to the response.handle: async (tab, params, response) => { tab.consoleMessages().map(message => response.addResult(message.toString())); },
- src/tools/console.ts:22-28 (schema)The tool schema defining name, title, description, input schema (empty object), and type as readOnly.schema: { name: 'browser_console_messages', title: 'Get console messages', description: 'Returns all console messages', inputSchema: z.object({}), type: 'readOnly', },
- src/tools.ts:36-52 (registration)Registration of all tools, including the browser_console_messages tool imported from console and spread into the allTools array.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];