Skip to main content
Glama

comment_add

Add a comment to a task to maintain a chronological discussion thread, enabling context preservation across sessions.

Instructions

Add a comment to a task. Comments create a chronological discussion thread — useful for leaving breadcrumbs across sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesTask ID to comment on
contentYesComment text
authorNoAuthor name (optional)

Implementation Reference

  • Tool definition and input schema for 'comment_add' — requires task_id (integer) and content (string), with optional author (string).
    export const definitions: Tool[] = [
      {
        name: 'comment_add',
        description:
          'Add a comment to a task. Comments create a chronological discussion thread — useful for leaving breadcrumbs across sessions.',
        annotations: { title: 'Add Comment', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
        inputSchema: {
          type: 'object',
          properties: {
            task_id: { type: 'integer', description: 'Task ID to comment on' },
            content: { type: 'string', description: 'Comment text' },
            author: { type: 'string', description: 'Author name (optional)' },
          },
          required: ['task_id', 'content'],
        },
      },
  • Handler function 'handleCommentAdd' that validates the task exists, inserts a comment into the 'comments' table, logs activity, and returns the created comment.
    function handleCommentAdd(args: Record<string, unknown>) {
      const db = getDb();
      const taskId = args.task_id as number;
      const content = args.content as string;
      const author = (args.author as string) ?? null;
    
      // Verify task exists
      const task = db.prepare('SELECT id, title FROM tasks WHERE id = ?').get(taskId) as { id: number; title: string } | undefined;
      if (!task) throw new Error(`Task ${taskId} not found`);
    
      const comment = db
        .prepare('INSERT INTO comments (task_id, author, content) VALUES (?, ?, ?) RETURNING *')
        .get(taskId, author, content);
    
      const row = comment as Record<string, unknown>;
      logActivity(db, 'comment', row.id as number, 'created', null, null, null,
        `Comment added to task '${task.title}'${author ? ` by ${author}` : ''}`);
    
      return comment;
    }
  • Exported handlers mapping 'comment_add' to handleCommentAdd, imported and spread into ALL_HANDLERS in src/index.ts.
    export const handlers: Record<string, ToolHandler> = {
      comment_add: handleCommentAdd,
      comment_list: handleCommentList,
    };
  • src/index.ts:23-35 (registration)
    Global ALL_TOOLS array that includes commentDefs, registering the comment_add tool with the MCP server.
    const ALL_TOOLS: Tool[] = [
      ...projectDefs,
      ...epicDefs,
      ...taskDefs,
      ...subtaskDefs,
      ...noteDefs,
      ...commentDefs,
      ...templateDefs,
      ...dashboardDefs,
      ...searchDefs,
      ...activityDefs,
      ...exportImportDefs,
    ];
  • src/index.ts:37-49 (registration)
    Global ALL_HANDLERS record merging all tool handlers, including commentHandlers which maps 'comment_add' to handleCommentAdd.
    const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = {
      ...projectHandlers,
      ...epicHandlers,
      ...taskHandlers,
      ...subtaskHandlers,
      ...noteHandlers,
      ...commentHandlers,
      ...templateHandlers,
      ...dashboardHandlers,
      ...searchHandlers,
      ...activityHandlers,
      ...exportImportHandlers,
    };
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). The description adds context about chronological threading but does not disclose potential side effects like updating task metadata. 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?

Two sentences, front-loaded with the action, no fluff. Every sentence adds value.

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 write tool with 3 parameters and no output schema, the description adequately covers purpose and use case. Could mention the return value or note that comments append to existing thread, but not essential.

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 100% with clear parameter descriptions. The tool description does not add additional meaning beyond the schema, so baseline score of 3 is appropriate.

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 clearly states the action 'Add a comment to a task' and elaborates on its purpose as creating a chronological discussion thread for cross-session context. It distinguishes from sibling tools like comment_list and task_create.

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

Usage Guidelines3/5

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

The description implies usage for leaving breadcrumbs across sessions but does not explicitly state when to use this tool versus alternatives like note_save or task_update. No direct guidance on exclusion criteria.

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