Skip to main content
Glama

Delete Workspace

delete_workspace

Permanently delete a workspace by providing its unique ID. Use this to remove unwanted workspaces from your account.

Instructions

Delete a workspace permanently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkspace ID

Implementation Reference

  • 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 });
        }
      };
  • Input schema for delete_workspace: requires a workspace 'id' string.
    inputSchema: {
      id: z.string().describe("Workspace ID")
    }
  • 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
    );
  • 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,
      });
    }
  • 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;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It only states 'permanently', implying irreversibility, but fails to disclose other important behaviors like cascading deletion of contents, permission requirements, or failure conditions. This is insufficient for a delete operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at one sentence, front-loading the key action. However, it may be too sparse, omitting critical details like irreversibility emphasis. Nevertheless, every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete operation with one parameter and no output schema, the description provides the core purpose but lacks essential context such as irreversible consequences, required permissions, or side effects. Completeness is inadequate for safe tool usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% coverage with a single parameter described as 'Workspace ID'. The description adds no further semantic meaning beyond what the schema offers, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (delete) and the resource (workspace), and the adverb 'permanently' distinguishes it from non-destructive operations like update_workspace. Among sibling tools, it is uniquely identifiable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on prerequisites, such as requiring the workspace to be empty or the user to be an owner. No exclusion criteria or alternative tools are mentioned. For a destructive operation, explicit 'when to use' and 'when not to use' would be valuable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DAWNCR0W/affine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server