List Issue Notes
list_notesRetrieve comments attached to a MantisBT issue without fetching the full issue data. Use to access notes independently when you only need comment information.
Instructions
List all notes (comments) attached to a MantisBT issue. Note: get_issue already includes notes in its response — use list_notes only when you need notes without fetching the full issue.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID |
Implementation Reference
- src/tools/notes.ts:34-45 (handler)The handler logic for the 'list_notes' tool, which fetches notes from a specific MantisBT issue.
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 the 'list_notes' tool.
inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), }), - src/tools/notes.ts:20-46 (registration)The registration of the 'list_notes' tool in the McpServer.
server.registerTool( 'list_notes', { title: 'List Issue Notes', description: 'List all notes (comments) attached to a MantisBT issue. Note: get_issue already includes notes in its response — use list_notes only when you need notes without fetching the full 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 }; } } );