sentry_list_projects
Retrieve all projects within your Sentry organization to monitor error tracking, performance metrics, and application health status.
Instructions
List all projects in the organization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1002-1017 (handler)Main execution handler for the sentry_list_projects tool. Validates API client availability, fetches projects via apiClient.listProjects(), and returns a formatted list of projects.case "sentry_list_projects": { if (!apiClient) { throw new Error("Sentry API client not initialized. Provide auth token."); } const projects = await apiClient.listProjects(); return { content: [ { type: "text", text: `Found ${projects.length} projects:\n${projects.map((p: any) => `- ${p.slug}: ${p.name}`).join('\n')}`, }, ], }; }
- src/index.ts:390-396 (registration)Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema (empty object).name: "sentry_list_projects", description: "List all projects in the organization", inputSchema: { type: "object", properties: {}, }, },
- src/sentry-api-client.ts:39-41 (helper)Helper method in SentryAPIClient that performs the actual API request to retrieve the list of projects for the organization.async listProjects() { return this.request(`/organizations/${this.org}/projects/`); }
- src/sentry-api-client.ts:20-36 (helper)Private request method used by listProjects to make authenticated HTTP requests to the 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(); }