Skip to main content
Glama
soil-dev

capsulemcp

list_tasks

List tasks in Capsule CRM. Filter by status (open or completed) and owner. Defaults to open tasks.

Instructions

List tasks in Capsule CRM. Defaults to OPEN tasks; pass status to broaden. Optionally filter to a specific owner via ownerId. Capsule does not expose a due-date filter on this endpoint — for that use filter_* tools elsewhere or iterate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoDefaults to OPEN when omitted. Pass COMPLETED to filter to completed tasks, or 'OPEN' explicitly.
ownerIdNoFilter to tasks owned by this user ID
pageNo
perPageNo

Implementation Reference

  • The handler function for list_tasks. Makes a GET request to Capsule's /tasks endpoint with optional filters (status, ownerId, page, perPage) and returns paginated results.
    export async function listTasks(input: z.infer<typeof listTasksSchema>) {
      const { data, nextPage } = await capsuleGet<{ tasks: unknown[] }>("/tasks", {
        // Default 'OPEN' applied here (not via zod .default()) so that
        // z.infer keeps `status` optional for callers that omit it.
        status: input.status ?? "OPEN",
        // Capsule's owner filter is the bare query param `owner`, not `ownerId`/`assignedToUserId`.
        owner: input.ownerId,
        page: input.page,
        perPage: input.perPage,
      });
      return { ...data, nextPage };
    }
  • Zod schema for list_tasks input. Defines optional status (OPEN/COMPLETED), ownerId, page, and perPage parameters.
    export const listTasksSchema = z.object({
      // Note: Capsule has a third internal status `PENDING` (a task that's
      // part of an active track but not yet "open"), but it can only be
      // reached via track machinery — it is NOT directly settable by
      // /tasks PUT, and a list filter for it returns the same as OPEN
      // anyway. We expose only the two values that are actually filterable
      // by the v2 API.
      status: z
        .enum(["OPEN", "COMPLETED"])
        .optional()
        .describe(
          "Defaults to OPEN when omitted. Pass COMPLETED to filter to completed tasks, or 'OPEN' explicitly.",
        ),
      ownerId: z.number().int().positive().optional().describe("Filter to tasks owned by this user ID"),
      page: z.number().int().positive().optional().default(1),
      perPage: z.number().int().min(1).max(100).optional().default(25),
    });
  • src/server.ts:596-602 (registration)
    Registration of the list_tasks tool on the MCP server, wiring schema and handler together with a descriptive string.
    registerTool(
      server,
      "list_tasks",
      "List tasks in Capsule CRM. Defaults to OPEN tasks; pass status to broaden. Optionally filter to a specific owner via ownerId. Capsule does not expose a due-date filter on this endpoint — for that use filter_* tools elsewhere or iterate.",
      listTasksSchema,
      listTasks,
    );
  • Generic tool registration helper that wraps handler return values into MCP text content responses. Used to register list_tasks.
    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, so description carries full burden. Mentions default status and due-date limitation, but does not disclose pagination behavior, sorting, or whether it returns all tasks or just a page. Adequate but not thorough.

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?

Three sentences, front-loaded with purpose, then optional filters, then limitation. Efficient but could combine 'Defaults to OPEN' and 'pass status to broaden'.

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

Completeness3/5

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

No output schema, so description should hint return value. Doesn't mention that it returns a list of tasks or pagination. Does note due-date limitation and alternative tools, but missing differentiation from 'get_tasks'.

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 covers only 50% of parameters with descriptions (status and ownerId). Description adds meaning for those two but ignores page and perPage, which lack schema descriptions. Fails to fully compensate for the coverage gap.

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?

Clearly states it lists tasks in Capsule CRM and mentions default status and optional owner filter. Differentiates from filter_* tools for due-date queries, but does not explicitly distinguish from the sibling 'get_tasks' tool.

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 context on defaults and optional filters, and explicitly advises using filter_* tools for due-date queries. Lacks guidance on pagination or when to use 'get_tasks'.

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