Skip to main content
Glama

taskCreate

Create structured tasks with multiple steps, including titles, descriptions, priorities, due dates, and tags for organized project management.

Instructions

創建新的任務,可以包含多個步驟

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionYes
stepsYes
tagsNo
dueDateNo
priorityNo

Implementation Reference

  • Core handler function that implements the task creation logic: validates inputs, generates UUIDs for task and steps, reads existing tasks from JSON, appends new task, and persists back to file.
    public static async createTask(
      title: string,
      description: string,
      steps: Omit<TaskStep, 'id'>[],
      tags: string[] = [],
      dueDate?: string,
      plannedStartDate?: string,
      priority: number = 3
    ): Promise<Task> {
      if (!title || !description) {
        throw new Error('任務標題和描述不能為空');
      }
    
      if (priority < 1 || priority > 5) {
        throw new Error('任務優先級必須在1到5之間');
      }
    
      // 獲取現有任務
      const tasks = await this.readTasks();
    
      // 創建新任務
      const now = new Date().toISOString();
      const taskSteps = steps.map((step, index) => ({
        ...step,
        id: uuidv4(),
        order: step.order !== undefined ? step.order : index + 1,
        completed: step.completed !== undefined ? step.completed : false
      }));
    
      const newTask: Task = {
        id: uuidv4(),
        title,
        description,
        steps: taskSteps,
        tags,
        createdAt: now,
        plannedStartDate,
        updatedAt: now,
        status: TaskStatus.PENDING,
        priority
      };
    
      // 添加新任務
      tasks.push(newTask);
    
      // 保存所有任務
      await this.writeTasks(tasks);
    
      return newTask;
    }
  • Zod schema defining the input parameters for the taskCreate tool.
        title: z.string(),
        description: z.string(),
        steps: z.array(z.object({
            description: z.string(),
            order: z.number().optional(),
            completed: z.boolean().optional(),
            estimatedTime: z.number().optional()
        })),
        tags: z.array(z.string()).optional(),
        dueDate: z.string().optional(),
        priority: z.number().optional()
    },
  • main.ts:565-600 (registration)
    MCP server registration of the 'taskCreate' tool, including description, schema, and thin wrapper handler that delegates to TaskManagerTool.createTask.
    server.tool("taskCreate",
        "創建新的任務,可以包含多個步驟",
        {
            title: z.string(),
            description: z.string(),
            steps: z.array(z.object({
                description: z.string(),
                order: z.number().optional(),
                completed: z.boolean().optional(),
                estimatedTime: z.number().optional()
            })),
            tags: z.array(z.string()).optional(),
            dueDate: z.string().optional(),
            priority: z.number().optional()
        },
        async ({ title, description, steps, tags = [], dueDate, priority = 3 }) => {
            try {
                const newTask = await TaskManagerTool.createTask(
                    title,
                    description,
                    steps,
                    tags,
                    dueDate,
                    String(priority)
                );
    
                return {
                    content: [{ type: "text", text: `任務創建成功:\n${JSON.stringify(newTask, null, 2)}` }]
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `創建任務失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }]
                };
            }
        }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While '創建' implies a write/mutation operation, the description doesn't address permissions, side effects, error conditions, or what happens on success. For a creation tool with 6 parameters and no annotation coverage, this leaves significant behavioral questions unanswered.

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 extremely concise - just 8 Chinese characters plus punctuation. It's front-loaded with the core purpose and adds one clarifying detail about steps. Every word earns its place with zero waste or redundancy.

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 creation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what gets created, what the response looks like, error conditions, or parameter semantics. While concise, it leaves too many contextual gaps for effective tool selection and invocation.

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

Parameters2/5

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

With 0% schema description coverage and 6 parameters (3 required), the description provides no parameter information beyond the generic mention of '可以包含多個步驟' (can contain multiple steps). This only hints at the 'steps' parameter but doesn't explain any of the other 5 parameters (title, description, tags, dueDate, priority) or their formats/constraints.

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 verb ('創建' meaning 'create') and resource ('任務' meaning 'task'), making the purpose immediately understandable. It also adds useful context about supporting multiple steps, which distinguishes it from simpler creation tools. However, it doesn't explicitly differentiate from sibling tools like 'taskUpdate' or 'taskStepAdd'.

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 about when to use this tool versus alternatives. With multiple sibling task-related tools (taskUpdate, taskDelete, taskStepAdd, etc.), there's no indication of when this creation tool is appropriate versus when to modify existing tasks or use other task operations.

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/GonTwVn/GonMCPtool'

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