Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_set_parent_for_task

Assign a parent task to organize subtasks and control their order within Asana projects for better project hierarchy management.

Instructions

Set the parent of a task and position the subtask within the other subtasks of that parent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
task_idYesThe task ID to operate on
optsNo

Implementation Reference

  • Core implementation of the tool logic: calls Asana SDK's TasksApi.setParentForTask to set the parent task.
    async setParentForTask(data: any, taskId: string, opts: any = {}) {
      const response = await this.tasks.setParentForTask({ data }, taskId, opts);
      return response.data;
    }
  • Tool dispatch handler: parses JSON strings for data/opts and calls AsanaClientWrapper.setParentForTask.
    case "asana_set_parent_for_task": {
      let { data, task_id, opts } = args;
      if ( typeof data == "string" ) {
        data = JSON.parse( data );
      }
      if ( typeof opts == "string" ) {
        opts = JSON.parse( opts );
      }
      const response = await asanaClient.setParentForTask(data, task_id, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Input schema defining parameters: data (parent, insert_after/before), task_id, opts.
    export const setParentForTaskTool: Tool = {
      name: "asana_set_parent_for_task",
      description: "Set the parent of a task and position the subtask within the other subtasks of that parent",
      inputSchema: {
        type: "object",
        properties: {
          data: {
            parent: {
              type: "string",
              description: "The GID of the new parent of the task, or null for no parent",
              required: true
            },
            insert_after: {
              type: "string",
              description: "A subtask of the parent to insert the task after, or null to insert at the beginning of the list. Cannot be used with insert_before. The task must already be set as a subtask of that parent."
            },
            insert_before: {
              type: "string",
              description: "A subtask of the parent to insert the task before, or null to insert at the end of the list. Cannot be used with insert_after. The task must already be set as a subtask of that parent."
            },
          },
          task_id: {
            type: "string",
            description: "The task ID to operate on"
          },
          opts: {
            opt_fields: {
              type: "string",
              description: "Comma-separated list of optional fields to include"
            }
          }
        },
        required: ["task_id", "data"]
      }
    };
  • Tool registration: added to the exported tools array used by MCP.
    setParentForTaskTool,
  • Import of the setParentForTaskTool from task-relationship-tools.ts.
    import {
      addTaskDependenciesTool,
      addTaskDependentsTool,
      setParentForTaskTool,
      addFollowersToTaskTool
    } from './tools/task-relationship-tools.js';

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It does mention the positioning behavior, which is beyond the name, but it omits side effects (e.g., removal from old parent), prerequisites, or auth requirements. For a mutation tool, this is only a partial disclosure.

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, front-loaded sentence with no wasted words. It efficiently conveys the core action and the additional positioning behavior.

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?

The description is too brief for a mutation tool with no annotations and no output schema. It does not state what the tool returns, potential errors, or prerequisites. The positioning detail is helpful but does not make the description complete.

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

Parameters2/5

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

Schema coverage is low (33%) and the description does not compensate. It mentions 'position' and 'parent' but does not explain how to use insert_after/insert_before or null values. The schema provides some details, but the description adds no parameter-level meaning.

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 uses a specific verb ('Set') and clearly identifies the resource ('parent of a task') plus the additional behavior of positioning the subtask among siblings. This distinguishes it from related tools like create_subtask or update_task, which handle different operations.

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

Usage Guidelines3/5

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

The description implies the tool is for re-parenting tasks and controlling their order, but it does not explicitly state when to use this versus alternatives or provide exclusions. The usage context is inferred rather than explicitly guided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.