Skip to main content
Glama
Wladastic

AutoProbeMCP

by Wladastic

get_console_logs

Retrieve browser console logs with optional filtering by log level (log, info, warn, error, debug) and clear them after retrieval to streamline debugging.

Instructions

Get console logs from the browser

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoFilter logs by level
clearNoClear console logs after retrieving

Implementation Reference

  • Zod schema for the get_console_logs tool input validation. Defines optional 'level' enum filter and 'clear' boolean flag (defaults to false).
    const GetConsoleLogsSchema = z.object({
      level: z.enum(['log', 'info', 'warn', 'error', 'debug']).optional(),
      clear: z.boolean().default(false)
    });
  • src/index.ts:295-313 (registration)
    Registration of the 'get_console_logs' tool in the ListToolsRequestSchema handler. Specifies name, description (Get console logs from the browser), and input schema with level filter and clear flag.
    {
      name: 'get_console_logs',
      description: 'Get console logs from the browser',
      inputSchema: {
        type: 'object',
        properties: {
          level: {
            type: 'string',
            enum: ['log', 'info', 'warn', 'error', 'debug'],
            description: 'Filter logs by level'
          },
          clear: {
            type: 'boolean',
            default: false,
            description: 'Clear console logs after retrieving'
          }
        }
      }
    },
  • Handler implementation for the get_console_logs tool. Parses input via GetConsoleLogsSchema, filters stored consoleLogs by level if specified, optionally clears the log store, and returns formatted log entries with timestamps, level, and message. Logs are collected via a page console event listener set up in launch_browser.
    case 'get_console_logs': {
      if (!currentPage) {
        throw new Error('No browser page available. Launch a browser first.');
      }
    
      const params = GetConsoleLogsSchema.parse(args);
      
      // Filter logs by level if specified
      const filteredLogs = params.level 
        ? consoleLogs.filter(log => log.level === params.level)
        : consoleLogs;
    
      // Clear logs if requested
      if (params.clear) {
        consoleLogs = [];
      }
    
      const logText = filteredLogs.length > 0 
        ? filteredLogs.map(log => `[${log.timestamp.toISOString()}] ${log.level.toUpperCase()}: ${log.message}`).join('\n')
        : '(no console logs)';
    
      return {
        content: [
          {
            type: 'text',
            text: `Console Logs:\n${logText}`
          }
        ]
      };
    }
  • Global array storing console log entries. Each entry contains level (string), message (string), and timestamp (Date). Populated by the page console event listener in launch_browser.
    // Console logs storage
    let consoleLogs: Array<{level: string, message: string, timestamp: Date}> = [];
Behavior2/5

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

With no annotations, the description carries full burden but only states 'Get console logs', omitting behavioral details like whether it retrieves all logs or only new ones, or if it affects console state. The clear parameter is mentioned only in schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise at 6 words, but it is effectively front-loaded. It is not verbose, though it sacrifices some detail for brevity.

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 absence of annotations, output schema, and minimal description, the tool lacks completeness. It does not explain return values, behavior with respect to log accumulation, or side effects of the clear parameter beyond the schema.

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

Parameters3/5

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

Schema coverage is 100% and parameters are well-documented in the input schema. The description adds no extra information about parameters, but the schema suffices. Baseline score of 3 is appropriate.

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 'Get console logs from the browser' uses a specific verb (Get) and resource (console logs), clearly indicating the tool's function. It differentiates from sibling tools like evaluate_javascript or screenshot, though could be more explicit about the scope.

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 such as evaluate_javascript or checking page errors. The description lacks context for appropriate usage scenarios.

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/Wladastic/AutoProbeMCP'

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