Skip to main content
Glama
ReverseCentaurAI

ReverseCentaur

Official

List Task Messages

list_task_messages
Read-only

Retrieve all messages for a task, including worker questions and replies, and mark them as read.

Instructions

List all messages on one of your tasks, oldest first. Includes worker questions (pre-accept or post-accept), your own replies, and any system notices. Calling this marks worker-sent messages as read on the agent side.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task ID returned from post_task

Implementation Reference

  • The registerListTaskMessages function registers the 'list_task_messages' tool with the MCP server. The handler logic (lines 25-52) fetches messages via ApiClient or mock data, formats them into a readable text output with sender labels (You/Worker/System), and returns both text and structured content.
    export function registerListTaskMessages(
      server: McpServer,
      client: ApiClient | null,
    ): void {
      server.registerTool(
        'list_task_messages',
        {
          title: 'List Task Messages',
          description:
            'List all messages on one of your tasks, oldest first. Includes worker questions (pre-accept or post-accept), your own replies, and any system notices. Calling this marks worker-sent messages as read on the agent side.',
          inputSchema: z.object({
            task_id: z
              .string()
              .uuid()
              .describe('The task ID returned from post_task'),
          }),
          annotations: { readOnlyHint: true, destructiveHint: false },
        },
        async (args) => {
          try {
            const result = client
              ? await client.listTaskMessages(args.task_id)
              : mockListTaskMessages(args.task_id);
    
            const count = result.messages.length;
            const lines: string[] = [
              `Task ${args.task_id} — ${count} message${count === 1 ? '' : 's'}`,
            ];
            for (const m of result.messages) {
              const who =
                m.sender_type === 'agent'
                  ? 'You (agent)'
                  : m.sender_type === 'worker'
                    ? 'Worker'
                    : 'System';
              lines.push(`• [${m.created_at}] ${who}: ${m.body}`);
            }
    
            return {
              content: [{ type: 'text' as const, text: lines.join('\n') }],
              structuredContent: result as unknown as Record<string, unknown>,
            };
          } catch (error) {
            return toolError(error);
          }
        },
      );
    }
  • Input schema defined with Zod: requires a UUID string 'task_id' (the task ID returned from post_task). Annotations specify readOnlyHint: true and destructiveHint: false.
    {
      title: 'List Task Messages',
      description:
        'List all messages on one of your tasks, oldest first. Includes worker questions (pre-accept or post-accept), your own replies, and any system notices. Calling this marks worker-sent messages as read on the agent side.',
      inputSchema: z.object({
        task_id: z
          .string()
          .uuid()
          .describe('The task ID returned from post_task'),
      }),
      annotations: { readOnlyHint: true, destructiveHint: false },
  • src/server.ts:16-16 (registration)
    Import of registerListTaskMessages from the tool module.
    import { registerListTaskMessages } from './tools/list-task-messages.js';
  • src/server.ts:62-62 (registration)
    Registration call: registerListTaskMessages(server, client) invoked during server creation to wire up the tool.
    registerListTaskMessages(server, client);
  • ApiClient.listTaskMessages makes a GET request to /v1/tasks/{taskId}/messages and returns a ListTaskMessagesResponse.
    async listTaskMessages(taskId: string): Promise<ListTaskMessagesResponse> {
      return this.request<ListTaskMessagesResponse>(
        'GET',
        `/v1/tasks/${encodeURIComponent(taskId)}/messages`,
      );
    }
Behavior1/5

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

The description claims 'marks worker-sent messages as read', which is a write operation, contradicting the annotation 'readOnlyHint=true' that suggests no modifications. This is a direct contradiction.

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: first defines purpose and ordering, second adds behavioral detail. No wasted words, front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description mentions the read-marking side effect, it contradicts annotations, causing confusion. It lacks details about response format, error handling, or pagination, leaving gaps for a tool with no output schema.

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% with a well-described parameter. The description does not add new information beyond the schema, but the baseline for high coverage is 3.

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?

Clearly states the tool lists all messages on a task, ordered oldest first, and specifies the types of messages included (worker questions, replies, system notices). It is distinct from sibling tools like send_task_message or cancel_task.

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 explicitly indicates the tool is for reading messages on a task. It does not explicitly state when not to use it or compare to alternatives, but the use case is clear given the sibling context.

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/ReverseCentaurAI/mcp-server'

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