Skip to main content
Glama

Sentry MCP

Official
by getsentry
find-dsns.ts2.17 kB
import { setTag } from "@sentry/core"; import { defineTool } from "../internal/tool-helpers/define"; import { apiServiceFromContext } from "../internal/tool-helpers/api"; import type { ServerContext } from "../types"; import { ParamOrganizationSlug, ParamRegionUrl, ParamProjectSlug, } from "../schema"; export default defineTool({ name: "find_dsns", requiredScopes: ["project:read"], description: [ "List all Sentry DSNs for a specific project.", "", "Use this tool when you need to:", "- Retrieve a SENTRY_DSN for a specific project", "", "<hints>", "- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.", "- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.", "</hints>", ].join("\n"), inputSchema: { organizationSlug: ParamOrganizationSlug, regionUrl: ParamRegionUrl.optional(), projectSlug: ParamProjectSlug, }, async handler(params, context: ServerContext) { const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl, }); const organizationSlug = params.organizationSlug; setTag("organization.slug", organizationSlug); setTag("project.slug", params.projectSlug); const clientKeys = await apiService.listClientKeys({ organizationSlug, projectSlug: params.projectSlug, }); let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\n\n`; if (clientKeys.length === 0) { output += "No DSNs were found.\n\nYou can create new one using the `create_dsn` tool."; return output; } for (const clientKey of clientKeys) { output += `## ${clientKey.name}\n`; output += `**ID**: ${clientKey.id}\n`; output += `**DSN**: ${clientKey.dsn.public}\n\n`; } output += "# Using this information\n\n"; output += "- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\n"; return output; }, });

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

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