Skip to main content
Glama
snowild

Redmine MCP Server

by snowild

search_users

Find Redmine users by name or login ID to identify team members, assign tasks, or manage project permissions. Returns matching user profiles with configurable result limits.

Instructions

搜尋用戶(依姓名或登入名)

Args:
    query: 搜尋關鍵字(姓名或登入名)
    limit: 最大回傳數量 (預設 10,最大 50)

Returns:
    符合搜尋條件的用戶列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Implementation Reference

  • MCP tool handler for search_users: formats client results into a readable table string.
    @mcp.tool()
    def search_users(query: str, limit: int = 10) -> str:
        """
        搜尋用戶(依姓名或登入名)
        
        Args:
            query: 搜尋關鍵字(姓名或登入名)
            limit: 最大回傳數量 (預設 10,最大 50)
        
        Returns:
            符合搜尋條件的用戶列表
        """
        try:
            if not query.strip():
                return "請提供搜尋關鍵字"
            
            client = get_client()
            limit = min(max(limit, 1), 50)
            
            users = client.search_users(query, limit)
            
            if not users:
                return f"沒有找到匹配「{query}」的用戶"
            
            result = f"搜尋關鍵字: '{query}'\n找到 {len(users)} 個相關用戶:\n\n"
            result += f"{'ID':<5} {'登入名':<15} {'姓名':<20} {'狀態':<8}\n"
            result += f"{'-'*5} {'-'*15} {'-'*20} {'-'*8}\n"
            
            for user in users:
                full_name = f"{user.firstname} {user.lastname}".strip()
                if not full_name:
                    full_name = user.login
                status_text = "啟用" if user.status == 1 else "停用"
                result += f"{user.id:<5} {user.login:<15} {full_name:<20} {status_text:<8}\n"
            
            return result
            
        except RedmineAPIError as e:
            return f"搜尋用戶失敗: {str(e)}"
        except Exception as e:
            return f"系統錯誤: {str(e)}"
  • RedmineClient.search_users: performs API call to /users.json with name=query param and parses into RedmineUser objects.
    def search_users(self, query: str, limit: int = 10) -> List[RedmineUser]:
        """搜尋用戶(依姓名或登入名)"""
        if not query.strip():
            return []
            
        params = {
            'name': query.strip(),
            'limit': min(max(limit, 1), 50)
        }
        
        response = self._make_request('GET', '/users.json', params=params)
        
        users = []
        for user_data in response.get('users', []):
            users.append(RedmineUser(
                id=user_data['id'],
                login=user_data['login'],
                firstname=user_data.get('firstname', ''),
                lastname=user_data.get('lastname', ''),
                mail=user_data.get('mail', ''),
                status=user_data.get('status', 1),
                created_on=user_data.get('created_on'),
                last_login_on=user_data.get('last_login_on')
            ))
        
        return users
  • Dataclass defining RedmineUser structure used by search_users.
    class RedmineUser:
        """Redmine 用戶數據結構"""
        id: int
        login: str
        firstname: str
        lastname: str
        mail: str
        status: int
        created_on: Optional[str] = None
        last_login_on: Optional[str] = None
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 mentions the tool returns a list of users matching search criteria, but lacks critical details: whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or error conditions. For a search tool with zero annotation coverage, this is a significant gap.

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 well-structured and concise, with zero wasted words. It uses a clear header, bullet points for arguments and returns, and each sentence adds specific value. The information is front-loaded with the core purpose immediately stated.

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 moderate complexity (2 parameters, search functionality), no annotations, and no output schema, the description is minimally adequate. It covers the purpose and parameters but lacks behavioral context, output format details, and usage guidelines. It meets the baseline for a simple search tool but leaves gaps an agent would need to infer.

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 semantics beyond the input schema, which has 0% description coverage. It explains that 'query' is for search keywords (name or login name) and 'limit' defines the maximum return count with defaults and bounds (default 10, max 50). This compensates well for the schema's lack of descriptions, though it doesn't detail query syntax or formatting.

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: '搜尋用戶(依姓名或登入名)' (Search users by name or login name). It specifies the verb ('搜尋' - search) and resource ('用戶' - users), and indicates the search criteria. However, it doesn't explicitly differentiate from sibling tools like 'get_user' or 'list_users', which prevents a perfect score.

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 retrieving a specific user) or 'list_users' (likely for listing all users without filtering), nor does it specify use cases or prerequisites. The agent must infer usage from the tool name 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