Skip to main content
Glama

list_notes

Retrieve all comments attached to a MantisBT issue by providing the issue ID to view discussion history and updates.

Instructions

List all notes (comments) attached to a MantisBT issue.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_idYesNumeric issue ID

Implementation Reference

  • The 'list_notes' tool is registered using `server.registerTool` in the `registerNoteTools` function within `src/tools/notes.ts`.
    server.registerTool(
      'list_notes',
      {
        title: 'List Issue Notes',
        description: 'List all notes (comments) attached to a MantisBT issue.',
        inputSchema: z.object({
          issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'),
        }),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      async ({ issue_id }) => {
        try {
          const result = await client.get<{ issues: Array<{ notes?: MantisNote[] }> }>(`issues/${issue_id}`);
          const notes = result.issues?.[0]?.notes ?? [];
          return {
            content: [{ type: 'text', text: JSON.stringify(notes, null, 2) }],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
        }
      }
    );
  • The handler function for 'list_notes' implements logic to fetch notes for a given issue ID from the MantisClient and returns them as a JSON-formatted string.
    async ({ issue_id }) => {
      try {
        const result = await client.get<{ issues: Array<{ notes?: MantisNote[] }> }>(`issues/${issue_id}`);
        const notes = result.issues?.[0]?.notes ?? [];
        return {
          content: [{ type: 'text', text: JSON.stringify(notes, null, 2) }],
        };
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
      }
    }
  • The input schema for 'list_notes' is defined using Zod, requiring a positive numeric issue_id.
    inputSchema: z.object({
      issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'),
    }),

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

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