Skip to main content
Glama

Delete Blob

affine_delete_blob

Remove a specific blob/file from workspace storage by specifying the workspace ID and blob key/ID, with an option to delete permanently.

Instructions

Delete a blob/file from workspace storage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesBlob key/ID to delete
permanentlyNoDelete permanently
workspaceIdYesWorkspace ID

Implementation Reference

  • The asynchronous handler function `deleteBlobHandler` that executes the tool logic: sends a GraphQL mutation to delete a blob from the workspace storage using the provided workspaceId, key, and optional permanently flag.
    const deleteBlobHandler = async ({ workspaceId, key, permanently = false }: { workspaceId: string; key: string; permanently?: boolean }) => {
      try {
        const mutation = `
          mutation DeleteBlob($workspaceId: String!, $key: String!, $permanently: Boolean) {
            deleteBlob(workspaceId: $workspaceId, key: $key, permanently: $permanently)
          }
        `;
        
        const data = await gql.request<{ deleteBlob: boolean }>(mutation, {
          workspaceId,
          key,
          permanently
        });
        
        return text({ success: data.deleteBlob, key, workspaceId, permanently });
      } catch (error: any) {
        return text({ error: error.message });
      }
    };
  • Registration of the "affine_delete_blob" tool on the McpServer, specifying title, description, Zod-based input schema, and linking to the deleteBlobHandler.
    server.registerTool(
      "affine_delete_blob",
      {
        title: "Delete Blob",
        description: "Delete a blob/file from workspace storage.",
        inputSchema: {
          workspaceId: z.string().describe("Workspace ID"),
          key: z.string().describe("Blob key/ID to delete"),
          permanently: z.boolean().optional().describe("Delete permanently")
        }
      },
      deleteBlobHandler as any
    );
  • Zod schema definition for the tool's input parameters: workspaceId (string), key (string), permanently (optional boolean).
    inputSchema: {
      workspaceId: z.string().describe("Workspace ID"),
      key: z.string().describe("Blob key/ID to delete"),
      permanently: z.boolean().optional().describe("Delete permanently")
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the destructive action ('Delete') but doesn't elaborate on consequences like whether deletion is reversible, what happens to associated data, or if there are rate limits. The 'permanently' parameter hints at permanence but the description doesn't explain the default behavior or implications of this choice.

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 states the core functionality without unnecessary words. It's front-loaded with the essential action and resource, making it immediately scannable. Every word earns its place in this minimal but complete statement.

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 operation with no annotations and no output schema, the description is insufficient. It doesn't address critical context like authentication requirements, error conditions, what constitutes a valid 'key', or what happens when deletion fails. The agent lacks guidance on proper usage and potential side effects of this mutation tool.

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%, so the schema already documents all three parameters adequately. The description adds no additional parameter context beyond what's in the schema (e.g., format examples for 'key' or 'workspaceId', or clarification about what 'permanently' means in practice). This meets the baseline for high schema coverage.

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 ('blob/file from workspace storage'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'affine_upload_blob' and 'affine_cleanup_blobs' by focusing on individual blob deletion. However, it doesn't explicitly differentiate from other destructive operations like 'affine_delete_account' or 'delete_workspace' beyond the resource type.

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 when to choose this over 'affine_cleanup_blobs' (which might handle multiple blobs), nor does it specify prerequisites like authentication or workspace access. The agent must infer usage solely from the tool name and parameters.

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