Skip to main content
Glama

asana_update_task

Update an existing Asana task's details including name, notes, due date, assignee, completion status, and custom fields to keep project information current.

Instructions

Update an existing task's details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task ID to update
nameNoNew name for the task
notesNoNew description for the task
due_onNoNew due date in YYYY-MM-DD format
assigneeNoNew assignee (can be 'me' or a user ID)
completedNoMark task as completed or not
resource_subtypeNoThe type of the task. Can be one of 'default_task' or 'milestone'
custom_fieldsNoObject mapping custom field GID strings to their values. For enum fields use the enum option GID as the value.

Implementation Reference

  • Executes the asana_update_task tool by calling AsanaClientWrapper.updateTask with task_id and data, handles response and provides HTML notes validation on errors.
    case "asana_update_task": {
      const { task_id, ...taskData } = args;
      try {
        const response = await asanaClient.updateTask(task_id, taskData);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      } catch (error) {
        // When error occurs and html_notes was provided, validate it
        if (taskData.html_notes && error instanceof Error && error.message.includes('400')) {
          const xmlValidationErrors = validateAsanaXml(taskData.html_notes);
          if (xmlValidationErrors.length > 0) {
            // Provide detailed validation errors to help the user
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  error: error instanceof Error ? error.message : String(error),
                  validation_errors: xmlValidationErrors,
                  message: "The HTML notes contain invalid XML formatting. Please check the validation errors above."
                })
              }],
            };
          } else {
            // HTML is valid, something else caused the error
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  error: error instanceof Error ? error.message : String(error),
                  html_notes_validation: "The HTML notes format is valid. The error must be related to something else."
                })
              }],
            };
          }
        }
        throw error; // re-throw to be caught by the outer try/catch
      }
    }
  • Tool definition including name, description, and input schema specifying parameters for updating a task.
    export const updateTaskTool: Tool = {
      name: "asana_update_task",
      description: "Update an existing task's details",
      inputSchema: {
        type: "object",
        properties: {
          task_id: {
            type: "string",
            description: "The task ID to update"
          },
          name: {
            type: "string",
            description: "New name for the task"
          },
          notes: {
            type: "string",
            description: "New description for the task"
          },
          due_on: {
            type: "string",
            description: "New due date in YYYY-MM-DD format"
          },
          assignee: {
            type: "string",
            description: "New assignee (can be 'me' or a user ID)"
          },
          completed: {
            type: "boolean",
            description: "Mark task as completed or not"
          },
          resource_subtype: {
            type: "string",
            description: "The type of the task. Can be one of 'default_task' or 'milestone'"
          },
          custom_fields: {
            type: "object",
            description: "Object mapping custom field GID strings to their values. For enum fields use the enum option GID as the value."
          }
        },
        required: ["task_id"]
      }
    };
  • Core implementation in AsanaClientWrapper that constructs the update request body and calls the Asana SDK's TasksApi.updateTask method.
    async updateTask(taskId: string, data: any) {
      const body = {
        data: {
          ...data,
          // Handle resource_subtype if provided
          resource_subtype: data.resource_subtype || undefined,
          // Handle custom_fields if provided
          custom_fields: data.custom_fields || undefined
        }
      };
      const opts = {};
      const response = await this.tasks.updateTask(body, taskId, opts);
      return response.data;
    }
  • Registers the updateTaskTool (imported from task-tools) in the all_tools array, which is filtered and exported as list_of_tools for the MCP server.
    const all_tools: Tool[] = [
      listWorkspacesTool,
      searchProjectsTool,
      searchTasksTool,
      getTaskTool,
      createTaskTool,
      getStoriesForTaskTool,
      updateTaskTool,
      getProjectTool,
      getProjectTaskCountsTool,
      getProjectSectionsTool,
      createTaskStoryTool,
      addTaskDependenciesTool,
      addTaskDependentsTool,
      createSubtaskTool,
      getMultipleTasksByGidTool,
      getProjectStatusTool,
      getProjectStatusesForProjectTool,
      createProjectStatusTool,
      deleteProjectStatusTool,
      setParentForTaskTool,
      getTasksForTagTool,
      getTagsForWorkspaceTool,
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states it 'updates' an existing task, implying a mutation operation, but doesn't cover critical aspects like authentication requirements, error handling (e.g., invalid task IDs), rate limits, or what happens to unspecified fields (partial vs. full updates). For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action ('update an existing task's details'), making it immediately clear. Every word earns its place, with no redundancy or fluff.

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 the complexity (8 parameters, mutation operation, nested objects) and lack of both annotations and an output schema, the description is insufficient. It doesn't explain return values, error conditions, or behavioral nuances like partial updates. For a tool that modifies tasks with multiple fields, more context is needed to guide 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?

The schema description coverage is 100%, with each parameter well-documented in the schema itself (e.g., 'due_on' specifies YYYY-MM-DD format, 'assignee' explains 'me' or user ID). The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 where the 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 action ('update') and resource ('existing task's details'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'asana_create_task' by specifying it updates existing tasks rather than creating new ones. However, it doesn't explicitly differentiate from other update-related tools like 'asana_set_parent_for_task' which also modifies tasks.

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. It doesn't mention prerequisites (e.g., needing a valid task ID), compare with similar tools like 'asana_create_subtask' or 'asana_set_parent_for_task', or indicate when not to use it (e.g., for bulk updates). The agent must infer usage from the name and schema alone.

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/roychri/mcp-server-asana'

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