Skip to main content
Glama

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
NameRequiredDescriptionDefault
issue_idYesNumeric issue ID
tag_idYesNumeric tag ID to remove

Implementation Reference

  • 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 };
      }
    }
  • 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'),
    }),
  • 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 };
          }
        }
      );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dpesch/mantisbt-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server