Skip to main content
Glama
soil-dev

capsulemcp

delete_task

Permanently delete a task from Capsule CRM. Requires confirm=true; irreversible. Idempotent on retry.

Instructions

DESTRUCTIVE & IRREVERSIBLE: permanently delete a task. Prefer complete_task to mark a task done while keeping it in history. Requires confirm=true. Idempotent on retry: response is {deleted: true, alreadyDeleted: false, id} on a fresh delete or {deleted: true, alreadyDeleted: true, id} if the task was already gone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
confirmYesMust be set to true. Permanently deletes the task. To mark done without losing history use complete_task. Irreversible.

Implementation Reference

  • The actual handler function for delete_task. Validates confirm:true, then calls capsuleDelete with idempotent retry logic.
    export async function deleteTask(input: z.infer<typeof deleteTaskSchema>) {
      if (input.confirm !== true) {
        throw new Error("delete_task requires confirm: true");
      }
      return idempotent(
        () => capsuleDelete(`/tasks/${input.id}`),
        () => ({ deleted: true, alreadyDeleted: false, id: input.id }),
        () => ({ deleted: true, alreadyDeleted: true, id: input.id }),
      );
    }
  • Zod schema for delete_task: requires id (positive integer) and confirm (must be literal true).
    export const deleteTaskSchema = z.object({
      id: z.number().int().positive(),
      confirm: confirmFlag().describe(
        "Must be set to true. Permanently deletes the task. To mark done without losing history use complete_task. Irreversible.",
      ),
    });
  • src/server.ts:647-653 (registration)
    Registration of the 'delete_task' tool with name, description, schema, and handler via registerTool.
    registerTool(
      server,
      "delete_task",
      "DESTRUCTIVE & IRREVERSIBLE: permanently delete a task. Prefer complete_task to mark a task done while keeping it in history. Requires confirm=true. Idempotent on retry: response is `{deleted: true, alreadyDeleted: false, id}` on a fresh delete or `{deleted: true, alreadyDeleted: true, id}` if the task was already gone.",
      deleteTaskSchema,
      deleteTask,
    );
  • Helper that provides the confirm: true literal Zod type with a clear error message for destructive operations.
    import { z } from "zod";
    
    const CONFIRM_REQUIRED_MESSAGE =
      "confirm: true is required to perform this destructive operation (set the parameter explicitly to acknowledge the destructive intent)";
    
    export function confirmFlag(): z.ZodLiteral<true> {
      return z.literal(true, { error: () => CONFIRM_REQUIRED_MESSAGE });
    }
  • Generic registerTool helper that wraps handlers with JSON MCP text response formatting.
    export function registerTool<Schema extends z.ZodObject<ZodRawShape>>(
      server: McpServer,
      name: string,
      description: string,
      schema: Schema,
      handler: (input: z.infer<Schema>) => Promise<unknown>,
    ): void {
      // Use the SDK config-form registerTool with the full Zod schema. The
      // deprecated shape overload rebuilds z.object(schema.shape), which drops
      // object-level refinements such as superRefine.
      const registerWithSchema = server.registerTool.bind(server) as (
        toolName: string,
        config: { description: string; inputSchema: Schema },
        callback: (input: z.infer<Schema>) => Promise<CallToolResult>,
      ) => void;
    
      registerWithSchema(name, { description, inputSchema: schema }, async (input) => {
        const result = await handler(input);
        return wrapAsText(result);
      });
    }
Behavior5/5

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

No annotations are provided, so the description fully bears the burden. It labels the action as destructive and irreversible, details idempotent behavior on retry, and specifies the response format. This is thorough and honest.

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 two sentences long, front-loaded with a strong warning, and every sentence adds essential information. No redundant or unnecessary text.

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

Completeness4/5

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

For a simple delete tool with two parameters, the description covers the return format and idempotency. It could mention where to get the task ID or authorization requirements, but given the lack of output schema, it is fairly complete.

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 coverage is 50%. The 'confirm' parameter is well-described in both the schema and description. However, the 'id' parameter lacks description in the schema and is only implied in the text; the description does not explicitly explain what the id refers to or how to obtain it. This leaves room for ambiguity.

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?

The name and description clearly state the tool permanently deletes a task. It uses a specific verb ('delete') and resource ('task'), and explicitly distinguishes itself from the sibling 'complete_task' by advising to prefer that for marking done without losing history.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use (permanent deletion) and when not to (prefer complete_task). It also mandates 'confirm=true' as a usage prerequisite, providing clear guidance on invocation.

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/soil-dev/capsulemcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server