Skip to content

ref(mcp): Call shared team and project endpoints from SentryApiService - #1828

Merged
BYK merged 1 commit into
mainfrom
ref/shared-teams-projects-endpoints
Nov 3, 2026
Merged

BYK merged 1 commit into
mainfrom
ref/shared-teams-projects-endpoints

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Task 8.4 of the shared API client plan (#1669): the next domain after organizations (#1741).

This moves the team and project endpoints from SentryApiService into toolkit-core's api-client/endpoints/. SentryApiService now calls them with its Zod schemas. The code moves as is.

Changes

  • endpoints/teams adds listTeams (on @sentry/api's listOrganizationTeams) and createTeam.
  • endpoints/projects adds listProjects (on listOrganizationProjects), getProject, createProject, updateProject, and the project's teams: listProjectTeams, addProjectTeam, and removeProjectTeam.
  • Writes go through the request core, since the core's sdkClient only sends GETs. getProject and listProjectTeams keep their hand-built requests. @sentry/api has operations for both (getProject, listProjectTeams), but moving them onto those operations is a separate change.
  • The core gains nextPageCursor(response). listPage and listProjectTeams use it, and the next domains will too.
  • The endpoint tests share a scripted-transport helper in toolkit-core/src/test-utils/. That folder is left out of the browser typecheck, and organizations.test.ts uses the helper now as well.

One change in behaviour: as with #1741, a response that fails its schema in these calls now throws the shared ApiResponseValidationError instead of a ZodError. Both still reach the tool error handler as unexpected errors.

via @BYK.

--

View Session [Sentry]

Adds endpoints/teams and endpoints/projects to toolkit-core's shared API
client, moved as is from SentryApiService, which now calls them with its
Zod schemas. Endpoint tests share a scripted-transport helper.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 3, 2026 12:12am UTC

Request Review

@BYK
BYK merged commit 11afc4b into main Nov 3, 2026
35 checks passed
@BYK
BYK deleted the ref/shared-teams-projects-endpoints branch November 3, 2026 10:26
BYK pushed a commit that referenced this pull request Nov 3, 2026
#1834)

Task 8.4 of the shared API client plan
([#1669](#1669)). This is
stacked on #1828.

This moves the project setup endpoints from `SentryApiService` into
`toolkit-core`'s `api-client/endpoints/`. `SentryApiService` calls them
with its Zod schemas. The code moves as is.

- `endpoints/client-keys`: `listClientKeys`, `createClientKey`, and
`updateClientKey`. `updateClientKey` still sends only the fields that
are set, and keeps an explicit `rateLimit: null`.
`SentryApiService.updateClientKey` now takes the shared
`UpdateClientKeyParams` type, and its local request types are deleted.
- `endpoints/repositories`: `listRepositories`, which walks every page,
and `linkProjectRepository`, which sends the bulk code-mapping POST with
one root mapping.
- `endpoints/organizations` gains `updateAgenticOnboardingStatus`.

`@sentry/api` has no operation for `POST
/organizations/{org}/onboarding/agent/status/`, so that wrapper will
stay hand-written.

**One change in behaviour:** as with #1741, a response that fails its
schema now throws the shared `ApiResponseValidationError` instead of a
`ZodError`.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Preview — 016c48df Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant