Skip to main content
Glama

get_users_by_project_id

Retrieve all users associated with a specific project ID using the MCP service integrated with Mantis Bug Tracker for efficient user data management and analysis.

Instructions

獲取指定專案的所有用戶

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes專案 ID

Implementation Reference

  • src/server.ts:404-416 (registration)
    Registration of the 'get_users_by_project_id' tool using server.tool, including description, input schema, and handler function.
    server.tool(
      "get_users_by_project_id",
      "獲取指定專案的所有用戶",
      {
        projectId: z.number().describe("專案 ID"),
      },
      async (params) => {
        return withMantisConfigured("get_users_by_project_id", async () => {
          const users = await mantisApi.getUsersByProjectId(params.projectId);
          return JSON.stringify(users, null, 2);
        });
      }
    );
  • The MCP tool handler function that validates Mantis configuration, calls the mantisApi helper, and returns JSON stringified users.
    async (params) => {
      return withMantisConfigured("get_users_by_project_id", async () => {
        const users = await mantisApi.getUsersByProjectId(params.projectId);
        return JSON.stringify(users, null, 2);
      });
    }
  • Zod input schema defining the required 'projectId' parameter.
    {
      projectId: z.number().describe("專案 ID"),
    },
  • Helper function in MantisApi class that fetches users for a given project ID via API call with caching support.
    async getUsersByProjectId(projectId: number): Promise<User[]> {
      log.info('獲取指定專案的所有使用者', { projectId });
      
      const cacheKey = `users-by-project-${projectId}`;
      
      return this.cachedRequest<User[]>(cacheKey, () => {
        return this.api.get(`/projects/${projectId}/users`);
      });
    }
  • TypeScript interface defining the User object structure returned by the tool.
    export interface User {
      id: number;
      name: string;
      email: string;
      real_name?: string;
      access_level?: {
        id: number;
        name: string;
      };
      enabled?: boolean;
    }
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 only states what the tool does ('獲取/get'), implying a read operation, but doesn't disclose any behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what happens with invalid project IDs. This leaves significant gaps for a tool that presumably queries a database.

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 with zero wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what '獲取' entails (e.g., returns a list, includes user details), behavioral aspects like error handling, or how it differs from sibling tools. For a retrieval tool with one parameter, this minimal description leaves too many operational questions unanswered.

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 description implies the 'projectId' parameter is required to specify which project's users to retrieve, which aligns with the schema's 100% coverage. However, it adds no additional semantic context beyond what the schema already provides (e.g., format expectations, valid ranges, or how the ID correlates to projects).

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 action (獲取/get) and resource (專案的所有用戶/all users of a project), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_user' or 'get_users', which likely retrieve individual users or all users without project filtering.

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 sibling tools like 'get_user' (likely for single user) or 'get_users' (likely for all users), nor does it specify prerequisites or exclusions for using this project-filtered retrieval method.

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