Skip to main content
Glama

get_console_logs

Retrieve browser console logs captured during automated web testing sessions to identify JavaScript errors and debug issues.

Instructions

Get all console logs captured during the session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that returns the joined console logs if any, otherwise a message indicating no logs.
    async getConsoleLogs() { return this.consoleLogs.length > 0 ? this.consoleLogs.join('\n') : 'No console logs captured.'; }
  • Schema definition for the get_console_logs tool, including name, description, and empty input schema.
    { name: "get_console_logs", description: "Get all console logs captured during the session", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:142-144 (registration)
    Registration in the tool dispatch switch case, calling the browserManager handler.
    case "get_console_logs": result = await browserManager.getConsoleLogs(); break;
  • Helper code that sets up the console event listener to capture logs into the consoleLogs array.
    // Setup console log capturing this.page.on('console', msg => { const type = msg.type().toUpperCase(); const text = msg.text(); this.consoleLogs.push(`[${type}] ${text}`); });
  • Private field storing the captured console logs.
    private consoleLogs: string[] = [];

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/samusilv/qa-agent-mcp'

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