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); }

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