detach_tag
Remove a tag from a MantisBT issue by specifying the issue ID and tag ID. Requires appropriate permissions based on who attached the tag.
Instructions
Remove a tag from a MantisBT issue.
Requires tag_detach_own_threshold (default: REPORTER) for own tags, or tag_detach_threshold (default: DEVELOPER) for tags attached by others.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID | |
| tag_id | Yes | Numeric tag ID to remove |
Implementation Reference
- src/tools/tags.ts:82-92 (handler)The handler logic for the detach_tag tool, which makes a DELETE request to the MantisBT API to remove a tag from an issue.
async ({ issue_id, tag_id }) => { try { await client.delete<unknown>(`issues/${issue_id}/tags/${tag_id}`); return { content: [{ type: 'text', text: `Tag #${tag_id} successfully removed from issue #${issue_id}.` }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } - src/tools/tags.ts:72-75 (schema)Input schema validation for the detach_tag tool, requiring issue_id and tag_id.
inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), tag_id: z.coerce.number().int().positive().describe('Numeric tag ID to remove'), }), - src/tools/tags.ts:64-93 (registration)Registration of the detach_tag tool within the MCP server.
server.registerTool( 'detach_tag', { title: 'Detach Tag from Issue', description: `Remove a tag from a MantisBT issue. Requires tag_detach_own_threshold (default: REPORTER) for own tags, or tag_detach_threshold (default: DEVELOPER) for tags attached by others.`, inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), tag_id: z.coerce.number().int().positive().describe('Numeric tag ID to remove'), }), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, }, async ({ issue_id, tag_id }) => { try { await client.delete<unknown>(`issues/${issue_id}/tags/${tag_id}`); return { content: [{ type: 'text', text: `Tag #${tag_id} successfully removed from issue #${issue_id}.` }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } );