Skip to main content
Glama

read_debug_logs

Access collected debug logs from the current session to identify and resolve issues during development. Choose between raw or formatted output for analysis.

Instructions

Read the collected debug logs from the current session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (default: pretty)pretty

Implementation Reference

  • Handler for the 'read_debug_logs' tool: checks active session, reads raw logs from SessionManager, formats as 'raw' or 'pretty' JSON entries, and returns the result.
    case 'read_debug_logs': { if (!sessionManager.isActive()) { return { content: [{ type: 'text', text: 'No active debug session.' }], isError: true, }; } const format = (args?.format as string) || 'pretty'; const logs = sessionManager.readLogs(); if (!logs.trim()) { return { content: [ { type: 'text', text: 'No logs collected yet. Make sure to reproduce the bug to trigger the instruments.', }, ], }; } if (format === 'raw') { return { content: [{ type: 'text', text: logs }], }; } // Pretty format const entries = logs .trim() .split('\n') .map((line) => { try { return JSON.parse(line); } catch { return null; } }) .filter(Boolean); const formatted = entries .map((entry, i) => { const time = new Date(entry.timestamp).toISOString(); const data = JSON.stringify(entry.data, null, 2); return `[${i + 1}] ${time}\nInstrument: ${entry.id}\nLocation: ${entry.location}\nData:\n${data}`; }) .join('\n\n---\n\n'); return { content: [ { type: 'text', text: `Debug logs (${entries.length} entries):\n\n${formatted}`, }, ], }; }
  • Schema definition for 'read_debug_logs' tool including input schema with optional 'format' parameter.
    name: 'read_debug_logs', description: 'Read the collected debug logs from the current session.', inputSchema: { type: 'object', properties: { format: { type: 'string', enum: ['raw', 'pretty'], description: 'Output format (default: pretty)', default: 'pretty', }, }, }, },
  • SessionManager.readLogs() helper method that reads the debug log file contents using Node.js fs.readFileSync.
    readLogs(): string { if (!this.session) { throw new Error('No active debug session'); } if (!existsSync(this.session.logFile)) { return ''; } return readFileSync(this.session.logFile, 'utf-8'); }

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/iarmankhan/agentic-debugger'

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