Skip to main content
Glama

update_task

Modify task details like description or status in the coderide system using the task's unique identifier number.

Instructions

Updates an existing task's 'description' and/or 'status'. The task is identified by its unique 'number' (e.g., 'CRD-1'). At least one of 'description' or 'status' must be provided for an update.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYes
descriptionNo
statusNo

Implementation Reference

  • The execute method of UpdateTaskTool that performs the actual tool logic: extracts input, calls PUT /task/number/{taskNumber} via SecureApiClient, processes response, handles errors and returns formatted result.
    async execute(input: UpdateTaskInput): Promise<unknown> {
      logger.info('Executing update-task tool', input);
    
      try {
        // Use the injected API client to update task
        if (!this.apiClient) {
          throw new Error('API client not available - tool not properly initialized');
        }
    
        // Extract task number
        const { number, ...updateData } = input;
        
        // Convert task number to uppercase for consistency
        const taskNumber = number.toUpperCase();
        
        // Update task using the API endpoint
        const url = `/task/number/${taskNumber}`;
        logger.debug(`Making PUT request to: ${url}`);
        
        const responseData = await this.apiClient.put<UpdateTaskApiResponse>(url, updateData) as unknown as UpdateTaskApiResponse;
        
        if (!responseData.success) {
          const apiErrorMessage = responseData.message || 'API reported update failure without a specific message.';
          logger.warn(`Update task API call for ${taskNumber} returned success:false. Message: ${apiErrorMessage}`);
          return {
            isError: true,
            content: [{ type: "text", text: `Update for task ${taskNumber} failed: ${apiErrorMessage}` }]
          };
        }
    
        // At this point, responseData.success is true
        const updatedFieldsList = Object.keys(updateData).join(', ') || 'no specific fields (refresh)'; // Handle case where updateData is empty if API allows
        const apiMessage = responseData.message || 'Task successfully updated.';
    
        if (responseData.task) {
          return {
            number: responseData.task.number,
            title: responseData.task.title,
            description: responseData.task.description,
            status: responseData.task.status,
            updateConfirmation: `Task ${responseData.task.number} updated fields: ${updatedFieldsList}. API: ${apiMessage}`
          };
        } else {
          // responseData.success is true, but responseData.task is missing.
          logger.warn(`Update task API call for ${taskNumber} succeeded but returned no task data. API message: ${apiMessage}`);
          return {
            number: taskNumber, // Use input taskNumber as fallback
            title: '', // No title info available from response
            description: input.description || '', // Fallback to input description if available
            status: input.status || '',       // Fallback to input status if available
            updateConfirmation: `Task ${taskNumber} update reported success by API, but full task details were not returned. Attempted to update fields: ${updatedFieldsList}. API: ${apiMessage}`
          };
        }
      } catch (error) {
        let errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred';
        logger.error(`Error in update-task tool: ${errorMessage}`, error instanceof Error ? error : undefined);
    
        // Check if it's a not found error based on API response structure or message
        // Note: ApiError from apiClient already provides a safeErrorMessage
        if (error instanceof Error && (error as any).status === 404) {
           errorMessage = `Task with number '${input.number}' not found.`;
        } else if (error instanceof Error && error.message.includes('not found')) { // Fallback for other not found indications
           errorMessage = `Task with number '${input.number}' not found or update failed.`;
        }
        
        return {
          isError: true,
          content: [{ type: "text", text: errorMessage }]
        };
      }
    }
  • Zod schema UpdateTaskSchema defining input validation for the tool: requires task number (format XXX-NNN), optional description (max 2000 chars) and status (enum), with refine ensuring at least one update field.
    const UpdateTaskSchema = z.object({
      // Required field to identify the task
      number: z.string({
        required_error: "Task number is required to identify the task",
        invalid_type_error: "Task number must be a string"
      })
      .regex(/^[A-Za-z]{3}-\d+$/, { message: "Task number must be in the format ABC-123 (e.g., CRD-1 or crd-1). Case insensitive." })
      .describe("Task number to identify the task to update (case insensitive)"),
      
      // Optional fields that can be updated with security constraints
      description: z.string()
        .max(2000, "Description cannot exceed 2000 characters")
        .optional()
        .describe("New task description"),
      status: z.enum(['to-do', 'in-progress', 'done'], {
        invalid_type_error: "Status must be one of: to-do, in-progress, done"
      }).optional().describe("New task status"),
    }).strict().refine(
      // Ensure at least one field to update is provided
      (data) => {
        const updateFields = ['description', 'status'];
        return updateFields.some(field => field in data);
      },
      {
        message: 'At least one field to update must be provided',
        path: ['updateFields']
      }
    );
  • src/index.ts:315-330 (registration)
    In createProductionServer, instantiates UpdateTaskTool with SecureApiClient dependency and adds to tools array, then registers all tools with the MCP Server via tool.register(server). Import at line 24.
    const tools: any[] = [
      new StartProjectTool(secureApiClient),
      new GetPromptTool(secureApiClient),
      new GetTaskTool(secureApiClient),
      new GetProjectTool(secureApiClient),
      new UpdateTaskTool(secureApiClient),
      new UpdateProjectTool(secureApiClient),
      new ListProjectsTool(secureApiClient),
      new ListTasksTool(secureApiClient),
      new NextTaskTool(secureApiClient),
    ];
    
    // Register each tool with the server
    tools.forEach(tool => {
      tool.register(server);
    });
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that this is a mutation operation ('Updates'), identifies the required identifier ('number'), and specifies constraints ('At least one of description or status must be provided'). However, it lacks details on permissions, error handling, or what happens to unmentioned fields, leaving behavioral gaps for a mutation tool.

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 front-loaded with the core purpose in the first sentence, followed by essential details in a logical flow. Both sentences earn their place by providing critical information without redundancy, making it efficient and well-structured.

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?

Given the tool's complexity as a mutation with no annotations and no output schema, the description is adequate but incomplete. It covers the purpose, parameters, and basic constraints, but lacks details on return values, error cases, or side effects, which are important for a tool that modifies data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% schema description coverage. It explains that 'number' is a unique identifier with a pattern example ('e.g., CRD-1'), clarifies that 'description' and 'status' are the updatable fields, and states the constraint that at least one of them must be provided. This fully compensates for the lack of schema descriptions.

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 specific action ('Updates an existing task'), identifies the resource ('task'), and specifies the exact fields that can be modified ('description' and/or 'status'). It distinguishes this from sibling tools like 'get_task' or 'list_tasks' by focusing on modification rather than retrieval.

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?

The description provides clear context for when to use this tool: when updating a task's description or status, identified by its unique number. However, it does not explicitly state when not to use it (e.g., vs. 'update_project' for project-level changes) or mention alternatives like creating a new task, which would require a different tool not listed among siblings.

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/PixdataOrg/coderide-mcp'

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