Skip to main content
Glama

subtask_update

Idempotent

Update a subtask's title, status, or sort order to maintain task hierarchy in project tracking.

Instructions

Update a subtask title, status, or sort order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSubtask ID
titleNo
statusNo
sort_orderNo

Implementation Reference

  • Handler function that executes subtask update logic: fetches current subtask, builds dynamic UPDATE query for title/status/sort_order, logs status changes, and returns updated row.
    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;
    }
  • Input schema definition for subtask_update tool, defining properties id (required), title, status (enum), and sort_order.
    {
      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 mapping the tool name 'subtask_update' to the handleSubtaskUpdate handler function.
    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 already provide idempotentHint=true (safe to retry) and destructiveHint=false. The description adds that it updates specific fields but does not clarify that it performs a partial update (only modifies provided fields). No contradiction with annotations.

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, front-loaded sentence with no wasted words. Every word earns its place, making it highly concise and easy to parse.

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?

For a simple tool with 4 parameters and no output schema, the description is adequate but lacks details like whether the update is partial, what the return value is, or that idempotentHint=true implies safe retries. It does not fully exploit the opportunity to add context beyond structured fields.

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 (25%). The description lists the updatable fields (title, status, sort_order) but adds no detail beyond the schema's enum for status. For title and sort_order, no constraints or formats are mentioned, so it provides marginal additional value.

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?

The description 'Update a subtask title, status, or sort order' clearly states the action (update), the specific resource (subtask), and which fields are updatable. It distinguishes itself from sibling tools like subtask_create and subtask_delete.

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 when to use the tool (when updating a subtask's title, status, or sort order) but does not explicitly mention when not to use it or provide alternatives. The context is clear enough for a straightforward update tool.

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