Skip to main content
Glama

comment_add

Add comments to tasks to create chronological discussion threads, enabling persistent tracking of project conversations 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

  • The handler function that executes the logic for adding a comment to a task.
    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;
    }
  • The MCP tool definition and input schema for the 'comment_add' 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'],
      },
    },
  • The registration of the 'comment_add' handler within the handlers object.
    export const handlers: Record<string, ToolHandler> = {
      comment_add: handleCommentAdd,
      comment_list: handleCommentList,
    };
Behavior4/5

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

Annotations already indicate this is a non-readOnly, non-destructive, non-idempotent mutation tool. The description adds valuable context by explaining that comments create a 'chronological discussion thread,' which implies persistence and ordering behavior not covered by annotations. It doesn't contradict annotations, as 'Add' aligns with readOnlyHint=false.

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 two concise sentences with zero waste: the first states the core action, and the second explains the broader purpose. It's front-loaded with the essential information ('Add a comment to a task') and uses efficient language like 'breadcrumbs across sessions' to convey utility.

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 mutation tool with good annotations (covering safety traits) and full schema coverage, the description is reasonably complete. It adds context about comment threads but doesn't cover output behavior (no output schema) or error cases. Given the tool's moderate complexity, it could benefit from more behavioral details like response format or permissions.

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 in the schema (e.g., 'Task ID to comment on'). The description doesn't add any parameter-specific semantics beyond what's in the schema, such as format details for task_id or content constraints. Baseline 3 is appropriate since the schema fully documents parameters.

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 specific action ('Add a comment') and target resource ('to a task'), distinguishing it from siblings like comment_list (which reads comments) and note_save (which handles notes rather than task comments). It goes beyond the title 'Add Comment' by explaining the purpose of comments as creating a chronological discussion thread.

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 context by stating comments are 'useful for leaving breadcrumbs across sessions,' suggesting this tool is for ongoing task discussions. However, it doesn't explicitly state when to use this versus alternatives like note_save or when not to use it (e.g., for standalone notes vs. task-specific comments).

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