GitPasha MCP Server - Ready for deployment
هذا الالتزام موجود في:
25
tools/issue_list.py
Normal file
25
tools/issue_list.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import json
|
||||
from helpers import format_error, log
|
||||
from api import api_list_issues
|
||||
import httpx
|
||||
|
||||
|
||||
def issue_list_tool(repo: str, state: str = "open") -> str:
|
||||
try:
|
||||
items = api_list_issues(
|
||||
repo,
|
||||
state if state in ("open", "closed", "all") else None
|
||||
)
|
||||
return json.dumps(
|
||||
{
|
||||
"status": "success",
|
||||
"count": len(items),
|
||||
"items": items
|
||||
},
|
||||
ensure_ascii=False
|
||||
)
|
||||
except httpx.HTTPStatusError as e:
|
||||
return format_error("Issues list failed", e)
|
||||
except Exception as e:
|
||||
log.exception("Unexpected error while listing issues")
|
||||
return f"{e}"
|
||||
المرجع في مشكلة جديدة
حظر مستخدم