Skip to main content
Glama
aaronfeingold

MCP Project Context Server

Add Task

add_task

Create a new task in your project by specifying title, priority, and optional details like description and tags.

Instructions

Add a new task to the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
titleYesTask title
descriptionNoTask description
priorityYesTask priority
tagsNoTask tags

Implementation Reference

  • The handler function for the MCP 'add_task' tool. It takes input parameters, calls the ContextManager's addTask method, and returns a formatted response or error message.
    async ({ projectId, title, description, priority, tags }) => {
      try {
        const task = await this.contextManager.addTask(projectId, {
          title,
          description: description || "",
          status: "todo",
          priority,
          tags: tags || [],
          blockers: [],
          dependencies: [],
        });
        return {
          content: [
            {
              type: "text",
              text: `Task "${task.title}" added with ID: ${task.id}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error adding task: ${
                error instanceof Error ? error.message : "Unknown error"
              }`,
            },
          ],
        };
      }
    }
  • Zod input schema defining parameters for the 'add_task' tool: projectId, title, optional description, priority, and tags.
    {
      title: "Add Task",
      description: "Add a new task to the project",
      inputSchema: {
        projectId: z.string().describe("Project ID"),
        title: z.string().describe("Task title"),
        description: z.string().optional().describe("Task description"),
        priority: z
          .enum(["low", "medium", "high", "critical"])
          .describe("Task priority"),
        tags: z.array(z.string()).default([]).describe("Task tags"),
      },
    },
  • src/server.ts:174-220 (registration)
    Registration of the 'add_task' tool with the MCP server, including name, schema, and handler reference.
      "add_task",
      {
        title: "Add Task",
        description: "Add a new task to the project",
        inputSchema: {
          projectId: z.string().describe("Project ID"),
          title: z.string().describe("Task title"),
          description: z.string().optional().describe("Task description"),
          priority: z
            .enum(["low", "medium", "high", "critical"])
            .describe("Task priority"),
          tags: z.array(z.string()).default([]).describe("Task tags"),
        },
      },
      async ({ projectId, title, description, priority, tags }) => {
        try {
          const task = await this.contextManager.addTask(projectId, {
            title,
            description: description || "",
            status: "todo",
            priority,
            tags: tags || [],
            blockers: [],
            dependencies: [],
          });
          return {
            content: [
              {
                type: "text",
                text: `Task "${task.title}" added with ID: ${task.id}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error adding task: ${
                  error instanceof Error ? error.message : "Unknown error"
                }`,
              },
            ],
          };
        }
      }
    );
  • Helper method in ContextManager that implements the core logic for adding a task: fetches project, creates task with UUID and timestamps, appends to tasks array, and persists via store.
    async addTask(
      projectId: string,
      taskData: Omit<Task, "id" | "createdAt" | "updatedAt">
    ): Promise<Task> {
      const project = await this.store.getProject(projectId);
      if (!project) {
        throw new Error("Project not found");
      }
    
      const now = new Date().toISOString();
      const task: Task = {
        ...taskData,
        id: uuidv4(),
        createdAt: now,
        updatedAt: now,
      };
    
      project.tasks.push(task);
      await this.store.updateProject(project);
    
      return task;
    }
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 this is an 'Add' operation, implying a write/mutation, but doesn't address permissions, side effects, error conditions, or what happens on success (e.g., returns a task ID). For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, error handling, authentication requirements, or how it differs from sibling tools. The combination of write operation complexity and lack of structured metadata requires more descriptive context than provided.

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

Parameters3/5

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

Schema description coverage is 100%, providing clear documentation for all 5 parameters including types, required status, enums for priority, and defaults for tags. The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline for high schema coverage without compensating with extra semantic context.

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') and resource ('new task to the project'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_task' or 'create_project', which would require more specific language about what makes this tool unique for task creation versus project creation or task modification.

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' or 'create_project'. There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage based solely on the tool name and basic purpose.

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/aaronfeingold/mcp-project-context'

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