Skip to main content
Glama

subtask_create

Add checklist items to tasks in Saga MCP's project tracker. Create single or multiple subtasks to organize work and track progress within structured projects.

Instructions

Create one or more subtasks (checklist items) for a task. Accepts a single title string or an array of title strings for batch creation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesParent task ID
titlesYes

Implementation Reference

  • The handler function `handleSubtaskCreate` executes the logic for creating subtasks in the database.
    function handleSubtaskCreate(args: Record<string, unknown>) {
      const db = getDb();
      const taskId = args.task_id as number;
      const rawTitles = args.titles;
      const titles = Array.isArray(rawTitles) ? rawTitles as string[] : [rawTitles as string];
    
      const stmt = db.prepare(
        'INSERT INTO subtasks (task_id, title) VALUES (?, ?) RETURNING *'
      );
    
      const created = db.transaction(() => {
        return titles.map((title) => {
          const subtask = stmt.get(taskId, title) as Record<string, unknown>;
          logActivity(db, 'subtask', subtask.id as number, 'created', null, null, null, `Subtask '${title}' created`);
          return subtask;
        });
      })();
    
      return created.length === 1 ? created[0] : created;
    }
  • The tool definition for `subtask_create` including its input schema and description.
    export const definitions: Tool[] = [
      {
        name: 'subtask_create',
        description:
          'Create one or more subtasks (checklist items) for a task. Accepts a single title string or an array of title strings for batch creation.',
        annotations: { title: 'Create Subtask(s)', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
        inputSchema: {
          type: 'object',
          properties: {
            task_id: { type: 'integer', description: 'Parent task ID' },
            titles: {
              oneOf: [
                { type: 'string', description: 'Single subtask title' },
                { type: 'array', items: { type: 'string' }, description: 'Multiple subtask titles' },
              ],
            },
          },
          required: ['task_id', 'titles'],
        },
      },
  • The `handlers` object maps the tool name `subtask_create` to its implementation function `handleSubtaskCreate`.
    export const handlers: Record<string, ToolHandler> = {
      subtask_create: handleSubtaskCreate,
      subtask_update: handleSubtaskUpdate,
      subtask_delete: handleSubtaskDelete,
    };

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