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, ) }