Skip to main content
Glama

add_task_tool

Create a new task with a title and optional description to organize your workflow using the Tasks MCP Server.

Instructions

Add a new task. Args: title (str): The title of the task. description (str): The description of the task. optional value.

Returns: Task: The newly created task object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
titleYesThe title of the task
statusNo
created_atNo
descriptionNoThe description of the task

Implementation Reference

  • The async handler function implementing the 'add_task_tool' logic: retrieves database from context, adds task with title and optional description (normalized to empty string if None), and returns the created Task instance.
    @mcp.tool()
    async def add_task_tool(
        ctx: Context[ServerSession, AppContext],
        title: str,
        description: str | None = None,
    ) -> Task:
        """Add a new task.
        Args:
            title (str): The title of the task.
            description (str): The description of the task. optional value.
    
        Returns:
            Task: The newly created task object.
        """
        database: DatabaseABC = ctx.request_context.lifespan_context.db
        # Normalize None to empty string for storage compatibility
        task = database.add_task(title=title, description=description or "")
        return Task(**task.__dict__)
  • Pydantic BaseModel defining the Task structure, used as the return type for add_task_tool and for serializing database task objects.
    class Task(BaseModel):
        id: int = Field(default=None)
        title: str = Field(..., description="The title of the task")
        description: str = Field(default="", description="The description of the task")
        status: TaskStatus = TaskStatus.CREATED
        created_at: str = Field(default=None)
  • Invocation of create_tasks_tools(mcp) within the MCP server creation, which defines and registers the add_task_tool (via @mcp.tool() decorator inside create_tasks_tools) along with other task tools.
    create_tasks_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Add a new task', implying a write operation, but doesn't mention permissions, side effects, error conditions, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency, as critical behavioral traits are left unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized, with a clear purpose statement followed by parameter and return sections. Every sentence adds value, such as specifying optionality for 'description'. Minor improvements could include integrating the parameter details more seamlessly, but overall it's efficient and front-loaded.

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 the tool's complexity (a write operation with 2 parameters), no annotations, and an output schema present (which covers return values), the description is moderately complete. It explains the action and parameters but lacks behavioral context like error handling or permissions. The output schema reduces the need to describe returns, but more guidance on usage and transparency would enhance completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'title' is required and 'description' is optional, clarifying parameter roles that aren't evident from the schema alone. However, it doesn't detail constraints like length limits or content rules, preventing a perfect score.

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 action ('Add a new task') and resource ('task'), making the purpose immediately understandable. It distinguishes itself from siblings like 'delete_task_tool' or 'update_task_tool' by specifying creation rather than modification or deletion. However, it doesn't explicitly differentiate from other task-related tools beyond the verb, keeping it at a 4 rather than a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_task_tool' or 'tasks_list_tool'. It lacks context about prerequisites, such as whether a task list must exist first, or exclusions, like when not to use it. This absence of usage context leaves the agent without clear direction for tool selection.

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/chipocrudos/tasks-mcp'

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