MCPcopy Index your code
hub / github.com/github/github-mcp-server / UIGet

Function UIGet

pkg/github/ui_tools.go:33–104  ·  view source on GitHub ↗

UIGet creates a tool to fetch UI data for MCP Apps.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

31
32// UIGet creates a tool to fetch UI data for MCP Apps.
33func UIGet(t translations.TranslationHelperFunc) inventory.ServerTool {
34 st := NewTool(
35 ToolsetMetadataContext, // Use context toolset so it's always available
36 mcp.Tool{
37 Name: "ui_get",
38 Description: t("TOOL_UI_GET_DESCRIPTION", "Fetch UI data for MCP Apps (labels, assignees, milestones, issue types, branches, issue fields, reviewers)."),
39 Annotations: &mcp.ToolAnnotations{
40 Title: t("TOOL_UI_GET_USER_TITLE", "Get UI data"),
41 ReadOnlyHint: true,
42 },
43 // ui_get only backs MCP App views; declaring app-only visibility keeps
44 // it out of the agent's tool list while remaining callable by the views
45 // via tools/call (per the MCP Apps 2026-01-26 spec).
46 Meta: mcp.Meta{
47 "ui": map[string]any{
48 "visibility": []string{"app"},
49 },
50 },
51 InputSchema: &jsonschema.Schema{
52 Type: "object",
53 Properties: map[string]*jsonschema.Schema{
54 "method": {
55 Type: "string",
56 Enum: []any{"labels", "assignees", "milestones", "issue_types", "branches", "issue_fields", "reviewers"},
57 Description: "The type of data to fetch",
58 },
59 "owner": {
60 Type: "string",
61 Description: "Repository owner (required for all methods)",
62 },
63 "repo": {
64 Type: "string",
65 Description: "Repository name (required for labels, assignees, milestones, branches, issue fields, reviewers)",
66 },
67 },
68 Required: []string{"method", "owner"},
69 },
70 },
71 []scopes.Scope{scopes.Repo, scopes.ReadOrg},
72 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
73 method, err := RequiredParam[string](args, "method")
74 if err != nil {
75 return utils.NewToolResultError(err.Error()), nil, nil
76 }
77
78 owner, err := RequiredParam[string](args, "owner")
79 if err != nil {
80 return utils.NewToolResultError(err.Error()), nil, nil
81 }
82
83 switch method {
84 case "labels":
85 return uiGetLabels(ctx, deps, args, owner)
86 case "assignees":
87 return uiGetAssignees(ctx, deps, args, owner)
88 case "milestones":
89 return uiGetMilestones(ctx, deps, args, owner)
90 case "issue_types":

Callers 2

AllToolsFunction · 0.85
Test_UIGetFunction · 0.85

Calls 10

NewToolResultErrorFunction · 0.92
NewToolFunction · 0.85
uiGetLabelsFunction · 0.85
uiGetAssigneesFunction · 0.85
uiGetMilestonesFunction · 0.85
uiGetIssueTypesFunction · 0.85
uiGetBranchesFunction · 0.85
uiGetIssueFieldsFunction · 0.85
uiGetReviewersFunction · 0.85
ErrorMethod · 0.45

Tested by 1

Test_UIGetFunction · 0.68