Skip to main content
Glama

Detach Tag from Issue

detach_tag
Idempotent

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

  • Handler function for the detach_tag tool, performing a DELETE request to remove the tag.
    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 };
      }
    }
  • Zod schema definition for input validation of the detach_tag tool.
    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 };
          }
        }
      );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare idempotency and non-destructive nature; description adds critical behavioral context about permission thresholds (REPORTER vs DEVELOPER levels) and ownership rules that determine execution success. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste: first establishes the core action, second details permission requirements. Information is front-loaded and every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a 2-parameter mutation tool. Covers the action, resource, and permission prerequisites. No output schema exists, so return values need not be explained. Minor gap: doesn't describe error behavior (e.g., if tag not attached to issue).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage ('Numeric issue ID', 'Numeric tag ID to remove'), so the description does not need to compensate. The description focuses on behavioral constraints rather than parameter details, which is appropriate given the schema completeness.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description opens with specific verb 'Remove' and clear resource 'tag from a MantisBT issue', distinguishing it from sibling tool 'attach_tags' and broader update operations. The title also clarifies the specific domain (Issue).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit permission requirements (tag_detach_own_threshold vs tag_detach_threshold) that guide when the tool can be successfully invoked. Lacks explicit comparison to sibling 'attach_tags' (the inverse operation), but the permission constraints serve as effective usage guardrails.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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