Skip to main content
Glama

subtask_update

Idempotent

Modify subtask details including title, status, or order in project tracking systems to maintain accurate task management and progress monitoring.

Instructions

Update a subtask title, status, or sort order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSubtask ID
titleNo
statusNo
sort_orderNo

Implementation Reference

  • The handleSubtaskUpdate function implements the business logic for updating a subtask, including input validation, database execution, and logging activity.
    function handleSubtaskUpdate(args: Record<string, unknown>) {
      const db = getDb();
      const id = args.id as number;
    
      const oldRow = db.prepare('SELECT * FROM subtasks WHERE id = ?').get(id) as Record<string, unknown> | undefined;
      if (!oldRow) throw new Error(`Subtask ${id} not found`);
    
      const updates: string[] = [];
      const params: unknown[] = [];
    
      if (args.title !== undefined) {
        updates.push('title = ?');
        params.push(args.title);
      }
      if (args.status !== undefined) {
        updates.push('status = ?');
        params.push(args.status);
      }
      if (args.sort_order !== undefined) {
        updates.push('sort_order = ?');
        params.push(args.sort_order);
      }
    
      if (updates.length === 0) throw new Error('No fields to update');
    
      updates.push("updated_at = datetime('now')");
      params.push(id);
    
      const newRow = db
        .prepare(`UPDATE subtasks SET ${updates.join(', ')} WHERE id = ? RETURNING *`)
        .get(...params) as Record<string, unknown>;
    
      if (oldRow.status !== newRow.status) {
        logActivity(
          db, 'subtask', id, 'status_changed', 'status',
          oldRow.status as string, newRow.status as string,
          `Subtask '${newRow.title}' status: ${oldRow.status} -> ${newRow.status}`
        );
      }
    
      return newRow;
    }
  • The schema definition for the 'subtask_update' tool.
    {
      name: 'subtask_update',
      description: 'Update a subtask title, status, or sort order.',
      annotations: { title: 'Update Subtask', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'integer', description: 'Subtask ID' },
          title: { type: 'string' },
          status: { type: 'string', enum: ['todo', 'in_progress', 'done'] },
          sort_order: { type: 'integer' },
        },
        required: ['id'],
      },
    },
  • Registration map linking tool names to their respective handler functions.
    export const handlers: Record<string, ToolHandler> = {
      subtask_create: handleSubtaskCreate,
      subtask_update: handleSubtaskUpdate,
      subtask_delete: handleSubtaskDelete,
    };
Behavior3/5

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

Annotations provide key behavioral hints (readOnlyHint=false, destructiveHint=false, idempotentHint=true), which the description doesn't repeat. The description adds that it updates specific fields, which is useful context beyond annotations. However, it lacks details on permissions, side effects, or error handling, leaving some behavioral aspects unclear.

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 a single, efficient sentence with no wasted words. It front-loads the core action and lists modifiable attributes clearly, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's function.

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

Completeness3/5

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

Given the tool's complexity (mutation with 4 parameters, no output schema) and annotations covering safety aspects, the description is minimally adequate. It specifies what can be updated but lacks details on return values, error conditions, or dependencies, leaving room for improvement in completeness for effective agent use.

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 low at 25%, with only the 'id' parameter documented. The description mentions 'title, status, or sort order', which aligns with three of the four parameters, adding some semantic value. However, it doesn't explain the 'status' enum values or provide format details, so it partially compensates but doesn't fully bridge the coverage gap.

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 ('Update') and resource ('subtask') along with specific attributes that can be modified ('title, status, or sort order'). It distinguishes from sibling tools like 'subtask_create' and 'subtask_delete' by focusing on updates, though it doesn't explicitly differentiate from 'task_update' or other update tools in the context.

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. It doesn't mention prerequisites (e.g., needing an existing subtask ID), exclusions, or comparisons with similar tools like 'task_update' or 'subtask_create'. The description only states what it does, not when to apply it.

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