Add Note to Issue
add_noteAdd comments to MantisBT issues with UTF-8 text support and configurable visibility settings for team collaboration.
Instructions
Add a note (comment) to an existing MantisBT issue. Full UTF-8 text is supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID | |
| text | Yes | Note text (supports full UTF-8, markdown will be stored as-is) | |
| view_state | No | Visibility of the note (default: public) | public |
Implementation Reference
- src/tools/notes.ts:68-83 (handler)Handler function for 'add_note' which sends a POST request to add a note to a MantisBT issue.
async ({ issue_id, text, view_state }) => { try { const body = { text, view_state: { name: view_state }, }; const result = await client.post<{ note: MantisNote }>(`issues/${issue_id}/notes`, body); return { content: [{ type: 'text', text: JSON.stringify(result.note ?? result, 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:57-61 (schema)Zod schema definition for the input parameters of 'add_note'.
inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), text: z.string().min(1).describe('Note text (supports full UTF-8, markdown will be stored as-is)'), view_state: z.enum(['public', 'private']).default('public').describe('Visibility of the note (default: public)'), }), - src/tools/notes.ts:52-83 (registration)Tool registration for 'add_note' using server.registerTool.
server.registerTool( 'add_note', { title: 'Add Note to Issue', description: 'Add a note (comment) to an existing MantisBT issue. Full UTF-8 text is supported.', inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), text: z.string().min(1).describe('Note text (supports full UTF-8, markdown will be stored as-is)'), view_state: z.enum(['public', 'private']).default('public').describe('Visibility of the note (default: public)'), }), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, }, }, async ({ issue_id, text, view_state }) => { try { const body = { text, view_state: { name: view_state }, }; const result = await client.post<{ note: MantisNote }>(`issues/${issue_id}/notes`, body); return { content: [{ type: 'text', text: JSON.stringify(result.note ?? result, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } );