Skip to main content
Glama

create_task

Create new tasks with unique IDs, descriptions, and dependency tracking for coordinated workflow management.

Instructions

Create a new task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier for the task
descriptionYesDescription of the task
dependenciesNoIDs of tasks that must be completed first

Implementation Reference

  • The core handler logic for the 'create_task' tool. It extracts arguments, checks if task ID exists, validates dependencies exist, creates a new pending Task, saves to persistent storage, and returns the task as JSON text.
    case "create_task": {
      const { id, description, dependencies } = request.params.arguments as {
        id: string;
        description: string;
        dependencies?: string[];
      };
    
      debug(`Creating task ${id}: ${description}`);
    
      if (tasks[id]) {
        throw new McpError(ErrorCode.InvalidRequest, `Task ${id} already exists`);
      }
    
      // Verify dependencies exist
      if (dependencies) {
        for (const depId of dependencies) {
          if (!tasks[depId]) {
            throw new McpError(ErrorCode.InvalidRequest, `Dependency task ${depId} not found`);
          }
        }
      }
    
      const task: Task = {
        id,
        description,
        status: 'pending',
        dependencies
      };
    
      tasks[id] = task;
      saveTasks();
      debug(`Created task ${id}`);
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(task, null, 2)
        }]
      };
    }
  • The input schema and metadata for the 'create_task' tool, defined in the ListToolsRequestSchema response. Specifies required id and description, optional dependencies array.
    {
      name: "create_task",
      description: "Create a new task",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "Unique identifier for the task"
          },
          description: {
            type: "string",
            description: "Description of the task"
          },
          dependencies: {
            type: "array",
            items: {
              type: "string"
            },
            description: "IDs of tasks that must be completed first"
          }
        },
        required: ["id", "description"]
      }
    },
  • TypeScript interface defining the structure of a Task object used throughout the task management tools, including create_task.
    interface Task {
      id: string;
      description: string;
      status: 'pending' | 'in_progress' | 'completed';
      assignedTo?: string;
      result?: string;
      dependencies?: string[];
    }
  • Helper function to persist the tasks object to tasks.json file. Called after creating, updating, or completing tasks to ensure durability.
    function saveTasks() {
      try {
        // Create data directory if it doesn't exist
        const dataDir = dirname(TASKS_FILE);
        if (!existsSync(dataDir)) {
          const { mkdirSync } = require('fs');
          mkdirSync(dataDir, { recursive: true });
        }
        writeFileSync(TASKS_FILE, JSON.stringify(tasks, null, 2));
        debug('Saved tasks to file');
      } catch (error) {
        console.error('Error saving tasks:', error);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create a new task' implies a write/mutation operation but doesn't specify permissions needed, whether creation is idempotent, what happens on duplicate IDs, or what the response contains. For a mutation tool with zero annotation coverage, this leaves critical behavioral aspects undocumented.

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 maximally concise with a single three-word sentence that directly states the action. There's zero wasted language or unnecessary elaboration. While this conciseness comes at the cost of completeness, the description is perfectly structured for its limited content.

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 3 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after creation, what validation occurs, or how to interpret results. The agent lacks sufficient context to understand the tool's behavior and outcomes beyond the basic creation action.

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%, with all three parameters well-documented in the schema. The description adds no parameter information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a new task' is a tautology that restates the tool name without adding specificity. It doesn't distinguish this tool from sibling tools like 'update_task' or 'complete_task' beyond the basic verb. While the verb 'create' is clear, the description lacks detail about what constitutes a 'task' in this context or what resources are involved.

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

Usage Guidelines1/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 'complete_task'. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent must infer usage entirely from the tool name and schema, which is insufficient for effective 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/mokafari/orchestrator-server'

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