Skip to main content
Glama

get_users

Retrieve all user data from Mantis Bug Tracker using brute-force methods for comprehensive user analysis and integration.

Instructions

用暴力法強制取得所有用戶

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'get_users' tool. It uses a brute-force approach by sequentially fetching users starting from ID 1 via mantisApi.getUser(id) until encountering 10 consecutive 404 errors, then returns the collected users as JSON.
    async () => {
      return withMantisConfigured("get_users", async () => {
        let notFoundCount = 0;
        let id = 1;
        let users: User[] = [];
        do {
          try {
            const user = await mantisApi.getUser(id);
            users.push(user);
            id++;
            notFoundCount = 0; // 重置計數器
          } catch (error) {
            if (error instanceof MantisApiError && error.statusCode === 404) {
              notFoundCount++;
              id++;
            }
          }
        } while (notFoundCount < 10);
        return JSON.stringify(users, null, 2);
      });
    }
  • src/server.ts:420-444 (registration)
    Registration of the MCP 'get_users' tool on the McpServer instance, including description, empty input schema, and inline handler.
      "get_users",
      "用暴力法強制取得所有用戶",
      {},
      async () => {
        return withMantisConfigured("get_users", async () => {
          let notFoundCount = 0;
          let id = 1;
          let users: User[] = [];
          do {
            try {
              const user = await mantisApi.getUser(id);
              users.push(user);
              id++;
              notFoundCount = 0; // 重置計數器
            } catch (error) {
              if (error instanceof MantisApiError && error.statusCode === 404) {
                notFoundCount++;
                id++;
              }
            }
          } while (notFoundCount < 10);
          return JSON.stringify(users, null, 2);
        });
      }
    );
  • TypeScript interface defining the User type, used for typing the users array returned by the tool.
    export interface User {
      id: number;
      name: string;
      email: string;
      real_name?: string;
      access_level?: {
        id: number;
        name: string;
      };
      enabled?: boolean;
    }
  • mantisApi.getUser(userId) helper function that fetches a single user by ID from the Mantis API (with caching), repeatedly called in the tool's brute-force loop.
    async getUser(userId: number): Promise<User> {
      log.info('獲取用戶信息', { userId });
      
      if (!userId) {
        throw new MantisApiError('必須提供用戶 ID');
      }
      
      const cacheKey = `user-${userId}`;
      
      return this.cachedRequest<User>(cacheKey, () => {
        return this.api.get(`/users/${userId}`);
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions '暴力法強制' (brute force forcibly), suggesting potentially aggressive or unrestricted retrieval, but doesn't clarify permissions needed, rate limits, side effects, or what 'all users' entails (e.g., pagination, format). This leaves significant gaps for agent decision-making.

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

Conciseness3/5

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

The description is a single sentence '用暴力法強制取得所有用戶', which is concise but under-specified. It front-loads the action but wastes words on ambiguous terms like '暴力法' (brute force) without adding clear value, making it inefficient rather than optimally structured.

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

Completeness2/5

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

Given no annotations, no output schema, and a vague description, this is incomplete for a tool that retrieves 'all users'. It lacks details on return format, error handling, or behavioral constraints, which are critical for an agent to use it correctly despite the simple parameter schema.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is given as it avoids redundancy while matching the schema's simplicity.

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

Purpose3/5

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

The description '用暴力法強制取得所有用戶' (Use brute force to forcibly obtain all users) states a verb ('取得' - obtain) and resource ('所有用戶' - all users), but is vague about the specific mechanism and purpose. It doesn't clearly distinguish from sibling tools like 'get_user' (singular) or 'get_users_by_project_id' (filtered). The term '暴力法' (brute force) adds ambiguity rather than clarity.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_user' (for single user) or 'get_users_by_project_id' (for filtered users). The description implies a forceful approach but doesn't specify appropriate contexts or prerequisites for its use.

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