Skip to main content
Glama

subtask_create

Create subtasks for a parent task by providing one or multiple titles in a single request.

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

  • Handler function that creates one or more subtasks. Accepts a task_id and titles (single string or array). Uses a DB transaction to insert each subtask and logs activity via logActivity. Returns single object or array depending on input count.
    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;
    }
  • Tool definition with input schema requiring task_id (integer) and titles (string or string array).
    {
      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'],
      },
    },
  • Exports the handlers record mapping tool name 'subtask_create' to handleSubtaskCreate function.
    export const handlers: Record<string, ToolHandler> = {
      subtask_create: handleSubtaskCreate,
      subtask_update: handleSubtaskUpdate,
      subtask_delete: handleSubtaskDelete,
    };
  • src/index.ts:37-49 (registration)
    Registration of all handlers including subtaskHandlers into the ALL_HANDLERS record used by the server.
    const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = {
      ...projectHandlers,
      ...epicHandlers,
      ...taskHandlers,
      ...subtaskHandlers,
      ...noteHandlers,
      ...commentHandlers,
      ...templateHandlers,
      ...dashboardHandlers,
      ...searchHandlers,
      ...activityHandlers,
      ...exportImportHandlers,
    };
  • src/index.ts:23-35 (registration)
    Registration of all tool definitions including subtaskDefs into the ALL_TOOLS array.
    const ALL_TOOLS: Tool[] = [
      ...projectDefs,
      ...epicDefs,
      ...taskDefs,
      ...subtaskDefs,
      ...noteDefs,
      ...commentDefs,
      ...templateDefs,
      ...dashboardDefs,
      ...searchDefs,
      ...activityDefs,
      ...exportImportDefs,
    ];
Behavior3/5

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

Annotations already indicate a write operation (readOnlyHint=false) and non-destructive nature. Description adds minimal extra behavioral context beyond the obvious creation action.

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?

Two sentences with no redundancy: the first states purpose, the second clarifies input format. Efficiently front-loaded.

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

Completeness4/5

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

For a simple creation tool, the description covers the essential behavior. Missing return value details but not critical given no output schema and straightforward 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?

Input schema has basic descriptions for task_id and titles. The tool description reiterates the batch capability but adds no additional constraints or format details. Schema coverage is 50%, but the description partially compensates.

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

Purpose5/5

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

Description clearly states the tool creates subtasks (checklist items) for a task, specifying both single and batch creation. This distinguishes it from sibling tools like subtask_delete and subtask_update.

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

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for creation, and sibling names make it clear when to use alternatives (delete, update). However, it lacks explicit 'when not to use' or prerequisites.

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