Skip to main content
Glama

List Tags

list_tags
Read-onlyIdempotent

Retrieve all defined tags from MantisBT bug tracker installations, using the REST API endpoint when available or local metadata cache as fallback.

Instructions

List all tags defined in the MantisBT installation.

The MantisBT REST API exposes a GET /tags endpoint on some installations. If that endpoint is not available, this tool falls back to the local metadata cache populated by sync_metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default: 1)
page_sizeNoTags per page (default: 50)

Implementation Reference

  • The handler for the 'list_tags' tool, which attempts to fetch tags from the MantisBT API and falls back to a local metadata cache if the API returns a 404.
      async ({ page, page_size }) => {
        try {
          const result = await client.get<unknown>('tags', { page, page_size });
          return {
            content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          if (msg.includes('404')) {
            // GET /tags endpoint not available — fall back to metadata cache
            const metadata = await cache.load();
            if (metadata && Array.isArray(metadata.tags) && metadata.tags.length > 0) {
              const start = (page - 1) * page_size;
              const paginated = metadata.tags.slice(start, start + page_size);
              return {
                content: [{
                  type: 'text',
                  text: JSON.stringify({ tags: paginated, source: 'cache' }, null, 2),
                }],
              };
            }
            return {
              content: [{
                type: 'text',
                text: `Error: ${msg}\n\nThe GET /tags endpoint is not available in this MantisBT installation. No cached tags found either — run sync_metadata to populate the cache if your installation provides this endpoint.`,
              }],
              isError: true,
            };
          }
          return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
        }
      }
    );
  • Registration and input schema definition for the 'list_tags' tool.
      server.registerTool(
        'list_tags',
        {
          title: 'List Tags',
          description: `List all tags defined in the MantisBT installation.
    
    The MantisBT REST API exposes a GET /tags endpoint on some installations.
    If that endpoint is not available, this tool falls back to the local metadata
    cache populated by sync_metadata.`,
          inputSchema: z.object({
            page: z.coerce.number().int().positive().default(1).describe('Page number (default: 1)'),
            page_size: z.coerce.number().int().min(1).max(200).default(50).describe('Tags per page (default: 50)'),
          }),
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
          },
        },
Behavior4/5

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

Annotations establish the read-only, idempotent, non-destructive profile. The description adds valuable implementation context: the dual-path execution (REST API vs local cache) and the explicit dependency on sync_metadata for fallback data. This helps the agent understand data freshness and reliability constraints not captured in 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?

Three sentences with zero waste: purpose statement first, followed by implementation details. The fallback mechanism explanation is appropriately detailed without verbosity. Every sentence provides actionable information about tool behavior or dependencies.

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?

Given the simple input schema (2 optional pagination params) and presence of annotations, the description is nearly complete. It excellently covers operational behavior (API vs cache). Minor gap: no description of return value structure (tag objects) despite lack of output schema, though the tool name implies standard tag entities.

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?

With 100% schema description coverage for the pagination parameters (page, page_size), the schema fully documents the interface. The description adds no supplemental parameter guidance, which is acceptable given the baseline of 3 for high-coverage schemas, though it could have noted that pagination is required for large tag sets.

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?

The description opens with a specific verb ('List') and resource ('tags') with clear scope ('defined in the MantisBT installation'). It effectively distinguishes from siblings like attach_tags and detach_tag by focusing on the global tag inventory rather than issue-specific tag manipulation.

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

Usage Guidelines3/5

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

The description mentions the dependency on sync_metadata for the fallback cache mechanism, implying a prerequisite for stale data scenarios. However, it lacks explicit guidance on when to use this versus tag manipulation tools (attach_tags/detach_tag) or how to handle the pagination for retrieving complete datasets.

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