Skip to main content
Glama

Sentry Issues MCP

by Leee62
fetcher.ts3.04 kB
/** get sentry event by <ID> */ export async function fetchSentryEvent<T>( eventId: string, organization_id_or_slug: string, project_id_or_slug: string ): Promise<T | null> { try { const issueRes = await fetch( `https://${process.env.SENTRY_HOST}/api/0/projects/${organization_id_or_slug}/${project_id_or_slug}/events/${eventId}/`, { method: "GET", headers: { Authorization: `Bearer ${process.env.SENTRY_USER_TOKEN}`, }, } ); if (!issueRes.ok) { throw new Error(`HTTP error! status: ${issueRes.status}`); } return (await issueRes.json()) as T; } catch (error) { console.error("Error making request:", error); return null; } } /** get sentry events */ export async function fetchSentryEvents<T>( organization_id_or_slug: string, project_id_or_slug: string ): Promise<T | null> { try { const issueRes = await fetch( `https://${process.env.SENTRY_HOST}/api/0/projects/${organization_id_or_slug}/${project_id_or_slug}/events/`, { method: "GET", headers: { Authorization: `Bearer ${process.env.SENTRY_USER_TOKEN}`, }, } ); if (!issueRes.ok) { throw new Error(`HTTP error! status: ${issueRes.status}`); } return (await issueRes.json()) as T; } catch (error) { console.error("Error making request:", error); return null; } } // /** get sentry issue by <ID> */ // export async function fetchSentryIssue<T>( // issueId: string, // organization_id_or_slug: string // ): Promise<T | null> { // try { // const issueRes = await fetch( // `https://${process.env.SENTRY_HOST}/api/0/organizations/${organization_id_or_slug}/issues/${issueId}/`, // { // method: "GET", // headers: { // Authorization: `Bearer ${process.env.SENTRY_USER_TOKEN}`, // }, // } // ); // if (!issueRes.ok) { // throw new Error(`HTTP error! status: ${issueRes.status}`); // } // return (await issueRes.json()) as T; // } catch (error) { // console.error("Error making request:", error); // return null; // } // } // /** get sentry issue */ // export async function fetchSentryIssues<T>( // project_id_or_slug: string, // organization_id_or_slug: string // ): Promise<T | null> { // const path = project_id_or_slug // ? `projects/${organization_id_or_slug}/${project_id_or_slug}/issues/` // : `organizations/${organization_id_or_slug}/issues/`; // try { // const issueRes = await fetch( // `https://${process.env.SENTRY_HOST}/api/0/${path}`, // { // method: "GET", // headers: { // Authorization: `Bearer ${process.env.SENTRY_USER_TOKEN}`, // }, // } // ); // if (!issueRes.ok) { // throw new Error(`HTTP error! status: ${issueRes.status}`); // } // return (await issueRes.json()) as T; // } catch (error) { // console.error("Error making request:", error); // return null; // } // }

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/Leee62/sentry-issues-mcp'

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