list_events
Retrieve error events from a Glitchtip project to monitor and debug application issues. Specify the project slug to view recent events with configurable limits.
Instructions
List events for a specific project (requires event:read scope)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of events to return (default: 25) | |
| project_slug | Yes | The slug of the project |
Implementation Reference
- src/index.js:361-418 (handler)The handler function that implements the list_events tool logic: fetches events from Glitchtip API for the specified project.async listEvents(args) { const { project_slug, limit = 25 } = args || {}; if (!project_slug) { return { content: [ { type: "text", text: "Error: project_slug is required" } ] }; } const url = `${this.apiEndpoint}/api/0/projects/${this.organizationSlug}/${project_slug}/events/?limit=${limit}`; try { const response = await fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${this.apiToken}`, 'Accept': 'application/json' } }); if (!response.ok) { const errorText = await response.text(); return { content: [ { type: "text", text: `Error fetching events: ${response.status} ${response.statusText}\n${errorText}` } ] }; } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error: ${error.message}` } ] }; } }
- src/index.js:71-88 (schema)The input schema and metadata for the list_events tool, as returned by the ListTools handler.{ name: "list_events", description: "List events for a specific project (requires event:read scope)", inputSchema: { type: "object", properties: { project_slug: { type: "string", description: "The slug of the project" }, limit: { type: "number", description: "Maximum number of events to return (default: 25)" } }, required: ["project_slug"] } },
- src/index.js:141-142 (registration)The switch case in the CallToolRequestHandler that registers and dispatches calls to the listEvents handler.case "list_events": return await this.listEvents(args);