delete_workspace
Permanently deletes a workspace and all associated data including members, configs, API keys, and resources. Provide the workspace ID to remove the workspace.
Instructions
Delete a workspace by id. This is permanent and removes the workspace, its members, configs, API keys, and resources.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | The workspace ID to delete |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- Service method that executes the actual HTTP DELETE request to /admin/workspaces/{workspaceId}. Uses the BaseService.delete() helper and returns { success: true } on success.
async deleteWorkspace(workspaceId: string): Promise<{ success: boolean }> { await this.delete( `/admin/workspaces/${this.encodePathSegment(workspaceId)}`, ); return { success: true }; } - src/tools/workspaces.tools.ts:299-322 (registration)Registers the 'delete_workspace' tool on the MCP server using server.tool(). Provides description and wires the schema to the handler which calls service.workspaces.deleteWorkspace().
// Phase 1: Delete workspace tool server.tool( "delete_workspace", "Delete a workspace by id. This is permanent and removes the workspace, its members, configs, API keys, and resources.", WORKSPACES_TOOL_SCHEMAS.deleteWorkspace, async (params) => { await service.workspaces.deleteWorkspace(params.workspace_id); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully deleted workspace ${params.workspace_id}`, success: true, }, null, 2, ), }, ], }; }, ); - src/tools/workspaces.tools.ts:64-66 (schema)Zod schema for deleteWorkspace input validation - requires a single 'workspace_id' string parameter.
deleteWorkspace: { workspace_id: z.string().describe("The workspace ID to delete"), }, - src/services/base.service.ts:159-162 (helper)BaseService.delete() method used by the deleteWorkspace service. Performs an HTTP DELETE with allowNoContent:true to handle 204 responses.
protected async delete<T>(path: string): Promise<T> { return this.executeRequest<T>("DELETE", path, { allowNoContent: true }); } }