delete_collaborator
Delete a collaborator from a Storyblok space using their collaborator ID or SSO ID.
Instructions
Deletes a collaborator from a specified Storyblok space. Can delete by collaborator_id or sso_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collaborator_id | Yes | ID of the collaborator to delete | |
| sso_id | No | SSO ID for SSO users (alternative to collaborator_id) |
Implementation Reference
- src/tools/collaborators.ts:120-140 (handler)The 'delete_collaborator' tool handler. Registers an MCP tool that accepts collaborator_id (number) or sso_id (string) and calls the API DELETE endpoint /collaborators/{identifier}. Returns JSON response on success or an error response if an APIError occurs.
// Tool: delete_collaborator server.tool( 'delete_collaborator', 'Deletes a collaborator from a specified Storyblok space. Can delete by collaborator_id or sso_id.', { collaborator_id: z.number().describe('ID of the collaborator to delete'), sso_id: z.string().optional().describe('SSO ID for SSO users (alternative to collaborator_id)'), }, async ({ collaborator_id, sso_id }) => { try { const identifier = sso_id ?? collaborator_id; const data = await apiDelete(`/collaborators/${identifier}`); return createJsonResponse(data); } catch (error) { if (error instanceof APIError) { return createErrorResponse(error); } throw error; } } ); - src/tools/collaborators.ts:124-127 (schema)Input schema for delete_collaborator: collaborator_id (required number) with description, and sso_id (optional string) as an alternative identifier for SSO users.
{ collaborator_id: z.number().describe('ID of the collaborator to delete'), sso_id: z.string().optional().describe('SSO ID for SSO users (alternative to collaborator_id)'), }, - src/tools/index.ts:16-16 (registration)Import of registerCollaborators from ./collaborators.js, which includes the delete_collaborator tool registration.
import { registerCollaborators } from './collaborators.js'; - src/tools/index.ts:68-68 (registration)Invocation of registerCollaborators(server) inside registerAllTools, registering the delete_collaborator tool.
registerCollaborators(server); - src/utils/api.ts:227-234 (helper)The apiDelete helper function used by the handler to make the DELETE HTTP request to the Storyblok Management API.
export async function apiDelete<T = unknown>(path: string): Promise<T> { const url = buildManagementUrl(path); const response = await fetch(url, { method: 'DELETE', headers: getManagementHeaders(), }); return handleResponse<T>(response, url); }