Skip to main content
Glama
robertn702

Sunsama MCP Server

update-task-complete

Mark Sunsama tasks as complete with optional timestamp to track task completion and maintain updated task status.

Instructions

Mark a task as complete with optional completion timestamp

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
completeOnNoCompletion timestamp (ISO format). Defaults to current time
limitResponsePayloadNoWhether to limit the response payload size
taskIdYesThe ID of the task to mark as complete

Implementation Reference

  • The core handler function that executes the tool logic: marks the specified task as complete using the Sunsama client API, with optional completion timestamp and payload limiting, and returns a formatted JSON response.
    export const updateTaskCompleteTool = withTransportClient({
      name: "update-task-complete",
      description: "Mark a task as complete with optional completion timestamp",
      parameters: updateTaskCompleteSchema,
      execute: async (
        { taskId, completeOn, limitResponsePayload }: UpdateTaskCompleteInput,
        context: ToolContext,
      ) => {
        const result = await context.client.updateTaskComplete(
          taskId,
          completeOn,
          limitResponsePayload,
        );
    
        return formatJsonResponse({
          success: result.success,
          taskId,
          completed: true,
          updatedFields: result.updatedFields,
        });
      },
    });
  • Zod schema defining the input parameters for the tool: taskId (required), completeOn (optional ISO timestamp), limitResponsePayload (optional boolean).
    export const updateTaskCompleteSchema = z.object({
      taskId: z.string().min(1, "Task ID is required").describe(
        "The ID of the task to mark as complete",
      ),
      completeOn: z.string().optional().describe(
        "Completion timestamp (ISO format). Defaults to current time",
      ),
      limitResponsePayload: z.boolean().optional().describe(
        "Whether to limit the response payload size",
      ),
    });
  • src/main.ts:32-44 (registration)
    Generic registration of all tools (including update-task-complete) to the MCP server via forEach loop over allTools array.
    // Register all tools
    allTools.forEach((tool) => {
      server.registerTool(
        tool.name,
        {
          description: tool.description,
          inputSchema: "shape" in tool.parameters
            ? tool.parameters.shape
            : tool.parameters,
        },
        tool.execute,
      );
    });
  • Higher-order function that wraps the raw tool config, injects transport-aware client, handles execution context, and ensures MCP-compliant response formatting.
    export function withTransportClient(toolConfig: ToolConfig) {
      return {
        name: toolConfig.name,
        description: toolConfig.description,
        parameters: toolConfig.parameters,
        execute: async (args: any, extra: any = {}) => {
          try {
            // Auto-resolve client based on transport
            const client = await getClient(extra.session);
    
            // Execute tool with injected client
            const context: ToolContext = { ...extra, client };
            const result = await toolConfig.execute(args, context);
    
            // Ensure MCP-compliant response format
            if (result && Array.isArray(result.content)) {
              return result;
            }
    
            // Wrap if needed
            return {
              content: [
                {
                  type: "text",
                  text: typeof result === "string"
                    ? result
                    : JSON.stringify(result, null, 2)
                }
              ]
            };
          } catch (error) {
            console.error(`Tool ${toolConfig.name} error:`, error);
            throw error;
          }
        }
      };
    }
  • Utility function used by the handler to format the tool response as MCP-compliant JSON text content.
    export function formatJsonResponse(data: any) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether this is a mutation (implied by 'Mark'), permission requirements, side effects (e.g., task archiving), rate limits, or what the response contains. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes the key optional feature concisely.

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?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on permissions, side effects, response format, and error handling, which are critical for safe and effective 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 100%, so parameters are fully documented in the schema. The description adds no additional meaning beyond implying 'completeOn' is optional and for timestamp, which is already in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the verb ('Mark') and resource ('a task') with the specific action ('as complete') and mentions optional timestamp functionality. It distinguishes from siblings like update-task-due-date or update-task-notes by focusing on completion status, though it doesn't explicitly contrast them.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like update-task-backlog or other update-task-* siblings. It mentions optional timestamp but doesn't specify prerequisites, error conditions, or when not to use it.

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/robertn702/mcp-sunsama'

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