Skip to main content
Glama

Cleanup Deleted Blobs

affine_cleanup_blobs

Permanently remove deleted blobs in AFFiNE workspaces to optimize storage. Requires a workspace ID to target specific cleanup tasks.

Instructions

Permanently remove deleted blobs to free up storage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID

Implementation Reference

  • The async handler function that executes the tool logic: performs a GraphQL mutation to permanently release deleted blobs in the specified workspace, freeing up storage. Returns success status and count of released blobs or error.
    const cleanupBlobsHandler = async ({ workspaceId }: { workspaceId: string }) => {
      try {
        const mutation = `
          mutation ReleaseDeletedBlobs($workspaceId: String!) {
            releaseDeletedBlobs(workspaceId: $workspaceId)
          }
        `;
        
        const data = await gql.request<{ releaseDeletedBlobs: number }>(mutation, {
          workspaceId
        });
        
        return text({ success: true, workspaceId, blobsReleased: data.releaseDeletedBlobs });
      } catch (error: any) {
        return text({ error: error.message });
      }
    };
  • Registration of the 'affine_cleanup_blobs' MCP tool, including input schema validation using Zod and linking to the handler function.
    server.registerTool(
      "affine_cleanup_blobs",
      {
        title: "Cleanup Deleted Blobs",
        description: "Permanently remove deleted blobs to free up storage.",
        inputSchema: {
          workspaceId: z.string().describe("Workspace ID")
        }
      },
      cleanupBlobsHandler as any
    );
  • src/index.ts:73-73 (registration)
    Top-level invocation of the registerBlobTools function during server setup, which registers the affine_cleanup_blobs tool among others.
    registerBlobTools(server, gql);
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the permanent nature ('permanently remove') and storage impact, which is good. However, it lacks critical behavioral details: whether this requires admin permissions, if it's reversible, potential side effects on linked data, rate limits, or confirmation prompts. For a destructive operation, this is insufficient.

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, efficient sentence that front-loads the core action and purpose. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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 destructive tool with no annotations and no output schema, the description is incomplete. It covers the basic purpose but misses critical context: permissions needed, irreversibility warnings, system impact, error conditions, or what success looks like. Given the complexity and risk, more behavioral disclosure is warranted.

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?

Schema description coverage is 100%, with the single parameter 'workspaceId' well-documented in the schema. The description adds no parameter-specific information beyond implying the cleanup is workspace-scoped. This meets the baseline of 3 since the schema handles parameter documentation adequately.

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 ('permanently remove') and target ('deleted blobs') with the goal of 'freeing up storage'. It distinguishes from siblings like 'affine_delete_blob' (which likely deletes individual blobs) by focusing on cleanup of already-deleted items. However, it doesn't explicitly contrast with other storage management tools.

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. It doesn't mention prerequisites (e.g., only after blobs are marked deleted), frequency considerations, or compare with siblings like 'affine_delete_blob' for active deletion. The context is implied but not explicit.

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