Skip to main content
Glama

get_logpoint_history

Retrieve log output history from Xdebug logpoints to debug PHP applications by accessing recorded debug data with configurable entry limits.

Instructions

Get the log output history from logpoints

Input Schema

NameRequiredDescriptionDefault
logpoint_idNoSpecific logpoint ID (all if not specified)
limitNoMaximum entries to return

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "limit": { "default": 50, "description": "Maximum entries to return", "type": "integer" }, "logpoint_id": { "description": "Specific logpoint ID (all if not specified)", "type": "string" } }, "type": "object" }

Implementation Reference

  • MCP tool registration including schema and handler function. The handler fetches log history for a specific logpoint using LogpointManager.getLogHistory() or overall statistics if no logpoint_id provided, and returns JSON-formatted response.
    server.tool( 'get_logpoint_history', 'Get the log output history from logpoints', { logpoint_id: z.string().optional().describe('Specific logpoint ID (all if not specified)'), limit: z.number().int().default(50).describe('Maximum entries to return'), }, async ({ logpoint_id, limit }) => { if (logpoint_id) { const history = ctx.logpointManager.getLogHistory(logpoint_id, limit); return { content: [{ type: 'text', text: JSON.stringify({ logpoint_id, history }, null, 2) }], }; } const stats = ctx.logpointManager.getStatistics(); return { content: [{ type: 'text', text: JSON.stringify(stats, null, 2) }], }; } );
  • Core helper method that retrieves the log history entries for a given logpoint ID, applying limit if specified by taking the most recent entries.
    getLogHistory(id: string, limit?: number): LogEntry[] { const logpoint = this.logpoints.get(id); if (!logpoint) return []; const history = logpoint.logHistory; if (limit && limit < history.length) { return history.slice(-limit); } return history; }
  • Helper method that computes and returns statistics for all logpoints (total count, total hits, per-logpoint summary), called when no specific logpoint_id is provided.
    getStatistics(): { totalLogpoints: number; totalHits: number; logpoints: Array<{ id: string; file: string; line: number; hitCount: number; lastHitAt?: Date; }>; } { const logpoints = this.getAllLogpoints(); const totalHits = logpoints.reduce((sum, lp) => sum + lp.hitCount, 0); return { totalLogpoints: logpoints.length, totalHits, logpoints: logpoints.map((lp) => ({ id: lp.id, file: lp.file, line: lp.line, hitCount: lp.hitCount, lastHitAt: lp.lastHitAt, })), }; }

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/kpanuragh/xdebug-mcp'

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