delete_space_role
Delete a space role in Storyblok by specifying its ID to manage user permissions within a space.
Instructions
Deletes a space role using the Storyblok Management API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_role_id | Yes | ID of the space role to delete |
Implementation Reference
- src/tools/space-roles.ts:185-210 (handler)The handler function for the 'delete_space_role' tool. It registers a tool with the MCP server that accepts a 'space_role_id' number, calls apiDelete to the Storyblok Management API endpoint '/space_roles/{id}', and returns a success message or an error response.
// Tool: delete_space_role server.tool( 'delete_space_role', 'Deletes a space role using the Storyblok Management API.', { space_role_id: z.number().describe('ID of the space role to delete'), }, async ({ space_role_id }) => { try { await apiDelete(`/space_roles/${space_role_id}`); return { content: [ { type: 'text' as const, text: `Space role ${space_role_id} has been successfully deleted.`, }, ], }; } catch (error) { if (error instanceof APIError) { return createErrorResponse(error); } throw error; } } ); - src/tools/space-roles.ts:189-191 (schema)Input schema for delete_space_role: requires a single 'space_role_id' field of type number, described as 'ID of the space role to delete'.
{ space_role_id: z.number().describe('ID of the space role to delete'), }, - src/tools/index.ts:69-69 (registration)Registration call: registerSpaceRoles(server) is invoked from the central tools index, which registers all space role tools including delete_space_role.
registerSpaceRoles(server);