Skip to main content
Glama
robertn702

Sunsama MCP Server

update-task-text

Modify task titles in Sunsama by providing the task ID and new text to update task descriptions and keep project information current.

Instructions

Update the text/title of a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitResponsePayloadNoWhether to limit the response payload size
recommendedStreamIdNoRecommended stream ID (optional)
taskIdYesThe ID of the task to update
textYesThe new text/title for the task

Implementation Reference

  • The handler function that implements the core logic of the 'update-task-text' tool by calling the Sunsama client to update the task's text and returning a formatted JSON response.
    export const updateTaskTextTool = withTransportClient({
      name: "update-task-text",
      description: "Update the text/title of a task",
      parameters: updateTaskTextSchema,
      execute: async (
        { taskId, text, recommendedStreamId, limitResponsePayload }:
          UpdateTaskTextInput,
        context: ToolContext,
      ) => {
        const options: {
          recommendedStreamId?: string | null;
          limitResponsePayload?: boolean;
        } = {};
        if (recommendedStreamId !== undefined) {
          options.recommendedStreamId = recommendedStreamId;
        }
        if (limitResponsePayload !== undefined) {
          options.limitResponsePayload = limitResponsePayload;
        }
    
        const result = await context.client.updateTaskText(taskId, text, options);
    
        return formatJsonResponse({
          success: result.success,
          taskId,
          text,
          textUpdated: true,
          updatedFields: result.updatedFields,
        });
      },
    });
  • Zod schema that validates and describes the input parameters for the 'update-task-text' tool.
    export const updateTaskTextSchema = z.object({
      taskId: z.string().min(1, "Task ID is required").describe(
        "The ID of the task to update",
      ),
      text: z.string().min(1, "Task text is required").describe(
        "The new text/title for the task",
      ),
      recommendedStreamId: z.string().nullable().optional().describe(
        "Recommended stream ID (optional)",
      ),
      limitResponsePayload: z.boolean().optional().describe(
        "Whether to limit the response payload size",
      ),
    });
  • src/main.ts:32-44 (registration)
    The registration code in the MCP server setup that registers all tools, including 'update-task-text', by iterating over the 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,
      );
    });
  • The taskTools array where 'updateTaskTextTool' is included and exported for further aggregation into allTools and registration.
    export const taskTools = [
      // Query tools
      getTasksBacklogTool,
      getTasksByDayTool,
      getArchivedTasksTool,
      getTaskByIdTool,
    
      // Lifecycle tools
      createTaskTool,
      deleteTaskTool,
    
      // Update tools
      updateTaskCompleteTool,
      updateTaskSnoozeDateTool,
      updateTaskBacklogTool,
      updateTaskPlannedTimeTool,
      updateTaskNotesTool,
      updateTaskDueDateTool,
      updateTaskTextTool,
      updateTaskStreamTool,
    ];
  • The withTransportClient higher-order function used to wrap the raw tool config, providing transport-aware client resolution and 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;
          }
        }
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Update' which implies mutation, but doesn't disclose behavioral traits like required permissions, whether the update is reversible, error conditions, or what happens to existing text. 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 wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or response format, and lacks usage guidance relative to sibling tools. This leaves significant gaps for an AI agent.

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 the schema fully documents all 4 parameters. The description adds minimal value by implying 'text' maps to 'text/title', but doesn't provide additional context beyond what's 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 ('Update') and resource ('text/title of a task'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling update tools like update-task-notes or update-task-due-date, which also update task attributes.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a valid task ID), when not to use it (e.g., for other task attributes), or refer to sibling tools like update-task-notes for different updates.

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