add_task
Create a new task with a title and optional description to manage your task list in the Task MCP Server.
Instructions
Add a new task to the task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Task title | |
| description | No | Task description (optional) |
Implementation Reference
- src/task_mcp_server/server.py:81-98 (handler)Executes the 'add_task' tool by incrementing a task counter, storing the new task in the global 'tasks' dictionary with title and optional description, and returning a confirmation message.if name == "add_task": task_counter += 1 title = arguments.get("title", "") description = arguments.get("description", "") tasks[task_counter] = { "id": task_counter, "title": title, "description": description, "completed": False } return [ types.TextContent( type="text", text=f"✅ Task added successfully!\nID: {task_counter}\nTitle: {title}" ) ]
- src/task_mcp_server/server.py:21-34 (schema)Defines the input schema for 'add_task' tool: requires 'title' string, optional 'description' string.inputSchema={ "type": "object", "properties": { "title": { "type": "string", "description": "Task title" }, "description": { "type": "string", "description": "Task description (optional)" } }, "required": ["title"] }
- src/task_mcp_server/server.py:18-35 (registration)Registers the 'add_task' tool in the list_tools handler with its name, description, and input schema.types.Tool( name="add_task", description="Add a new task to the task list", inputSchema={ "type": "object", "properties": { "title": { "type": "string", "description": "Task title" }, "description": { "type": "string", "description": "Task description (optional)" } }, "required": ["title"] } ),