generated from personal-projects/leo-claude-mktplace
feat(tools): add label and milestone operations
- Create labels.py with gitea_list_labels and gitea_create_label tools - Integrate milestone tools from milestones.py into server - Update tools/__init__.py with all tool exports - Update server.py to handle label and milestone tool calls Closes #4, Closes #5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,14 @@ from mcp.types import Tool, TextContent
|
||||
from . import __version__
|
||||
from .auth import AuthConfig
|
||||
from .client import GiteaClient, GiteaClientError
|
||||
from .tools import get_issue_tools, handle_issue_tool, get_label_tools, handle_label_tool
|
||||
from .tools import (
|
||||
get_issue_tools,
|
||||
handle_issue_tool,
|
||||
get_label_tools,
|
||||
handle_label_tool,
|
||||
get_milestone_tools,
|
||||
handle_milestone_tool,
|
||||
)
|
||||
|
||||
|
||||
# Global client instance
|
||||
@@ -36,11 +43,12 @@ async def serve() -> None:
|
||||
"""List available MCP tools.
|
||||
|
||||
Returns:
|
||||
list: Available tools including issue and label operations.
|
||||
list: Available tools including issue, label, and milestone operations.
|
||||
"""
|
||||
# Get issue and label tools
|
||||
# Get issue, label, and milestone tools
|
||||
tools = get_issue_tools()
|
||||
tools.extend(get_label_tools())
|
||||
tools.extend(get_milestone_tools())
|
||||
|
||||
# Placeholder for future tools (PR tools, etc.)
|
||||
tools.extend([
|
||||
@@ -115,6 +123,12 @@ async def serve() -> None:
|
||||
):
|
||||
return await handle_label_tool(gitea_client, name, arguments)
|
||||
|
||||
# Handle milestone tools
|
||||
if name.startswith("gitea_") and any(
|
||||
name.endswith(suffix) for suffix in ["_milestones", "_milestone"]
|
||||
):
|
||||
return await handle_milestone_tool(name, arguments, gitea_client)
|
||||
|
||||
# Placeholder for other tools
|
||||
return [
|
||||
TextContent(
|
||||
|
||||
Reference in New Issue
Block a user