Skip to main content
Glama

Get Project Categories

get_project_categories
Read-onlyIdempotent

Retrieve and clean category names for a MantisBT project to use when creating issues. Strips global prefixes for direct application.

Instructions

List all categories available for a MantisBT project.

Note: The MantisBT API returns global (cross-project) categories with a "[All Projects] " prefix. This tool strips that prefix so the returned names can be used directly when creating issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesNumeric project ID

Implementation Reference

  • Implementation and registration of the 'get_project_categories' tool. It fetches project categories, strips the '[All Projects] ' prefix from global categories, and returns the list.
      server.registerTool(
        'get_project_categories',
        {
          title: 'Get Project Categories',
          description: `List all categories available for a MantisBT project.
    
    Note: The MantisBT API returns global (cross-project) categories with a "[All Projects] " prefix.
    This tool strips that prefix so the returned names can be used directly when creating issues.`,
          inputSchema: z.object({
            project_id: z.coerce.number().int().positive().describe('Numeric project ID'),
          }),
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
          },
        },
        async ({ project_id }) => {
          try {
            const result = await client.get<{ projects: Array<{ categories?: MantisCategory[] }> }>(`projects/${project_id}`);
            const raw = result.projects?.[0]?.categories ?? [];
            const categories = raw.map((cat) => ({
              ...cat,
              name: cat.name.startsWith(ALL_PROJECTS_PREFIX)
                ? cat.name.slice(ALL_PROJECTS_PREFIX.length)
                : cat.name,
            }));
            return {
              content: [{ type: 'text', text: JSON.stringify(categories, null, 2) }],
            };
          } 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 the operation is read-only and safe. The description adds valuable behavioral context beyond annotations: it discloses that the tool performs data transformation by stripping the '[All Projects]' prefix that the raw API returns, which is critical for correct usage.

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 tightly structured sentences. The main purpose is front-loaded, and the Note provides essential behavioral detail without redundancy. Every sentence 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?

Despite lacking an output schema, the description adequately explains the return value behavior (stripped category names). For a simple single-parameter read operation, this provides sufficient context for invocation.

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 single project_id parameter ('Numeric project ID'), the schema carries the semantic burden. The description focuses on output behavior rather than adding parameter context, which is appropriate given the baseline.

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 ('categories available for a MantisBT project'), clearly distinguishing it from sibling tools like get_project_versions, get_project_users, or list_projects.

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 implies usage context by stating returned names 'can be used directly when creating issues,' hinting at the workflow with create_issue. However, it lacks explicit when-to-use guidance or comparison against alternatives like get_issue_enums.

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