Skip to main content
Glama

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
    );

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