Skip to main content
Glama
snowild

Redmine MCP Server

by snowild

assign_issue

Assign Redmine issues to specific users by providing issue ID and user identifier, with optional assignment notes for tracking.

Instructions

指派議題給用戶

Args:
    issue_id: 議題 ID
    user_id: 指派給的用戶 ID(與 user_name/user_login 三選一)
    user_name: 指派給的用戶姓名(與 user_id/user_login 三選一)
    user_login: 指派給的用戶登入名(與 user_id/user_name 三選一)
    notes: 指派備註(可選)

Returns:
    指派結果訊息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_idYes
user_idNo
user_nameNo
user_loginNo
notesNo

Implementation Reference

  • The primary handler function for the 'assign_issue' tool. Decorated with @mcp.tool() for registration. Resolves user by ID, name, or login using Redmine client methods, updates the issue's assigned_to_id, adds optional notes, and returns a formatted success message with current assignee info.
    @mcp.tool()
    def assign_issue(issue_id: int, user_id: int = None, user_name: str = None, user_login: str = None, notes: str = "") -> str:
        """
        指派議題給用戶
        
        Args:
            issue_id: 議題 ID
            user_id: 指派給的用戶 ID(與 user_name/user_login 三選一)
            user_name: 指派給的用戶姓名(與 user_id/user_login 三選一)
            user_login: 指派給的用戶登入名(與 user_id/user_name 三選一)
            notes: 指派備註(可選)
        
        Returns:
            指派結果訊息
        """
        try:
            client = get_client()
            
            # 處理用戶參數
            final_user_id = user_id
            if user_name:
                final_user_id = client.find_user_id_by_name(user_name)
                if not final_user_id:
                    users = client.get_available_users()
                    return f"找不到用戶姓名:「{user_name}」\n\n可用用戶(姓名):\n" + "\n".join([f"- {name}" for name in users['by_name'].keys()])
            elif user_login:
                final_user_id = client.find_user_id_by_login(user_login)
                if not final_user_id:
                    users = client.get_available_users()
                    return f"找不到用戶登入名:「{user_login}」\n\n可用用戶(登入名):\n" + "\n".join([f"- {login}" for login in users['by_login'].keys()])
            
            # 準備更新資料
            update_data = {}
            
            if final_user_id is not None:
                update_data['assigned_to_id'] = final_user_id
                action_text = f"指派給用戶 ID {final_user_id}"
            else:
                update_data['assigned_to_id'] = None
                action_text = "取消指派"
            
            if notes.strip():
                update_data['notes'] = notes.strip()
            
            # 執行更新
            client.update_issue(issue_id, **update_data)
            
            # 取得更新後的議題資訊
            updated_issue = client.get_issue(issue_id)
            
            assignee_name = "未指派"
            if updated_issue.assigned_to:
                assignee_name = updated_issue.assigned_to.get('name', f"用戶 ID {user_id}")
            
            result = f"""議題指派更新成功!
    
    議題: #{issue_id} - {updated_issue.subject}
    動作: {action_text}
    目前指派給: {assignee_name}"""
    
            if notes.strip():
                result += f"\n備註: {notes}"
    
            return result
            
        except RedmineAPIError as e:
            return f"指派議題失敗: {str(e)}"
        except Exception as e:
            return f"系統錯誤: {str(e)}"
  • The @mcp.tool() decorator registers the assign_issue function as an MCP tool.
    @mcp.tool()
  • Docstring providing the tool description, parameters (issue_id, user_id/name/login, notes), and return format, which serves as the input/output schema for MCP.
    """
    指派議題給用戶
    
    Args:
        issue_id: 議題 ID
        user_id: 指派給的用戶 ID(與 user_name/user_login 三選一)
        user_name: 指派給的用戶姓名(與 user_id/user_login 三選一)
        user_login: 指派給的用戶登入名(與 user_id/user_name 三選一)
        notes: 指派備註(可選)
    
    Returns:
        指派結果訊息
    """
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool 'assigns an issue to a user' which implies a mutation/write operation, but doesn't disclose behavioral traits like required permissions, whether assignment is reversible, error conditions, or rate limits. The description adds minimal context beyond the basic action.

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 sized and front-loaded with the core purpose first. The Args/Returns sections are structured but could be more concise (e.g., the user identifier explanation is slightly repetitive). Every sentence adds value, though minor trimming is possible.

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 no annotations, 0% schema coverage, and no output schema, the description does well on parameters but lacks completeness. It doesn't cover behavioral aspects (permissions, side effects) or return value details ('assignment result message' is vague). For a mutation tool with 5 parameters, this leaves gaps in guiding the agent.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all 5 parameters: explains 'issue_id' as the issue ID, describes the three user identifier options (user_id, user_name, user_login) as mutually exclusive alternatives, and notes that 'notes' is optional. This adds significant value beyond the bare schema.

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 verb ('assign') and resource ('issue'), making the purpose specific and understandable. It distinguishes from siblings like 'update_issue_status' or 'close_issue' by focusing on user assignment. However, it doesn't explicitly differentiate from all siblings (e.g., 'add_issue_note' also involves issues but for notes).

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 like 'update_issue_status' or 'add_issue_note'. It mentions parameter options (user_id, user_name, user_login as alternatives) but doesn't explain context or prerequisites for assignment, leaving the agent to infer usage from sibling names 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