Skip to main content
Glama

add_task_comment

Add a comment to a task for status updates, AI rationale, or notes, using markdown formatting.

Instructions

Add a comment to a task for status updates, AI rationale, or notes. Supports markdown formatting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dart_idYesTask dart_id (also accepts "id" or "task_id")
textYesComment text (markdown supported)

Implementation Reference

  • Main handler function `handleAddTaskComment` that validates input (dart_id and text), then calls DartClient.addComment() to add a comment to a task. Handles 404 errors for missing tasks.
    export async function handleAddTaskComment(
      input: unknown
    ): Promise<AddTaskCommentOutput> {
      const DART_TOKEN = process.env.DART_TOKEN;
    
      if (!DART_TOKEN) {
        throw new DartAPIError(
          'DART_TOKEN environment variable is required. Get your token from: https://app.dartai.com/?settings=account',
          401
        );
      }
    
      // Defensive input validation
      if (!input || typeof input !== 'object') {
        throw new ValidationError('Input must be a non-null object');
      }
    
      const typedInput = input as Partial<AddTaskCommentInput>;
    
      // Accept id, task_id, or taskId as aliases for dart_id
      const dartId = resolveDartId(input as unknown as Record<string, unknown>);
      if (!dartId) {
        throw new ValidationError(
          'dart_id cannot be empty or whitespace-only',
          'dart_id'
        );
      }
    
      // Validate text
      if (!typedInput.text || typeof typedInput.text !== 'string') {
        throw new ValidationError(
          'text is required and must be a non-empty string',
          'text'
        );
      }
    
      // Validate text is not empty/whitespace-only, but preserve original formatting
      if (typedInput.text.trim() === '') {
        throw new ValidationError(
          'text cannot be empty or whitespace-only',
          'text'
        );
      }
    
      const dartClient = new DartClient({ token: DART_TOKEN });
    
      try {
        // Call DartClient.addComment() - use original text to preserve formatting
        const comment = await dartClient.addComment(dartId, typedInput.text);
    
        // Return structured output
        return {
          comment_id: comment.comment_id,
          dart_id: comment.dart_id,
          text: comment.text,
          author: comment.author,
        };
      } catch (error) {
        // Enhanced error handling for 404 (task not found)
        if (error instanceof DartAPIError && error.statusCode === 404) {
          throw new DartAPIError(
            `Task not found: dart_id '${dartId}' does not exist. Check the dart_id or use list_tasks to find valid tasks.`,
            404
          );
        }
    
        // Re-throw other errors
        throw error;
      }
    }
  • Input type `AddTaskCommentInput` with dart_id (string) and text (string) fields.
    export interface AddTaskCommentInput {
      dart_id: string;
      text: string;
    }
  • Output type `AddTaskCommentOutput` with comment_id, dart_id, text, and author fields.
    export interface AddTaskCommentOutput {
      comment_id: string;
      dart_id: string;
      text: string;
      author: string;
    }
  • src/index.ts:804-822 (registration)
    Tool registration with name 'add_task_comment', description, and inputSchema (dart_id and text required).
    // Task Comments
    {
      name: 'add_task_comment',
      description: 'Add a comment to a task for status updates, AI rationale, or notes. Supports markdown formatting.',
      inputSchema: {
        type: 'object',
        properties: {
          dart_id: {
            type: 'string',
            description: 'Task dart_id (also accepts "id" or "task_id")',
          },
          text: {
            type: 'string',
            description: 'Comment text (markdown supported)',
          },
        },
        required: ['dart_id', 'text'],
      },
    },
  • src/index.ts:1184-1194 (registration)
    Tool dispatch case for 'add_task_comment' calling handleAddTaskComment and returning JSON-stringified result.
    case 'add_task_comment': {
      const result = await handleAddTaskComment((args || {}) as any);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
Behavior2/5

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

No annotations provided, and the description lacks behavioral details such as whether comments are appended, permissions needed, or return value. It only states the action without deeper context.

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 extremely concise, one sentence plus a fragment, front-loading the purpose without superfluous words.

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 2-parameter tool with good schema coverage, the description is contextually complete enough to understand usage, though it omits behavioral details like idempotency or response.

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 coverage is 100% and already describes both parameters well. The description adds no new parameter meaning beyond noting markdown support, which is already in the schema.

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 tool adds a comment to a task, specifying use cases (status updates, AI rationale, notes) and distinguishing it from siblings like list_comments.

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 suggests use cases but does not explicitly guide when to use this tool versus alternatives like update_task or list_comments, nor mention prerequisites like task existence.

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/standardbeagle/dart-query'

If you have feedback or need assistance with the MCP directory API, please join our Discord server