feat(tools): add update_dsn tool for managing DSN client key settings#1099
Merged
Conversation
Add a new MCP tool that allows AI assistants to update Sentry DSN (client key) configuration including rate limits, browser SDK version, and dynamic SDK loader options. ### Key Changes - Added `update_dsn` tool with support for: - Rate limiting (count + window in seconds) - Browser SDK version selection - Dynamic SDK loader feature toggles (performance, replay, debug) - Extended `ClientKeySchema` in schema.ts with rateLimit, browserSdkVersion, and dynamicSdkLoaderOptions fields - Added `updateClientKey` API method to client.ts (PUT /projects/:org/:project/keys/:id/) - Added MSW mock handler for PUT requests to client key endpoint - Registered tool in catalog index and generated updated tool definitions - Added comprehensive tests covering success cases and input validation Co-Authored-By: Antigravity (Google DeepMind) <noreply@google.com>
Without this guard, calling the tool with only organizationSlug, projectSlug, and keyId would issue a PUT with an empty body, silently performing a no-op while returning a success response. Addresses Cursor Bugbot review feedback on getsentry#1099. Co-Authored-By: Antigravity (Google DeepMind) <noreply@google.com>
Align update_dsn with the core ProjectKey update contract after verifying the upstream Sentry endpoint and serializers. Preserve flexible browser SDK versions while matching rate-limit bounds and zero-value behavior. Add server-level catalog dispatch coverage so the catalog-only tool is exercised through execute_sentry_tool, and document the safe QA path for mutating catalog-only tools. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Member
|
Will get this cleaned up and merged thank you! |
Map zero-valued update_dsn rate-limit input to rateLimit: null so the request and response both represent a disabled DSN limit. Update handler and catalog-dispatch tests to cover the disabled output. Co-Authored-By: GPT-5 Codex <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c750cd6. Configure here.
Render zero-valued DSN rate limit responses as disabled so the tool does not report an active cap of zero events. Add coverage for an API response that returns a zero-valued rate limit object.\n\nCo-Authored-By: GPT-5 Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a new
update_dsnMCP tool that enables AI assistants to update Sentry DSN (client key) configuration for a project. This fills a gap where DSN keys could be read viaget_dsn_detailsbut not modified.Key Changes
update_dsntool: Allows updating rate limits, browser SDK version, and dynamic SDK loader options on a Sentry client keyClientKeySchema: AddedrateLimit,browserSdkVersion, anddynamicSdkLoaderOptionsfields to support the full PUT response shapeupdateClientKeyAPI method: PUT request to/projects/:org/:project/keys/:keyId/endpointCapabilities
The tool accepts the following update parameters (all optional, at least one required):
rateLimitCount+rateLimitWindow: Set per-DSN rate limits (or pass0to clear)browserSdkVersion: Pin a specific Sentry Browser SDK versiondynamicSdkLoaderOptions: Toggle performance monitoring, session replay, and debug mode on the CDN loaderBreaking Changes