GranularReprioritizeSubIssue creates a tool to reorder a sub-issue.
(t translations.TranslationHelperFunc)
| 822 | |
| 823 | // GranularReprioritizeSubIssue creates a tool to reorder a sub-issue. |
| 824 | func GranularReprioritizeSubIssue(t translations.TranslationHelperFunc) inventory.ServerTool { |
| 825 | st := NewTool( |
| 826 | ToolsetMetadataIssues, |
| 827 | mcp.Tool{ |
| 828 | Name: "reprioritize_sub_issue", |
| 829 | Description: t("TOOL_REPRIORITIZE_SUB_ISSUE_DESCRIPTION", "Reprioritize (reorder) a sub-issue relative to other sub-issues."), |
| 830 | Annotations: &mcp.ToolAnnotations{ |
| 831 | Title: t("TOOL_REPRIORITIZE_SUB_ISSUE_USER_TITLE", "Reprioritize Sub-Issue"), |
| 832 | ReadOnlyHint: false, |
| 833 | DestructiveHint: jsonschema.Ptr(false), |
| 834 | OpenWorldHint: jsonschema.Ptr(true), |
| 835 | }, |
| 836 | InputSchema: &jsonschema.Schema{ |
| 837 | Type: "object", |
| 838 | Properties: map[string]*jsonschema.Schema{ |
| 839 | "owner": { |
| 840 | Type: "string", |
| 841 | Description: "Repository owner (username or organization)", |
| 842 | }, |
| 843 | "repo": { |
| 844 | Type: "string", |
| 845 | Description: "Repository name", |
| 846 | }, |
| 847 | "issue_number": { |
| 848 | Type: "number", |
| 849 | Description: "The parent issue number", |
| 850 | Minimum: jsonschema.Ptr(1.0), |
| 851 | }, |
| 852 | "sub_issue_id": { |
| 853 | Type: "number", |
| 854 | Description: "The ID of the sub-issue to reorder. ID is not the same as issue number", |
| 855 | }, |
| 856 | "after_id": { |
| 857 | Type: "number", |
| 858 | Description: "The ID of the sub-issue to place this after (either after_id OR before_id should be specified)", |
| 859 | }, |
| 860 | "before_id": { |
| 861 | Type: "number", |
| 862 | Description: "The ID of the sub-issue to place this before (either after_id OR before_id should be specified)", |
| 863 | }, |
| 864 | }, |
| 865 | Required: []string{"owner", "repo", "issue_number", "sub_issue_id"}, |
| 866 | }, |
| 867 | }, |
| 868 | []scopes.Scope{scopes.Repo}, |
| 869 | func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) { |
| 870 | owner, err := RequiredParam[string](args, "owner") |
| 871 | if err != nil { |
| 872 | return utils.NewToolResultError(err.Error()), nil, nil |
| 873 | } |
| 874 | repo, err := RequiredParam[string](args, "repo") |
| 875 | if err != nil { |
| 876 | return utils.NewToolResultError(err.Error()), nil, nil |
| 877 | } |
| 878 | issueNumber, err := RequiredInt(args, "issue_number") |
| 879 | if err != nil { |
| 880 | return utils.NewToolResultError(err.Error()), nil, nil |
| 881 | } |
no test coverage detected