Skip to main content
Glama

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
NameRequiredDescriptionDefault
titleYesTask title
descriptionNoTask description (optional)

Implementation Reference

  • 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}"
            )
        ]
  • 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"]
    }
  • 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"]
        }
    ),
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/gvbigdata/MCP-Github-Deployment'

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