| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- package data
- import (
- "github.com/mark3labs/mcp-go/mcp"
- "github.com/mark3labs/mcp-go/server"
- )
- func registerPlaneV2ApiTools(s *server.MCPServer) {
- // ============ Workspace (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_workspaces",
- mcp.WithDescription("列出所有工作空间(V2 Web API)"),
- ),
- handlePlaneV2ListWorkspaces,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_workspace",
- mcp.WithDescription("获取当前工作空间详情(V2 Web API)"),
- ),
- handlePlaneV2GetWorkspace,
- )
- // ============ Project (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_projects",
- mcp.WithDescription("列出工作空间下的所有项目(V2 Web API)"),
- ),
- handlePlaneV2ListProjects,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_project",
- mcp.WithDescription("获取项目详情(V2 Web API)"),
- mcp.WithString("project_id", mcp.Required(), mcp.Description("项目 UUID")),
- ),
- handlePlaneV2GetProject,
- )
- // ============ Issue (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_issues",
- mcp.WithDescription("列出项目工作项列表(V2 Web API)"),
- ),
- handlePlaneV2ListIssues,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_issue",
- mcp.WithDescription("获取工作项详情(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2GetIssue,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_sub_issues",
- mcp.WithDescription("获取子工作项列表(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("父工作项 UUID")),
- ),
- handlePlaneV2GetSubIssues,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_issue_activity",
- mcp.WithDescription("获取工作项活动历史(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2GetIssueActivity,
- )
- // ============ Cycle (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_cycles",
- mcp.WithDescription("列出项目周期列表(V2 Web API)"),
- ),
- handlePlaneV2ListCycles,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_cycle",
- mcp.WithDescription("获取周期详情(V2 Web API)"),
- mcp.WithString("cycle_id", mcp.Required(), mcp.Description("周期 UUID")),
- ),
- handlePlaneV2GetCycle,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_cycle_issues",
- mcp.WithDescription("列出周期中的工作项(V2 Web API)"),
- mcp.WithString("cycle_id", mcp.Required(), mcp.Description("周期 UUID")),
- ),
- handlePlaneV2ListCycleIssues,
- )
- // ============ Module (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_modules",
- mcp.WithDescription("列出项目模块列表(V2 Web API)"),
- ),
- handlePlaneV2ListModules,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_module",
- mcp.WithDescription("获取模块详情(V2 Web API)"),
- mcp.WithString("module_id", mcp.Required(), mcp.Description("模块 UUID")),
- ),
- handlePlaneV2GetModule,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_module_issues",
- mcp.WithDescription("列出模块中的工作项(V2 Web API)"),
- mcp.WithString("module_id", mcp.Required(), mcp.Description("模块 UUID")),
- ),
- handlePlaneV2ListModuleIssues,
- )
- // ============ Label (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_labels",
- mcp.WithDescription("列出项目标签列表(V2 Web API)"),
- ),
- handlePlaneV2ListLabels,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_label",
- mcp.WithDescription("获取标签详情(V2 Web API)"),
- mcp.WithString("label_id", mcp.Required(), mcp.Description("标签 UUID")),
- ),
- handlePlaneV2GetLabel,
- )
- // ============ State (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_states",
- mcp.WithDescription("列出项目状态列表(V2 Web API)"),
- ),
- handlePlaneV2ListStates,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_state",
- mcp.WithDescription("获取状态详情(V2 Web API)"),
- mcp.WithString("state_id", mcp.Required(), mcp.Description("状态 UUID")),
- ),
- handlePlaneV2GetState,
- )
- // ============ Comment (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_comments",
- mcp.WithDescription("列出工作项评论(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2ListComments,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_comment",
- mcp.WithDescription("获取评论详情(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- mcp.WithString("comment_id", mcp.Required(), mcp.Description("评论 UUID")),
- ),
- handlePlaneV2GetComment,
- )
- // ============ Link (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_issue_links",
- mcp.WithDescription("列出工作项链接(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2ListIssueLinks,
- )
- // ============ Relation (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_issue_relations",
- mcp.WithDescription("列出工作项关联关系(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2ListIssueRelations,
- )
- // ============ Sticky (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_stickies",
- mcp.WithDescription("列出工作空间便签(V2 Web API)"),
- ),
- handlePlaneV2ListStickies,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_sticky",
- mcp.WithDescription("获取便签详情(V2 Web API)"),
- mcp.WithString("sticky_id", mcp.Required(), mcp.Description("便签 UUID")),
- ),
- handlePlaneV2GetSticky,
- )
- // ============ Intake (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_intake_issues",
- mcp.WithDescription("列出收件箱工作项(V2 Web API)"),
- mcp.WithString("status", mcp.Description("状态过滤")),
- ),
- handlePlaneV2ListIntakeIssues,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_intake_issue",
- mcp.WithDescription("获取收件箱工作项详情(V2 Web API)"),
- mcp.WithString("issue_id", mcp.Required(), mcp.Description("工作项 UUID")),
- ),
- handlePlaneV2GetIntakeIssue,
- )
- // ============ Asset (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_project_asset_url",
- mcp.WithDescription("获取项目资源的预签名访问 URL(V2 Web API)"),
- mcp.WithString("asset_id", mcp.Required(), mcp.Description("资源 UUID")),
- ),
- handlePlaneV2GetProjectAssetURL,
- )
- // ============ Page (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_pages",
- mcp.WithDescription("列出项目页面列表(V2 Web API)"),
- ),
- handlePlaneV2ListPages,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_page",
- mcp.WithDescription("获取页面详情(V2 Web API)"),
- mcp.WithString("page_id", mcp.Required(), mcp.Description("页面 UUID")),
- ),
- handlePlaneV2GetPage,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_page_description",
- mcp.WithDescription("获取页面描述内容(V2 Web API)"),
- mcp.WithString("page_id", mcp.Required(), mcp.Description("页面 UUID")),
- ),
- handlePlaneV2GetPageDescription,
- )
- // ============ Member (读) ============
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_workspace_members",
- mcp.WithDescription("列出工作空间成员(V2 Web API)"),
- ),
- handlePlaneV2ListWorkspaceMembers,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_workspace_member",
- mcp.WithDescription("获取工作空间成员详情(V2 Web API)"),
- mcp.WithString("member_id", mcp.Required(), mcp.Description("成员 UUID")),
- ),
- handlePlaneV2GetWorkspaceMember,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_list_project_members",
- mcp.WithDescription("列出项目成员(V2 Web API)"),
- ),
- handlePlaneV2ListProjectMembers,
- )
- s.AddTool(
- mcp.NewTool("data_plane_v2_get_project_member",
- mcp.WithDescription("获取项目成员详情(V2 Web API)"),
- mcp.WithString("member_id", mcp.Required(), mcp.Description("成员 UUID")),
- ),
- handlePlaneV2GetProjectMember,
- )
- }
|