Skip to main content
Glama

sentry_search_errors_in_file

Identify Sentry errors linked to a specific file or file path. Input the project slug and filename to generate a list of issues for troubleshooting.

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
NameRequiredDescriptionDefault
filenameYesFile path or filename to search for
projectSlugYesProject slug/identifier

Implementation Reference

  • Tool schema definition and registration in the list of available tools returned by ListToolsRequestHandler.
    { 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"], }, },
  • The main handler for the tool within the CallToolRequestSchema switch statement. Extracts parameters, calls the API client method, and returns formatted results.
    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'), }, ], }; }
  • Helper method in SentryAPIClient that constructs a Sentry search query for the filename and delegates to listIssues.
    async searchErrorsInFile(projectSlug: string, filename: string) { const query = `filename:"${filename}"`; return this.listIssues(projectSlug, query); }

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/diegofornalha/sentry-mcp-cursor'

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