Skip to main content
Glama
soil-dev

capsulemcp

update_task

Modify specific fields of an existing task without affecting others. Update due date, status, owner, or description by providing only the fields to change.

Instructions

Update fields on an existing task. Only the fields you provide are changed. To mark a task done prefer complete_task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
descriptionNo
dueOnNoYYYY-MM-DD
dueTimeNoHH:MM in user's timezone
detailNo
statusNoSet to OPEN or COMPLETED. (PENDING exists internally for track-driven tasks but cannot be set directly via this tool — Capsule rejects it.) Setting status: OPEN on an already-open task is a true no-op (does not advance updatedAt).
ownerIdNoReassign owner to user ID. Once set, this connector cannot clear an owner back to null — use Capsule's web UI for that.

Implementation Reference

  • The handler function that executes the update_task logic. Extracts id and ownerId from input, builds a body object with only defined fields, then sends a PUT request to /tasks/{id}.
    export async function updateTask(input: z.infer<typeof updateTaskSchema>) {
      const { id, ownerId, ...rest } = input;
    
      const body: Record<string, unknown> = {};
      for (const [k, v] of Object.entries(rest)) {
        if (v !== undefined) body[k] = v;
      }
      if (ownerId) body["owner"] = { id: ownerId };
    
      return capsulePut<{ task: unknown }>(`/tasks/${id}`, { task: body });
    }
  • Zod schema defining the input shape for update_task. Fields: id (required), description, dueOn, dueTime, detail, status (OPEN/COMPLETED), and ownerId (all optional except id).
    export const updateTaskSchema = z.object({
      id: z.number().int().positive(),
      description: z.string().min(1).optional(),
      dueOn: z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/)
        .optional()
        .describe("YYYY-MM-DD"),
      dueTime: z
        .string()
        .regex(/^\d{2}:\d{2}$/)
        .optional()
        .describe("HH:MM in user's timezone"),
      detail: z.string().optional(),
      // Capsule rejects direct sets of `PENDING` (which is a track-machinery
      // internal state) with 422 "cannot set task status to PENDING".
      // Only OPEN and COMPLETED are settable here.
      status: z
        .enum(["OPEN", "COMPLETED"])
        .optional()
        .describe(
          "Set to OPEN or COMPLETED. (PENDING exists internally for track-driven tasks but cannot be set directly via this tool — Capsule rejects it.) Setting status: OPEN on an already-open task is a true no-op (does not advance updatedAt).",
        ),
      ownerId: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          "Reassign owner to user ID. Once set, this connector cannot clear an owner back to null — use Capsule's web UI for that.",
        ),
    });
  • src/server.ts:631-637 (registration)
    Registration of the update_task tool via the registerTool helper in src/server.ts. Wires the name 'update_task' to updateTaskSchema and updateTask handler, with a description.
    registerTool(
      server,
      "update_task",
      "Update fields on an existing task. Only the fields you provide are changed. To mark a task done prefer complete_task.",
      updateTaskSchema,
      updateTask,
    );
  • The registerTool helper function used to register update_task (and all other tools). Wraps the handler's return value into the MCP text-content response format via JSON.stringify.
    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);
      });
    }
Behavior3/5

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

No annotations provided. Description discloses partial update behavior and specific constraints on status and ownerId, but lacks details on auth, rate limits, or error handling. Acceptable given no annotations.

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?

Two sentences, no fluff. Front-loaded with tool purpose, followed by key behavioral note. Every sentence adds value.

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 tool with 7 parameters and no output schema, the description lacks details on return values, error scenarios, and validation. Annotations are absent, leaving gaps in behavioral context. Incomplete for complex use.

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 57%, with some parameters (dueOn, dueTime, status, ownerId) having inline descriptions. Tool description adds 'Only the fields you provide are changed' but doesn't enrich understanding beyond schema. Baseline 3 is appropriate.

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?

Clearly states 'Update fields on an existing task' with specific verb and resource. Distinguishes from sibling 'complete_task' by explicitly recommending it for marking done.

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

Usage Guidelines4/5

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

Provides explicit guidance to prefer complete_task for marking done, implying when to use this tool for other updates. No when-not usage stated, but clear enough.

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