Skip to main content
Glama
snowild

Redmine MCP Server

by snowild

get_user

Retrieve detailed user information from Redmine by providing a user ID to access profile data and account details.

Instructions

取得特定用戶的詳細資訊

Args:
    user_id: 用戶 ID
    
Returns:
    用戶的詳細資訊,以易讀格式呈現

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes

Implementation Reference

  • The primary MCP tool handler for 'get_user'. Decorated with @mcp.tool() for automatic registration. Fetches user data from RedmineClient and formats it into a readable string response.
    @mcp.tool()
    def get_user(user_id: int) -> str:
        """
        取得特定用戶的詳細資訊
        
        Args:
            user_id: 用戶 ID
            
        Returns:
            用戶的詳細資訊,以易讀格式呈現
        """
        try:
            client = get_client()
            user_data = client.get_user(user_id)
            
            # 格式化用戶資訊
            result = f"用戶 #{user_id}: {user_data.get('firstname', '')} {user_data.get('lastname', '')}\n\n"
            result += "基本資訊:\n"
            result += f"- 登入名: {user_data.get('login', 'N/A')}\n"
            result += f"- Email: {user_data.get('mail', 'N/A')}\n"
            result += f"- 狀態: {'啟用' if user_data.get('status', 1) == 1 else '停用'}\n"
            result += f"- 建立時間: {user_data.get('created_on', 'N/A')}\n"
            
            if user_data.get('last_login_on'):
                result += f"- 最後登入: {user_data.get('last_login_on')}\n"
            
            # 群組資訊
            if user_data.get('groups'):
                result += "\n群組:\n"
                for group in user_data['groups']:
                    result += f"- {group.get('name', 'N/A')}\n"
            
            # 自訂欄位
            if user_data.get('custom_fields'):
                result += "\n自訂欄位:\n"
                for field in user_data['custom_fields']:
                    if field.get('value'):
                        result += f"- {field.get('name', 'N/A')}: {field.get('value', 'N/A')}\n"
            
            return result
            
        except RedmineAPIError as e:
            return f"取得用戶資訊失敗: {str(e)}"
        except Exception as e:
            return f"系統錯誤: {str(e)}"
  • RedmineClient helper method that performs the actual API call to retrieve user details by ID from the Redmine server.
    def get_user(self, user_id: int) -> Dict[str, Any]:
        """取得特定用戶詳情"""
        response = self._make_request('GET', f'/users/{user_id}.json')
        
        if 'user' not in response:
            raise RedmineAPIError(f"找不到用戶 ID {user_id}")
        
        return response['user']
  • The @mcp.tool() decorator registers the get_user function as an MCP tool.
    @mcp.tool()
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. It states the tool retrieves user details in a readable format, but doesn't cover critical aspects like whether it's a read-only operation (implied by 'get'), authentication requirements, rate limits, error handling, or what specific details are included. For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is appropriately concise with three sentences: purpose, parameter explanation, and return format. It's front-loaded with the main purpose, and each sentence adds value without redundancy. However, the structure could be slightly improved by integrating parameter and return information more seamlessly, but it remains efficient.

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 and parameter semantics but lacks details on usage guidelines, behavioral traits, and output specifics. For a simple read operation, this might suffice, but gaps in transparency and guidelines reduce completeness.

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 description adds meaningful context for the single parameter 'user_id' by specifying it's for a '特定用戶' (specific user), which clarifies its purpose beyond the schema's basic type (integer). With 0% schema description coverage and only one parameter, the description adequately compensates by explaining what the parameter represents, though it doesn't detail format constraints (e.g., valid ranges).

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: '取得特定用戶的詳細資訊' (Get detailed information of a specific user). It specifies the verb ('取得' - get) and resource ('用戶' - user), but doesn't explicitly differentiate from sibling tools like 'list_users' or 'search_users' which might retrieve multiple users or search functionality. The purpose is clear but lacks sibling differentiation.

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 'list_users' (for listing multiple users) or 'search_users' (for searching users), nor does it specify prerequisites or contexts for use. The agent must infer usage from the tool name and description alone.

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/snowild/redmine-mcp'

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