Skip to main content
Glama

add_tasks_to_request

Extend an existing request by adding new tasks, enabling task expansion and progress tracking through a displayed table for all tasks.

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 adds new tasks to an existing request. It generates unique task IDs, appends the tasks to the request's task list, resets the request completion status, persists the data, and returns a formatted 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 structure for the tool: a requestId (string) and an array of tasks, each with title and description (strings). Used for validation in both registration and dispatch.
    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 entry in the listTools() method, providing the tool's name, description, and input schema to the MCP server.
    { name: "add_tasks_to_request", description: "Add new tasks to an existing request.", inputSchema: AddTasksToRequestSchema, },
  • Dispatch handler in the callTool switch statement that validates input 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); }

Other Tools

Related 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