Skip to main content
Glama
soil-dev

capsulemcp

complete_task

Mark a task as completed, recording who completed it and when, while preserving it in task history.

Instructions

Mark a task as done / completed / finished. Sets status=COMPLETED on the task, populating completedBy and completedAt while preserving the task in history (unlike delete_task which removes it permanently). Use this whenever a user says 'mark done', 'complete', 'finish', or similar — equivalent to update_task with status:COMPLETED but more discoverable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The actual handler for the complete_task tool. Makes a PUT request to /tasks/{id} with status='COMPLETED'.
    export async function completeTask(input: z.infer<typeof completeTaskSchema>) {
      // Capsule uses PUT /tasks/{id} with status field — no dedicated /complete action
      return capsulePut<{ task: unknown }>(`/tasks/${input.id}`, {
        task: { status: "COMPLETED" },
      });
    }
  • Zod schema for complete_task input: requires an id (positive integer).
    export const completeTaskSchema = z.object({
      id: z.number().int().positive(),
    });
  • src/server.ts:639-645 (registration)
    Registration of the 'complete_task' tool in the MCP server using the registerTool helper.
    registerTool(
      server,
      "complete_task",
      "Mark a task as done / completed / finished. Sets status=COMPLETED on the task, populating completedBy and completedAt while preserving the task in history (unlike delete_task which removes it permanently). Use this whenever a user says 'mark done', 'complete', 'finish', or similar — equivalent to update_task with status:COMPLETED but more discoverable.",
      completeTaskSchema,
      completeTask,
    );
  • The registerTool helper that wraps the MCP server.tool() registration. Handles JSON-stringify wrapping of the handler's return value into MCP text content.
    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);
      });
    }
  • The capsulePut low-level HTTP client used by completeTask to send the PUT request to the Capsule API.
    export async function capsulePut<T>(path: string, body: unknown): Promise<T> {
      if (isReadOnly()) throw new CapsuleReadOnlyError("PUT");
      const token = getToken();
      const url = buildUrl(path);
      const { res, cleanup } = await doFetch(url, {
        method: "PUT",
        headers: { ...baseHeaders(token), "Content-Type": "application/json" },
        body: JSON.stringify(body),
      });
      try {
        return await handleResponse<T>(res);
      } finally {
        cleanup();
      }
    }
Behavior4/5

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

Since no annotations are provided, the description covers behavioral traits thoroughly: it sets status=COMPLETED, populates completedBy and completedAt, preserves history, and contrasts with delete_task. Lacks details on permissions or idempotency but is otherwise strong.

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

Conciseness4/5

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

The description is concise with three sentences, front-loading the purpose and then detailing behavior. It could be more structured but is appropriately sized and clear.

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?

Given the simple input (one parameter), no output schema, and no annotations, the description provides adequate context: it explains the effect on the task, contrasts with siblings, and suggests usage. Missing parameter explanation is a minor gap.

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

Parameters2/5

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

The only parameter 'id' is not described beyond the schema. With 0% schema coverage, the description should explain that the id is the task ID. This omission limits the tool's discoverability for agents.

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 description uses specific verbs like 'Mark' and 'complete' on the resource 'task'. It clearly distinguishes from siblings such as delete_task and update_task, fulfilling the criteria for a high score.

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 states when to use the tool: 'Use this whenever a user says "mark done", "complete", "finish", or similar.' It contrasts with delete_task and update_task, providing clear alternatives.

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