Skip to main content
Glama

add_tasks_to_request

Extend existing requests by adding new tasks with subtasks and dependencies, then view updated progress tables in TaskFlow MCP.

Instructions

Add new tasks to an existing request. This allows extending a request with additional tasks.

Tasks can include subtasks and dependencies. A progress table will be displayed showing all tasks including the newly added ones.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
tasksYes

Implementation Reference

  • MCP tool handler function that extracts arguments and delegates to TaskFlowService.addTasksToRequest method.
    async add_tasks_to_request(args: any) {
      const { requestId, tasks } = args ?? {};
      return service.addTasksToRequest(String(requestId), tasks ?? []);
    },
  • JSON Schema definition for the 'add_tasks_to_request' tool input validation, exported as part of jsonSchemas.
    add_tasks_to_request: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        tasks: { type: "array", items: taskInputJson },
      },
      required: ["requestId", "tasks"],
    },
  • Registration of the tool in the MCP server's listTools handler, including ADD_TASKS_TO_REQUEST_TOOL in the tools array.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        PLAN_TASK_TOOL,
        GET_NEXT_TASK_TOOL,
        MARK_TASK_DONE_TOOL,
        OPEN_TASK_DETAILS_TOOL,
        LIST_REQUESTS_TOOL,
        ADD_TASKS_TO_REQUEST_TOOL,
        UPDATE_TASK_TOOL,
        DELETE_TASK_TOOL,
        ADD_SUBTASKS_TOOL,
        MARK_SUBTASK_DONE_TOOL,
        UPDATE_SUBTASK_TOOL,
        DELETE_SUBTASK_TOOL,
        EXPORT_TASK_STATUS_TOOL,
        ADD_NOTE_TOOL,
        UPDATE_NOTE_TOOL,
        DELETE_NOTE_TOOL,
        ADD_DEPENDENCY_TOOL,
        GET_PROMPTS_TOOL,
        SET_PROMPTS_TOOL,
        UPDATE_PROMPTS_TOOL,
        REMOVE_PROMPTS_TOOL,
        ARCHIVE_COMPLETED_REQUESTS_TOOL,
        LIST_ARCHIVED_REQUESTS_TOOL,
        RESTORE_ARCHIVED_REQUEST_TOOL,
      ],
    }));
  • Core service method that implements the logic to add new tasks to an existing request, including ID generation, persistence, and progress table generation.
    public async addTasksToRequest(
      requestId: string,
      tasks: {
        title: string;
        description: string;
        subtasks?: { title: string; description: string }[];
        dependencies?: Dependency[];
      }[]
    ) {
      await this.loadTasks();
      const req = this.getRequest(requestId);
      if (!req) return { status: "error", message: "Request not found" };
      if (req.completed) return { status: "error", message: "Cannot add tasks to completed request" };
    
      const factory = new TaskFactory({ value: this.globalIdCounter });
      const newTasks: Task[] = tasks.map((t) => factory.createTask(t));
      this.globalIdCounter = factory["counterRef"].value;
    
      req.tasks.push(...newTasks);
      await this.saveTasks();
    
      const progressTable = formatTaskProgressTableForRequest(req);
      return {
        status: "tasks_added",
        message: `Added ${newTasks.length} new tasks to request.\n${progressTable}`,
        newTasks: newTasks.map((t) => ({ id: t.id, title: t.title, description: t.description })),
      };
    }
  • Tool object definition including name, description, and inputSchema for 'add_tasks_to_request'.
    export const ADD_TASKS_TO_REQUEST_TOOL: Tool = {
      name: "add_tasks_to_request",
      description:
        "Add new tasks to an existing request. This allows extending a request with additional tasks.\n\n" +
        "Tasks can include subtasks and dependencies. A progress table will be displayed showing all tasks including the newly added ones.",
      inputSchema: {
        type: "object",
        properties: {
          requestId: { type: "string" },
          tasks: {
            type: "array",
            items: {
              type: "object",
              properties: {
                title: { type: "string" },
                description: { type: "string" },
                dependencies: {
                  type: "array",
                  items: {
                    type: "object",
                    properties: {
                      name: { type: "string" },
                      version: { type: "string" },
                      url: { type: "string" },
                      description: { type: "string" },
                    },
                    required: ["name"],
                  },
                },
                subtasks: {
                  type: "array",
                  items: {
                    type: "object",
                    properties: {
                      title: { type: "string" },
                      description: { type: "string" },
                    },
                    required: ["title", "description"],
                  },
                },
              },
              required: ["title", "description"],
            },
          },
        },
        required: ["requestId", "tasks"],
      },
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that 'A progress table will be displayed showing all tasks including the newly added ones,' which adds some behavioral context about output. However, it lacks details on permissions, side effects (e.g., whether this is a mutation), error handling, or rate limits, which are critical for a tool that modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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 additional details in two more sentences. It avoids redundancy and is appropriately sized, though the last sentence about the progress table could be more integrated or omitted if not critical.

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 no annotations, no output schema, and 0% schema description coverage, the description is moderately complete. It covers the tool's purpose and some parameter semantics but lacks behavioral details like mutation effects, error cases, or return values, which are important for a tool that adds tasks to requests.

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

Parameters4/5

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

With 0% schema description coverage for 2 parameters, the description must compensate. It clarifies that 'tasks' can include 'subtasks and dependencies,' providing meaningful context beyond the schema's structural definition. However, it doesn't explain the 'requestId' parameter or provide examples, leaving some gaps in full parameter understanding.

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 ('Add new tasks') and target ('to an existing request'), with the additional context that it 'allows extending a request with additional tasks.' This provides a specific verb+resource combination, though it doesn't explicitly differentiate from sibling tools like 'add_subtasks' or 'add_dependency' beyond the scope of tasks vs. subtasks/dependencies.

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 usage by stating it's for 'extending a request with additional tasks,' which suggests it should be used when you have an existing request and want to add more tasks. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'add_subtasks' or 'update_task,' nor does it mention prerequisites or exclusions.

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/pinkpixel-dev/taskflow-mcp'

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