Skip to main content
Glama

Delete Organize Link

delete_organize_link

Delete an organize doc, tag, or collection link in an AFFiNE workspace by providing the node ID. Use to remove unwanted connections.

Instructions

Experimental: delete an AFFiNE organize doc/tag/collection link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdNo
nodeIdYes

Implementation Reference

  • The handler function for delete_organize_link. It resolves the workspace, loads the folders doc, looks up the node by ID, ensures it's not a folder (i.e., it's a link), marks it as deleted via deleteRecord, saves the doc, and returns success.
    const deleteOrganizeLinkHandler = async ({
      workspaceId,
      nodeId,
    }: {
      workspaceId?: string;
      nodeId: string;
    }) => {
      const resolvedWorkspaceId = requireWorkspaceId(workspaceId);
      const { socket } = await getSocketContext();
      try {
        await joinWorkspace(socket, resolvedWorkspaceId);
        const { docId, doc } = await loadFoldersDoc(socket, resolvedWorkspaceId);
        const nodeMap = organizeNodeMap(readOrganizeNodes(doc));
        const node = nodeMap.get(nodeId);
        if (!node || node.type === "folder") {
          throw new Error(`Organize link '${nodeId}' was not found.`);
        }
        deleteRecord(ensureRecord(doc, nodeId));
        await saveFoldersDoc(socket, resolvedWorkspaceId, docId, doc);
        return text({ success: true, nodeId });
      } finally {
        socket.disconnect();
      }
    };
  • Registration of the 'delete_organize_link' tool on the MCP server with its title, description, and input schema (workspaceId optional, nodeId required).
    server.registerTool(
      "delete_organize_link",
      {
        title: "Delete Organize Link",
        description: "Experimental: delete an AFFiNE organize doc/tag/collection link.",
        inputSchema: {
          workspaceId: WorkspaceId.optional(),
          nodeId: OrganizeNodeId,
        },
      },
      deleteOrganizeLinkHandler as any
    );
  • Input schema for delete_organize_link: workspaceId (optional) and nodeId (OrganizeNodeId).
    inputSchema: {
      workspaceId: WorkspaceId.optional(),
      nodeId: OrganizeNodeId,
    },
  • The deleteRecord helper function used by deleteOrganizeLinkHandler to mark a Y.Map record as deleted (sets $$DELETED flag, removes keys except 'id').
    function deleteRecord(record: Y.Map<any>, keepId = true): void {
      const keys = Array.from(record.keys());
      for (const key of keys) {
        if (keepId && key === "id") {
          continue;
        }
        record.delete(key);
      }
      record.set("$$DELETED", true);
    }
  • Listing of delete_organize_link in the tool surface authority list, and its associated scopes/capabilities.
    "delete_organize_link",
    "delete_surface_element",
Behavior1/5

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

With no annotations, the description must disclose behavioral traits but provides none (e.g., permanence, permissions, side effects). Only states the action.

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

Conciseness2/5

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

Extremely brief but at the expense of necessary detail. Lacks essential information, making conciseness a drawback rather than a strength.

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

Completeness1/5

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

Given the operation (delete) and two parameters, the description omits critical context such as return value, error conditions, and nature of 'link'. Incomplete for effective use.

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

Parameters1/5

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

Schema has 0% description coverage and description adds no meaning to the two parameters (workspaceId, nodeId). No indication of what values are valid or how they relate.

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?

Description clearly states the action (delete) and the resource (AFFiNE organize link, specifying doc/tag/collection). It differentiates from sibling tools like add_organize_link, list_organize_nodes, and move_organize_node.

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 on when to use this tool versus alternatives, no prerequisites, no context about when deletion is appropriate or what effects occur.

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