sentry_list_issues
Retrieve and filter error issues from Sentry projects to monitor application health and identify problems using search queries like 'is:unresolved' or 'level:error'.
Instructions
List issues for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectSlug | Yes | Project slug/identifier | |
| query | No | Search query (e.g., 'is:unresolved', 'level:error') |
Implementation Reference
- src/index.ts:1019-1037 (handler)Executes the sentry_list_issues tool: checks apiClient, extracts projectSlug and query, calls apiClient.listIssues, formats and returns list of issues.case "sentry_list_issues": { if (!apiClient) { throw new Error("Sentry API client not initialized. Provide auth token."); } const { projectSlug, query } = args as any; const issues = await apiClient.listIssues(projectSlug, query); return { content: [ { type: "text", text: `Found ${issues.length} issues in ${projectSlug}:\n${issues.slice(0, 10).map((i: any) => `- [${i.level}] ${i.title} (${i.count} events)` ).join('\n')}${issues.length > 10 ? '\n... and more' : ''}`, }, ], }; }
- src/sentry-api-client.ts:55-58 (helper)Core implementation of listing issues: constructs API endpoint with projectSlug and optional query, calls private request method to fetch from Sentry API.async listIssues(projectSlug: string, query?: string) { const params = query ? `?query=${encodeURIComponent(query)}` : ''; return this.request(`/projects/${this.org}/${projectSlug}/issues/${params}`); }
- src/index.ts:397-413 (registration)Registers the sentry_list_issues tool in the ListTools response with name, description, and input schema.{ name: "sentry_list_issues", description: "List issues for a project", inputSchema: { type: "object", properties: { projectSlug: { type: "string", description: "Project slug/identifier", }, query: { type: "string", description: "Search query (e.g., 'is:unresolved', 'level:error')", }, }, required: ["projectSlug"], },
- src/sentry-api-client.ts:20-36 (helper)Private request method used by listIssues to make authenticated HTTP requests to Sentry API.private async request(endpoint: string, options: any = {}) { const url = `${this.baseUrl}${endpoint}`; const response = await fetch(url, { ...options, headers: { 'Authorization': `Bearer ${this.authToken}`, 'Content-Type': 'application/json', ...options.headers, }, }); if (!response.ok) { throw new Error(`Sentry API error: ${response.status} ${response.statusText}`); } return response.json(); }