Skip to main content
Glama

get_task_comments

Retrieve all comments for a specific Todoist task to view discussion history, attachments, and user details in structured JSON format.

Instructions

Get all comments for a specific Todoist task. Returns structured JSON data with comment details including id, content, posted date, user ID, and any attachments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe ID of the task to get comments for

Implementation Reference

  • The handler function for the 'get_task_comments' MCP tool. It validates input, calls the getTaskComments service, and formats the response as MCP content.
    handler: async (args: { task_id: string }) => {
      console.error('Executing get_task_comments...');
      const { task_id } = args;
      if (!task_id) {
        throw new Error('task_id is required');
      }
      const result = await getTaskComments(task_id);
      console.error('get_task_comments completed successfully');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    },
  • The schema definition for the 'get_task_comments' tool, including name, description, and input schema requiring 'task_id'.
    schema: {
      name: 'get_task_comments',
      description:
        'Get all comments for a specific Todoist task. Returns structured JSON data with comment details including id, content, posted date, user ID, and any attachments.',
      inputSchema: {
        type: 'object',
        properties: {
          task_id: {
            type: 'string',
            description: 'The ID of the task to get comments for',
          },
        },
        required: ['task_id'],
      },
    },
  • Registration of the tool handler in the toolsWithArgs registry, mapping 'get_task_comments' to getTaskCommentsTool.handler for execution.
    const toolsWithArgs: Record<string, (args: any) => Promise<ToolResponse>> = {
      get_task_comments: getTaskCommentsTool.handler,
      create_project_label: createProjectLabelTool.handler,
      create_task_comment: createTaskCommentTool.handler,
      update_task: updateTaskTool.handler,
      create_task: createTaskTool.handler,
      move_task: moveTaskTool.handler,
      get_tasks_with_label: getTasksWithLabelTool.handler,
      complete_task: completeTaskTool.handler,
      uncomplete_task: uncompleteTaskTool.handler,
      search_tasks: searchTasksTool.handler,
      search_tasks_using_and: searchTasksUsingAndTool.handler,
      search_tasks_using_or: searchTasksUsingOrTool.handler,
      complete_becky_task: completeBeckyTaskTool.handler,
    };
  • src/index.ts:82-82 (registration)
    Registration of the tool schema in the ListToolsRequestHandler response array.
    getTaskCommentsTool.schema,
  • The core getTaskComments helper function that fetches comments from the Todoist API using the client, maps the response, and handles errors.
    export async function getTaskComments(
      taskId: string
    ): Promise<CommentsResponse> {
      const todoistClient = getTodoistClient();
    
      try {
        const response = await todoistClient.get<TodoistComment[]>(
          `/comments?task_id=${taskId}`
        );
        const comments = response.data.map((comment) => ({
          id: parseInt(comment.id),
          content: comment.content,
          posted: comment.posted,
          posted_uid: comment.posted_uid,
          attachment: comment.attachment,
        }));
    
        return {
          comments,
          total_count: comments.length,
        };
      } catch (error) {
        throw new Error(`Failed to get task comments: ${getErrorMessage(error)}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return format ('structured JSON data with comment details'), which adds some context, but it does not cover important aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error handling, or pagination. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, well-structured sentence that efficiently conveys the tool's purpose and return data. It is front-loaded with the main action and resource, followed by details on the output, with no redundant or unnecessary information.

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 low complexity (1 parameter, no nested objects) and high schema coverage, the description is adequate but incomplete. It lacks an output schema, and with no annotations, it should provide more behavioral context (e.g., read-only nature, error cases). The description covers the basics but misses details needed for full understanding in the absence of structured data.

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 the schema fully documenting the single parameter 'task_id'. The description does not add any parameter-specific details beyond what the schema provides (e.g., no examples or format clarifications). According to the rules, when schema coverage is high (>80%), the baseline score is 3, as the schema handles the heavy lifting.

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 ('Get all comments') and resource ('for a specific Todoist task'), distinguishing it from sibling tools like 'create_task_comment' (which creates comments) and 'get_tasks_due_tomorrow' (which retrieves tasks). It precisely defines the scope as retrieving all comments for a given task.

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 when comments for a specific task are needed, but it does not explicitly state when to use this tool versus alternatives (e.g., no mention of other comment-related tools or task retrieval tools). It provides basic context but lacks explicit guidance on exclusions or comparisons with siblings.

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/bkotos/todoist-mcp'

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