Skip to main content
Glama

get_console_logs

Retrieve browser console logs for debugging and monitoring web applications during automated testing on ARM64 devices.

Instructions

Get browser console logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_console_logs' tool. It returns the global consoleLogs array as a JSON string in the MCP response format.
    async getConsoleLogs() {
      return {
        content: [{ type: 'text', text: JSON.stringify(consoleLogs, null, 2) }],
      };
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required). This is part of the tools list returned by ListToolsRequest.
    {
      name: 'get_console_logs',
      description: 'Get browser console logs',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • index.js:367-368 (registration)
    Registration in the CallToolRequestSchema switch statement, dispatching calls to the getConsoleLogs handler method.
    case 'get_console_logs':
      return await this.getConsoleLogs();
  • Global array that stores console log entries captured via CDP Runtime.consoleAPICalled events.
    let consoleLogs = [];
  • Event listener code that populates the consoleLogs array from browser console events received over CDP WebSocket.
    if (message.method === 'Runtime.consoleAPICalled') {
      const logEntry = {
        type: message.params.type,
        text: message.params.args.map(arg => arg.value || arg.description).join(' '),
        timestamp: new Date().toISOString()
      };
      
      consoleLogs.push(logEntry);
      
      if (['error', 'warning'].includes(message.params.type)) {
        consoleErrors.push(logEntry);
      }
      
      // Keep only last 100 entries
      if (consoleLogs.length > 100) consoleLogs.shift();
      if (consoleErrors.length > 100) consoleErrors.shift();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't explain critical behaviors such as whether logs are cleared after retrieval, if there are rate limits, what format the logs are returned in, or if authentication is required. This is inadequate for a tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't address what the tool returns (e.g., log format, structure), behavioral constraints, or how it interacts with siblings like 'wipe_logs'. For a tool in a browser automation context, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, earning a baseline score of 4 for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('browser console logs'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_console_errors' or 'get_network_logs', which likely retrieve similar but distinct types of logs.

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 like 'get_console_errors' or 'wipe_logs'. The description lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage from tool names alone.

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/nfodor/claude-arm64-browser'

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