Skip to main content
Glama

add_tasks_to_request

Extend existing requests by adding new tasks to them, then view all tasks including the newly added ones in a progress table.

Instructions

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

A progress table will be displayed showing all tasks including the newly added ones.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
tasksYes

Implementation Reference

  • The core handler function that implements the logic for adding new tasks to an existing request. It finds the request, generates new task IDs, adds the tasks, resets completion status, saves data, and returns a progress table.
    public async addTasksToRequest(
      requestId: string,
      tasks: { title: string; description: string }[]
    ) {
      const request = this.data.requests.find((r) => r.requestId === requestId);
      if (!request) {
        throw new Error("Request not found");
      }
    
      const newTasks: Task[] = tasks.map((t) => {
        this.taskCounter++;
        return {
          id: `task-${this.taskCounter}`,
          title: t.title,
          description: t.description,
          done: false,
          approved: false,
          completedDetails: "",
        };
      });
    
      request.tasks.push(...newTasks);
      request.completed = false; // Reset completion since new tasks were added
    
      await this.saveTasks();
    
      return {
        message:
          "Tasks added to request.\n" + this.formatTaskProgressTable(requestId),
      };
    }
  • Zod schema defining the input parameters for the add_tasks_to_request tool: requestId (string) and tasks array of {title, description}.
    const AddTasksToRequestSchema = z.object({
      requestId: z.string(),
      tasks: z.array(
        z.object({
          title: z.string(),
          description: z.string(),
        })
      ),
    });
  • index.ts:180-184 (registration)
    Tool registration object returned by listTools() method, specifying name, description, and input schema.
    {
      name: "add_tasks_to_request",
      description: "Add new tasks to an existing request.",
      inputSchema: AddTasksToRequestSchema,
    },
  • Dispatch handler in callTool() switch statement that parses input parameters using the schema and delegates to the main addTasksToRequest method.
    case "add_tasks_to_request": {
      const parsed = AddTasksToRequestSchema.safeParse(parameters);
      if (!parsed.success) {
        throw new Error(`Invalid parameters: ${parsed.error}`);
      }
      return this.addTasksToRequest(parsed.data.requestId, parsed.data.tasks);
    }
Behavior2/5

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

With no annotations, the description carries full burden but lacks critical behavioral details. It mentions a progress table will be displayed, hinting at output behavior, but doesn't cover permissions, side effects (e.g., if tasks are immediately active), error handling, or rate limits. The description adds some context but is insufficient 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 a clarifying second sentence about the progress table. Both sentences earn their place by adding value, with no wasted words or redundancy.

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 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is moderately complete. It covers the basic action and hints at output behavior but lacks details on parameters, error cases, or integration with sibling tools, leaving gaps for a mutation operation.

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 0%, so the description must compensate. It implies 'requestId' identifies an existing request and 'tasks' are new tasks to add, but doesn't explain format, constraints, or examples (e.g., what a task object entails beyond title/description). Baseline is 3 as it adds minimal meaning beyond the schema's structure.

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 ('add new tasks') and resource ('to an existing request'), specifying it extends a request with additional tasks. It distinguishes from siblings like 'update_task' or 'delete_task' by focusing on adding rather than modifying or removing, though it doesn't explicitly compare to all siblings.

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 for extending an existing request with tasks, but doesn't specify when to use this versus alternatives like 'request_planning' (which might create new requests) or 'update_task' (for modifying existing tasks). No explicit when-not or prerequisite guidance is provided.

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/Rudra-ravi/mcp-taskmanager'

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