sentry_search_errors_in_file
Search for Sentry errors occurring in a specific file to identify and resolve issues related to a particular file path or filename.
Instructions
Search for Sentry errors occurring in a specific file. Find all issues related to a particular file path or filename.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectSlug | Yes | Project slug/identifier | |
| filename | Yes | File path or filename to search for |
Implementation Reference
- src/index.ts:1377-1396 (handler)Tool handler that extracts parameters, calls SentryAPIClient.searchErrorsInFile, and formats the response.case "sentry_search_errors_in_file": { if (!apiClient) { throw new Error("Sentry API client not initialized. Provide auth token."); } const { projectSlug, filename } = args as any; const issues = await apiClient.searchErrorsInFile(projectSlug, filename); return { content: [ { type: "text", text: `Found ${issues.length} issues in file ${filename}:\n` + issues.map((i: any) => `- ${i.shortId}: ${i.title} (${i.count} events, ${i.userCount} users)` ).join('\n'), }, ], }; }
- src/index.ts:671-688 (schema)Tool schema definition including input schema and description, registered in listTools response.{ name: "sentry_search_errors_in_file", description: "Search for Sentry errors occurring in a specific file. Find all issues related to a particular file path or filename.", inputSchema: { type: "object", properties: { projectSlug: { type: "string", description: "Project slug/identifier", }, filename: { type: "string", description: "File path or filename to search for", }, }, required: ["projectSlug", "filename"], }, },
- src/sentry-api-client.ts:201-204 (helper)Core helper method in SentryAPIClient that constructs a filename query and delegates to listIssues.async searchErrorsInFile(projectSlug: string, filename: string) { const query = `filename:"${filename}"`; return this.listIssues(projectSlug, query); }