Skip to main content
Glama

get_user

Retrieve Mantis user details by inputting a username, facilitating quick access to user information within the Mantis Bug Tracker system.

Instructions

根據用戶名稱查詢 Mantis 用戶

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes用戶名稱

Implementation Reference

  • src/server.ts:173-184 (registration)
    Registers the "get_user" MCP tool on the McpServer, including name, description, input schema (username), and handler function.
      "get_user",
      "根據用戶名稱查詢 Mantis 用戶",
      {
        username: z.string().describe("用戶名稱")
      },
      async (params) => {
        return withMantisConfigured("get_user", async () => {
          const user = await mantisApi.getUserByUsername(params.username);
          return JSON.stringify(user, null, 2);
        });
      }
    );
  • The handler function that executes the tool logic: checks Mantis config, fetches user by username via mantisApi, and returns JSON string.
    async (params) => {
      return withMantisConfigured("get_user", async () => {
        const user = await mantisApi.getUserByUsername(params.username);
        return JSON.stringify(user, null, 2);
      });
    }
  • Input schema validation using Zod, requiring a 'username' string parameter.
    {
      username: z.string().describe("用戶名稱")
    },
  • Helper function implementing the core API call to Mantis to get user by username, with caching and error handling.
    async getUserByUsername(username: string): Promise<User> {
      const cacheKey = `user_${username}`;
      const cached = this.cache.get(cacheKey);
      
      if (cached && Date.now() - cached.timestamp < 300000) {
        return cached.data;
      }
    
      try {
        const response = await this.api.get(`/users/username/${encodeURIComponent(username)}`);
        const user = response.data;
    
        this.cache.set(cacheKey, {
          data: user,
          timestamp: Date.now()
        });
    
        return user;
      } catch (error) {
        if (error instanceof MantisApiError) {
          throw error;
        }
        if (error instanceof Error) {
          throw new MantisApiError(`獲取用戶資訊失敗: ${error.message}`);
        }
        throw new MantisApiError('獲取用戶資訊失敗');
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While '查詢' (query) implies a read-only operation, the description doesn't specify whether this requires authentication, what happens if the username doesn't exist (e.g., returns null vs. error), or any rate limits. For a lookup tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple lookup tool and front-loaded with the core functionality. Every part of the sentence earns its place.

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

Completeness3/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage context, behavioral traits, or output format. For a simple query tool, this might suffice, but it doesn't provide complete guidance for an AI agent to use it effectively in all scenarios.

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?

The input schema has 100% description coverage, with the single parameter 'username' documented as '用戶名稱' (username). The description adds no additional parameter semantics beyond what the schema provides, such as format constraints or examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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

Purpose4/5

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

The description clearly states the tool's purpose as '根據用戶名稱查詢 Mantis 用戶' (query Mantis users by username), which specifies both the verb (query) and resource (Mantis users). It distinguishes this from sibling tools like 'get_users' (which likely retrieves all users) by focusing on username-based lookup. However, it doesn't explicitly mention how it differs from 'get_users_by_project_id'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate compared to 'get_users' (for listing all users) or 'get_users_by_project_id' (for filtering by project). There are no prerequisites, exclusions, or explicit alternatives stated.

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

Related 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/kfnzero/mantis-mcp-server'

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