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
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID |
Implementation Reference
- src/tools/notes.ts:20-46 (registration)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 }; } } ); - src/tools/notes.ts:34-45 (handler)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 }; } } - src/tools/notes.ts:25-27 (schema)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'), }),