Skip to main content
Glama
snowild

Redmine MCP Server

by snowild

close_issue

Close Redmine issues by marking them as completed, optionally adding notes and setting completion percentage. This tool finalizes issue resolution in project management workflows.

Instructions

關閉議題(設定為已完成狀態)

Args:
    issue_id: 議題 ID
    notes: 關閉備註(可選)
    done_ratio: 完成百分比(預設 100%)

Returns:
    關閉結果訊息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_idYes
notesNo
done_ratioNo

Implementation Reference

  • The close_issue tool handler function. It finds a closed status, updates the issue status, sets the done ratio, adds optional notes, and returns a formatted success message. Registered via @mcp.tool() decorator. The docstring provides the tool schema information.
    @mcp.tool()
    def close_issue(issue_id: int, notes: str = "", done_ratio: int = 100) -> str:
        """
        關閉議題(設定為已完成狀態)
        
        Args:
            issue_id: 議題 ID
            notes: 關閉備註(可選)
            done_ratio: 完成百分比(預設 100%)
        
        Returns:
            關閉結果訊息
        """
        try:
            client = get_client()
            
            # 取得可用狀態列表,尋找關閉狀態
            statuses = client.get_issue_statuses()
            closed_status_id = None
            
            for status in statuses:
                if status.get('is_closed', False):
                    closed_status_id = status['id']
                    break
            
            if closed_status_id is None:
                return "錯誤: 找不到可用的關閉狀態"
            
            # 準備更新資料
            update_data = {
                'status_id': closed_status_id,
                'done_ratio': min(max(done_ratio, 0), 100)
            }
            
            if notes.strip():
                update_data['notes'] = notes.strip()
            
            # 執行更新
            client.update_issue(issue_id, **update_data)
            
            # 取得更新後的議題資訊
            updated_issue = client.get_issue(issue_id)
            
            result = f"""議題關閉成功!
    
    議題: #{issue_id} - {updated_issue.subject}
    狀態: {updated_issue.status.get('name', 'N/A')}
    完成度: {updated_issue.done_ratio}%"""
    
            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)}"
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. While '關閉議題' implies a mutation/write operation, the description doesn't disclose important behavioral aspects: whether this requires specific permissions, whether the closure is reversible, what happens to associated data, or any rate limits/constraints. The return value description ('關閉結果訊息') is vague about what the result message 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 minimal text to convey essential information. Each sentence serves a purpose: the first states the tool's function, the next three explain parameters, and the final one describes the return. There's no wasted verbiage or redundancy.

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 mutation tool with 3 parameters, 0% schema description coverage, no annotations, and no output schema, the description provides adequate but incomplete coverage. It explains what the tool does and documents parameters well, but lacks important behavioral context (permissions, side effects, error conditions) and has a vague return description. Given the complexity of issue management systems, more completeness would be beneficial.

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?

With 0% schema description coverage, the description must compensate for the lack of parameter documentation in the schema. It successfully explains all three parameters: 'issue_id: 議題 ID', 'notes: 關閉備註(可選)', and 'done_ratio: 完成百分比(預設 100%)'. The description clarifies that notes is optional and done_ratio defaults to 100%, adding valuable semantic context 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 tool's purpose: '關閉議題(設定為已完成狀態)' which translates to 'Close issue (set to completed status)'. It specifies the verb ('close') and resource ('issue') with the specific action of setting to completed status. However, it doesn't explicitly differentiate from sibling tools like 'update_issue_status' which might have overlapping functionality.

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. There are multiple sibling tools that handle issue modifications (update_issue_status, assign_issue, add_issue_note), but the description doesn't indicate when close_issue is appropriate versus other status updates or whether there are prerequisites for closing an issue.

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