Skip to main content
Glama
soil-dev

capsulemcp

get_task

Fetch a single task by its numeric ID to get full task details including description, due date, owner, completion state, and linked entity (party, opportunity, project, or standalone).

Instructions

Fetch a single task by its numeric id. Returns the task's description, due date, owner, completion state, and the entity it's attached to (party / opportunity / project, if any — standalone tasks not tied to a record are also valid). For batch fetches of up to 10 tasks at once, use get_tasks instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • The actual handler function for the 'get_task' tool. It takes an input object with 'id', makes a GET request to Capsule's /tasks/{id} endpoint, and returns the task data.
    export async function getTask(input: z.infer<typeof getTaskSchema>) {
      const { data } = await capsuleGet<{ task: unknown }>(`/tasks/${input.id}`);
      return data;
    }
  • Zod schema for get_task input validation. Defines a single required parameter: 'id' (positive integer).
    export const getTaskSchema = z.object({
      id: z.number().int().positive().describe("Task ID"),
    });
  • src/server.ts:604-610 (registration)
    Registration of the 'get_task' tool with the MCP server. Calls registerTool with the name 'get_task', a description, the getTaskSchema, and the getTask handler.
    registerTool(
      server,
      "get_task",
      "Fetch a single task by its numeric id. Returns the task's description, due date, owner, completion state, and the entity it's attached to (party / opportunity / project, if any — standalone tasks not tied to a record are also valid). For batch fetches of up to 10 tasks at once, use get_tasks instead.",
      getTaskSchema,
      getTask,
    );
  • The generic registerTool helper function used to register all tools (including get_task). It wraps the handler's return value in MCP's standard text-content response format.
    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);
      });
    }
Behavior4/5

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

No annotations exist, so the description must fully convey behavior. It describes the returned fields and notes that standalone tasks are valid. While it doesn't explicitly state that the operation is read-only or mention error handling, the purpose implies a safe fetch, and the information provided is sufficient for basic understanding.

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 extremely concise, using two short sentences. The primary purpose is stated first, and additional clarifications follow. No wasted words.

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

Completeness5/5

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

For a simple, single-parameter fetch tool with no output schema, the description provides all necessary information: what it does, what it returns, and how it differs from alternatives. The sibling list further contextualizes its role.

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% with a single parameter 'id' described as 'Task ID'. The description does not add significant meaning beyond stating it is numeric, which is already implied by the integer type. Baseline score of 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?

The description clearly states the action ('Fetch a single task by its numeric id') and the resource, distinguishing from the sibling tool 'get_tasks' for batch fetches. It also lists the specific fields returned, leaving no ambiguity.

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 indicates when to use this tool versus alternatives ('For batch fetches of up to 10 tasks at once, use get_tasks instead'), providing clear context for selection.

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