You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: inline IssueWrite/LegacyIssueWrite as full duplicates
Replace the shared buildIssueWrite(includeIssueFields) helper with two
fully duplicated tool definitions. When the FeatureFlagIssueFields flag
is retired, LegacyIssueWrite can be deleted as a single function with no
merge thinking required.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description: t("TOOL_ISSUE_WRITE_DESCRIPTION", "Create a new or update an existing issue in a GitHub repository."),
2046
+
Annotations: &mcp.ToolAnnotations{
2047
+
Title: t("TOOL_ISSUE_WRITE_USER_TITLE", "Create or update issue"),
2048
+
ReadOnlyHint: false,
2049
+
},
2050
+
Meta: mcp.Meta{
2051
+
"ui": map[string]any{
2052
+
"resourceUri": IssueWriteUIResourceURI,
2053
+
"visibility": []string{"model", "app"},
2054
+
},
2055
+
},
2056
+
InputSchema: &jsonschema.Schema{
2057
+
Type: "object",
2058
+
Properties: map[string]*jsonschema.Schema{
2059
+
"method": {
2060
+
Type: "string",
2061
+
Description: `Write operation to perform on a single issue.
2062
+
Options are:
2063
+
- 'create' - creates a new issue.
2064
+
- 'update' - updates an existing issue.
2065
+
`,
2066
+
Enum: []any{"create", "update"},
2067
+
},
2068
+
"owner": {
2069
+
Type: "string",
2070
+
Description: "Repository owner",
2071
+
},
2072
+
"repo": {
2073
+
Type: "string",
2074
+
Description: "Repository name",
2075
+
},
2076
+
"issue_number": {
2077
+
Type: "number",
2078
+
Description: "Issue number to update",
2079
+
},
2080
+
"title": {
2081
+
Type: "string",
2082
+
Description: "Issue title",
2083
+
},
2084
+
"body": {
2085
+
Type: "string",
2086
+
Description: "Issue body content",
2087
+
},
2088
+
"assignees": {
2089
+
Type: "array",
2090
+
Description: "Usernames to assign to this issue",
2091
+
Items: &jsonschema.Schema{
2092
+
Type: "string",
2093
+
},
2094
+
},
2095
+
"labels": {
2096
+
Type: "array",
2097
+
Description: "Labels to apply to this issue",
2098
+
Items: &jsonschema.Schema{
2099
+
Type: "string",
2100
+
},
2101
+
},
2102
+
"milestone": {
2103
+
Type: "number",
2104
+
Description: "Milestone number",
2105
+
},
2106
+
"type": {
2107
+
Type: "string",
2108
+
Description: "Type of this issue. Only use if the repository has issue types configured. Use list_issue_types tool to get valid type values for the organization. If the repository doesn't support issue types, omit this parameter.",
2109
+
},
2110
+
"state": {
2111
+
Type: "string",
2112
+
Description: "New state",
2113
+
Enum: []any{"open", "closed"},
2114
+
},
2115
+
"state_reason": {
2116
+
Type: "string",
2117
+
Description: "Reason for the state change. Ignored unless state is changed.",
returnutils.NewToolResultError("issue_number is required for update method"), nil, nil
2158
+
}
2159
+
returnutils.NewToolResultText(fmt.Sprintf("Ready to update issue #%d in %s/%s. IMPORTANT: The issue has NOT been updated yet. Do NOT tell the user the issue was updated. The user MUST click Submit in the form to update it.", issueNumber, owner, repo)), nil, nil
2160
+
}
2161
+
} else {
2162
+
returnutils.NewToolResultText(fmt.Sprintf("Ready to create an issue in %s/%s. IMPORTANT: The issue has NOT been created yet. Do NOT tell the user the issue was created. The user MUST click Submit in the form to create it.", owner, repo)), nil, nil
0 commit comments