Skip to main content
Glama

Delete Workspace

delete_workspace

Permanently remove a workspace by specifying its unique ID using the provided GraphQL API endpoint, ensuring efficient management of AFFiNE workspace resources.

Instructions

Delete a workspace permanently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkspace ID

Implementation Reference

  • The handler function that implements the core logic of the 'delete_workspace' tool. It performs a GraphQL mutation to delete the specified workspace by ID and returns a success or error response.
    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 text({ success: data.deleteWorkspace, message: "Workspace deleted successfully" });
        } catch (error: any) {
          return text({ error: error.message });
        }
      };
  • Registration of the 'delete_workspace' tool, including its metadata, input schema (requiring a workspace ID), and binding to the deleteWorkspaceHandler.
    server.registerTool(
      "delete_workspace",
      {
        title: "Delete Workspace",
        description: "Delete a workspace permanently",
        inputSchema: {
          id: z.string().describe("Workspace ID")
        }
      },
      deleteWorkspaceHandler as any
    );
  • Secondary registration of an alias 'affine_delete_workspace' tool using the same handler and schema.
    server.registerTool(
      "affine_delete_workspace",
      {
        title: "Delete Workspace",
        description: "Delete a workspace permanently",
        inputSchema: {
          id: z.string().describe("Workspace ID")
        }
      },
      deleteWorkspaceHandler as any
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'permanent,' which is crucial for a destructive operation, but fails to mention critical details like required permissions, confirmation steps, error handling, or impact on associated resources (e.g., docs in the workspace). This leaves significant gaps in understanding the tool's behavior.

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

Conciseness5/5

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

The description is a single, direct sentence that front-loads the essential action ('Delete a workspace permanently') with zero wasted words. It's optimally concise and structured for quick comprehension.

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?

Given the high-stakes nature of a permanent deletion tool with no annotations and no output schema, the description is insufficient. It lacks details on permissions, side effects, success/error responses, and recovery options, making it incomplete for safe and effective use by an AI agent.

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 has 100% description coverage, with the single parameter 'id' clearly documented as 'Workspace ID.' The description adds no additional semantic context about the parameter, such as format examples or validation rules, so it meets the baseline for adequate but unenhanced documentation.

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

Purpose4/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 resource ('workspace'), making the purpose immediately understandable. However, it doesn't distinguish this from other destructive operations like 'affine_delete_account' or 'affine_delete_comment' among the sibling tools, which would require explicit differentiation for a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'update_workspace' or 'create_workspace', nor does it mention prerequisites, recovery options, or exclusions. It's a bare statement of function without contextual advice.

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

Related 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