Delete Workspace
delete_workspacePermanently delete a workspace by providing its unique ID. Use this to remove unwanted workspaces from your account.
Instructions
Delete a workspace permanently
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workspace ID |
Implementation Reference
- src/tools/workspaces.ts:353-373 (handler)The actual handler function for the delete_workspace tool. It executes a GraphQL mutation to delete a workspace by ID and returns a receipt with the result.
const deleteWorkspaceHandler = async ({ id }: { id: string }) => { try { const mutation = ` mutation DeleteWorkspace($id: String!) { deleteWorkspace(id: $id) } `; const data = await gql.request<{ deleteWorkspace: boolean }>(mutation, { id }); return receipt("workspace.delete", { workspaceId: id, id, deleted: data.deleteWorkspace, success: data.deleteWorkspace, message: "Workspace deleted successfully", }); } catch (error: any) { return text({ error: error.message }); } }; - src/tools/workspaces.ts:379-381 (schema)Input schema for delete_workspace: requires a workspace 'id' string.
inputSchema: { id: z.string().describe("Workspace ID") } - src/tools/workspaces.ts:374-384 (registration)Registration of the delete_workspace tool with the MCP server, including title, description, input schema, and handler.
server.registerTool( "delete_workspace", { title: "Delete Workspace", description: "Delete a workspace permanently", inputSchema: { id: z.string().describe("Workspace ID") } }, deleteWorkspaceHandler as any ); - src/util/mcp.ts:26-32 (helper)The receipt() utility used by deleteWorkspaceHandler to format the success response.
export function receipt(kind: string, data: Record<string, unknown>) { return text({ kind, ok: true, ...data, }); } - src/toolSurface.ts:33-86 (registration)Tool name listed in ALL_TOOLS constant and permission groups (workspaces, workspaces.write, admin, destructive, write).
"delete_workspace", "export_doc_markdown", "export_with_fidelity_report", "generate_access_token", "get_capabilities", "get_collection", "get_doc", "get_edgeless_canvas", "get_orphan_docs", "get_workspace", "inspect_template_structure", "instantiate_template_native", "list_access_tokens", "list_children", "list_collections", "list_comments", "list_docs", "list_docs_by_tag", "list_histories", "list_notifications", "list_organize_nodes", "list_surface_elements", "list_tags", "list_workspace_tree", "list_workspaces", "move_doc", "move_organize_node", "publish_doc", "read_all_notifications", "read_database_cells", "read_database_columns", "read_doc", "remove_doc_from_collection", "remove_tag_from_doc", "rename_folder", "replace_doc_with_markdown", "resolve_comment", "revoke_access_token", "revoke_doc", "search_docs", "sign_in", "update_collection", "update_collection_rules", "update_comment", "update_database_row", "update_doc_title", "update_edgeless_block", "update_frame_children", "update_profile", "update_settings", "update_surface_element", "update_workspace", "upload_blob", ] as const;