Skip to main content
Glama

close_issue

Close issues in Redmine by setting them to a completed state. Specify the issue ID, optional notes, and completion percentage. Returns confirmation of the closure.

Instructions

關閉議題(設定為已完成狀態) Args: issue_id: 議題 ID notes: 關閉備註(可選) done_ratio: 完成百分比(預設 100%) Returns: 關閉結果訊息

Input Schema

NameRequiredDescriptionDefault
done_ratioNo
issue_idYes
notesNo

Input Schema (JSON Schema)

{ "properties": { "done_ratio": { "default": 100, "title": "Done Ratio", "type": "integer" }, "issue_id": { "title": "Issue Id", "type": "integer" }, "notes": { "default": "", "title": "Notes", "type": "string" } }, "required": [ "issue_id" ], "title": "close_issueArguments", "type": "object" }

Implementation Reference

  • The main handler function for the 'close_issue' tool. Decorated with @mcp.tool(), which registers it in the FastMCP server. It finds a closed status, updates the issue status and done_ratio via Redmine client, and returns a success message with details.
    @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)}"

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