Skip to main content
Glama

task_create

Create tasks within project epics to organize work units with details like priority, assignee, due dates, and dependencies in a structured project tracker.

Instructions

Create a task within an epic. Tasks are the primary unit of work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
epic_idYesParent epic ID
titleYesTask title
descriptionNoTask description
statusNotodo
priorityNomedium
assigned_toNoAssignee name
estimated_hoursNoEstimated hours
due_dateNoDue date (YYYY-MM-DD)
source_refNoLink to source code location
depends_onNoTask IDs this task depends on
tagsNo

Implementation Reference

  • The function `handleTaskCreate` which implements the logic for the `task_create` tool.
    function handleTaskCreate(args: Record<string, unknown>) {
      const db = getDb();
      const epicId = args.epic_id as number;
      const title = args.title as string;
      const description = (args.description as string) ?? null;
      const status = (args.status as string) ?? 'todo';
      const priority = (args.priority as string) ?? 'medium';
      const assignedTo = (args.assigned_to as string) ?? null;
      const estimatedHours = (args.estimated_hours as number) ?? null;
      const dueDate = (args.due_date as string) ?? null;
      const sourceRef = args.source_ref ? JSON.stringify(args.source_ref) : null;
      const tags = JSON.stringify((args.tags as string[]) ?? []);
      const dependsOn = (args.depends_on as number[]) ?? [];
    
      const task = db
        .prepare(
          `INSERT INTO tasks (epic_id, title, description, status, priority, assigned_to, estimated_hours, due_date, source_ref, tags)
           VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`
        )
        .get(epicId, title, description, status, priority, assignedTo, estimatedHours, dueDate, sourceRef, tags);
    
      const row = task as Record<string, unknown>;
      const taskId = row.id as number;
      logActivity(db, 'task', taskId, 'created', null, null, null, `Task '${title}' created`);
    
      if (dependsOn.length > 0) {
        setDependencies(db, taskId, dependsOn);
        evaluateAndUpdateDependencies(db, taskId);
        // Re-fetch to get potentially updated status
        return db.prepare('SELECT * FROM tasks WHERE id = ?').get(taskId);
      }
    
      return task;
    }
  • The MCP tool definition for `task_create` including the input schema.
    export const definitions: Tool[] = [
      {
        name: 'task_create',
        description: 'Create a task within an epic. Tasks are the primary unit of work.',
        annotations: { title: 'Create Task', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
        inputSchema: {
          type: 'object',
          properties: {
            epic_id: { type: 'integer', description: 'Parent epic ID' },
            title: { type: 'string', description: 'Task title' },
            description: { type: 'string', description: 'Task description' },
            status: {
              type: 'string',
              enum: ['todo', 'in_progress', 'review', 'done', 'blocked'],
              default: 'todo',
            },
            priority: {
              type: 'string',
              enum: ['low', 'medium', 'high', 'critical'],
              default: 'medium',
            },
            assigned_to: { type: 'string', description: 'Assignee name' },
            estimated_hours: { type: 'number', description: 'Estimated hours' },
            due_date: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
            source_ref: {
              type: 'object',
              description: 'Link to source code location',
              properties: {
                file: { type: 'string', description: 'File path' },
                line_start: { type: 'integer', description: 'Start line number' },
                line_end: { type: 'integer', description: 'End line number' },
                repo: { type: 'string', description: 'Repository URL or name' },
                commit: { type: 'string', description: 'Commit hash' },
              },
              required: ['file'],
            },
            depends_on: { type: 'array', items: { type: 'integer' }, description: 'Task IDs this task depends on' },
            tags: { type: 'array', items: { type: 'string' } },
          },
          required: ['epic_id', 'title'],
        },
      },
  • Registration of the `task_create` tool handler.
    export const handlers: Record<string, ToolHandler> = {
      task_create: handleTaskCreate,
      task_list: handleTaskList,
      task_get: handleTaskGet,
      task_update: handleTaskUpdate,
    };
Behavior3/5

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

Annotations already indicate this is a write operation (readOnlyHint: false) with no destructive/idempotent/open-world hints. The description adds minimal behavioral context beyond annotations—it doesn't mention permissions needed, side effects, or what happens on duplicate creation. However, it doesn't contradict annotations, so it meets the lower bar with annotations present.

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—two short sentences that are front-loaded with the core purpose. Every word earns its place, with no redundant or verbose phrasing, making it efficient for an AI agent to parse.

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 11 parameters (including complex nested objects), no output schema, and incomplete schema coverage (73%), the description is inadequate. It lacks information on return values, error conditions, or how the tool integrates with the broader system (e.g., relationship to epics/tasks). The simplicity of the description doesn't match the tool's complexity.

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 73%, providing good documentation for most parameters. The description adds no parameter-specific information beyond what's in the schema, but with high coverage, the baseline is 3. It doesn't compensate for gaps like the undocumented 'tags' parameter or clarify complex nested structures like 'source_ref'.

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 ('Create a task') and resource ('within an epic'), and provides context that 'Tasks are the primary unit of work.' It distinguishes from siblings like 'subtask_create' by specifying epic-level tasks, but doesn't explicitly contrast with other task-related tools like 'task_update' or 'task_batch_update'.

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?

No guidance is provided on when to use this tool versus alternatives like 'subtask_create' (for subtasks within tasks) or 'task_update' (for modifying existing tasks). The description mentions the epic context but doesn't explain prerequisites, exclusions, or typical use cases beyond the basic action.

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/spranab/saga-mcp'

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