Skip to main content
Glama
snowild

Redmine MCP Server

by snowild

create_new_issue

Create new issues in Redmine project management systems to track tasks, bugs, or feature requests with project assignment, priority levels, and descriptions.

Instructions

建立新的 Redmine 議題

Args:
    project_id: 專案 ID
    subject: 議題標題
    description: 議題描述(可選)
    tracker_id: 追蹤器 ID(與 tracker_name 二選一)
    tracker_name: 追蹤器名稱(與 tracker_id 二選一)
    priority_id: 優先級 ID(與 priority_name 二選一)
    priority_name: 優先級名稱(與 priority_id 二選一)
    assigned_to_id: 指派給的用戶 ID(與 assigned_to_name/assigned_to_login 三選一)
    assigned_to_name: 指派給的用戶姓名(與 assigned_to_id/assigned_to_login 三選一)
    assigned_to_login: 指派給的用戶登入名(與 assigned_to_id/assigned_to_name 三選一)

Returns:
    建立結果訊息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
subjectYes
descriptionNo
tracker_idNo
tracker_nameNo
priority_idNo
priority_nameNo
assigned_to_idNo
assigned_to_nameNo
assigned_to_loginNo

Implementation Reference

  • The core handler function for the 'create_new_issue' tool. Decorated with @mcp.tool() for MCP registration. Resolves optional parameters by name to IDs using client helpers, creates the issue via Redmine client, fetches the new issue details, and returns a formatted success message with error handling.
    @mcp.tool()
    def create_new_issue(project_id: int, subject: str, description: str = "", 
                        tracker_id: int = None, tracker_name: str = None,
                        priority_id: int = None, priority_name: str = None,
                        assigned_to_id: int = None, assigned_to_name: str = None, assigned_to_login: str = None) -> str:
        """
        建立新的 Redmine 議題
        
        Args:
            project_id: 專案 ID
            subject: 議題標題
            description: 議題描述(可選)
            tracker_id: 追蹤器 ID(與 tracker_name 二選一)
            tracker_name: 追蹤器名稱(與 tracker_id 二選一)
            priority_id: 優先級 ID(與 priority_name 二選一)
            priority_name: 優先級名稱(與 priority_id 二選一)
            assigned_to_id: 指派給的用戶 ID(與 assigned_to_name/assigned_to_login 三選一)
            assigned_to_name: 指派給的用戶姓名(與 assigned_to_id/assigned_to_login 三選一)
            assigned_to_login: 指派給的用戶登入名(與 assigned_to_id/assigned_to_name 三選一)
        
        Returns:
            建立結果訊息
        """
        try:
            if not subject.strip():
                return "錯誤: 議題標題不能為空"
            
            client = get_client()
            
            # 處理追蹤器參數
            final_tracker_id = tracker_id
            if tracker_name:
                final_tracker_id = client.find_tracker_id_by_name(tracker_name)
                if not final_tracker_id:
                    return f"找不到追蹤器名稱:「{tracker_name}」\n\n可用追蹤器:\n" + "\n".join([f"- {name}" for name in client.get_available_trackers().keys()])
            
            # 處理優先級參數
            final_priority_id = priority_id
            if priority_name:
                final_priority_id = client.find_priority_id_by_name(priority_name)
                if not final_priority_id:
                    return f"找不到優先級名稱:「{priority_name}」\n\n可用優先級:\n" + "\n".join([f"- {name}" for name in client.get_available_priorities().keys()])
            
            # 處理指派用戶參數
            final_assigned_to_id = assigned_to_id
            if assigned_to_name:
                final_assigned_to_id = client.find_user_id_by_name(assigned_to_name)
                if not final_assigned_to_id:
                    users = client.get_available_users()
                    return f"找不到用戶姓名:「{assigned_to_name}」\n\n可用用戶(姓名):\n" + "\n".join([f"- {name}" for name in users['by_name'].keys()])
            elif assigned_to_login:
                final_assigned_to_id = client.find_user_id_by_login(assigned_to_login)
                if not final_assigned_to_id:
                    users = client.get_available_users()
                    return f"找不到用戶登入名:「{assigned_to_login}」\n\n可用用戶(登入名):\n" + "\n".join([f"- {login}" for login in users['by_login'].keys()])
            
            # 建立議題
            new_issue_id = client.create_issue(
                project_id=project_id,
                subject=subject.strip(),
                description=description,
                tracker_id=final_tracker_id,
                priority_id=final_priority_id,
                assigned_to_id=final_assigned_to_id
            )
            
            # 取得建立的議題資訊
            new_issue = client.get_issue(new_issue_id)
            
            result = f"""新議題建立成功!
    
    議題 ID: #{new_issue_id}
    標題: {new_issue.subject}
    專案: {new_issue.project.get('name', 'N/A')}
    追蹤器: {new_issue.tracker.get('name', 'N/A')}
    狀態: {new_issue.status.get('name', 'N/A')}
    優先級: {new_issue.priority.get('name', 'N/A')}
    指派給: {new_issue.assigned_to.get('name', '未指派') if new_issue.assigned_to else '未指派'}"""
    
            if description:
                result += f"\n\n描述:\n{description}"
    
            return result
            
        except RedmineAPIError as e:
            return f"建立議題失敗: {str(e)}"
        except Exception as e:
            return f"系統錯誤: {str(e)}"
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 for behavioral disclosure. While '建立新的' (create new) implies a write/mutation operation, the description doesn't mention authentication requirements, error conditions, rate limits, or what happens on success/failure. It only states that it returns a '建立結果訊息' (creation result message) without explaining what that contains.

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 well-structured with clear sections (purpose, Args, Returns) and uses bullet-like formatting for parameters. While somewhat lengthy due to the 10 parameters, every sentence earns its place by providing essential parameter semantics. The front-loaded purpose statement is clear, though the parameter explanations dominate the description.

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?

For a 10-parameter mutation tool with no annotations and no output schema, the description provides good parameter documentation but lacks critical behavioral context. It doesn't explain authentication needs, error handling, or what the return message contains. The parameter semantics are well-covered, but other aspects of tool behavior remain undocumented.

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?

With 0% schema description coverage, the description compensates excellently by explaining all 10 parameters in detail. It clarifies optional vs required parameters, provides Chinese translations, and most importantly documents the exclusive choice relationships (二選一/三選一) between alternative parameter groups (tracker_id/tracker_name, priority_id/priority_name, assigned_to_id/assigned_to_name/assigned_to_login) that aren't apparent from the schema alone.

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 as '建立新的 Redmine 議題' (create new Redmine issue), which is a specific verb+resource combination. However, it doesn't explicitly differentiate this from sibling tools like 'add_issue_note' or 'update_issue_content', which are related but distinct operations on existing issues rather than creating new ones.

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. While it's obvious this creates new issues, there's no mention of prerequisites (like needing valid project/tracker IDs), when not to use it (e.g., for updating existing issues), or how it relates to sibling tools like 'update_issue_content' for modifications.

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