add_note
Add comments to existing MantisBT issues with UTF-8 support and visibility control for public or private notes.
Instructions
Add a note (comment) to an existing MantisBT issue. Full UTF-8 text is supported.
Input Schema
TableJSON 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)The asynchronous handler function that executes the add_note tool logic, making an HTTP POST request to the MantisBT API.
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)The Zod schema validation for the add_note tool input parameters.
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-67 (registration)The registration of the add_note tool on the MCP server.
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, }, },