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

Function generateToolsetsDoc

cmd/github-mcp-server/generate_docs.go:150–170  ·  view source on GitHub ↗
(i *inventory.Inventory)

Source from the content-addressed store, hash-verified

148}
149
150func generateToolsetsDoc(i *inventory.Inventory) string {
151 var buf strings.Builder
152
153 // Add table header and separator (with icon column)
154 buf.WriteString("| | Toolset | Description |\n")
155 buf.WriteString("| --- | ----------------------- | ------------------------------------------------------------- |\n")
156
157 // Add the context toolset row with custom description (strongly recommended)
158 // Get context toolset for its icon
159 contextIcon := octiconImg("person")
160 fmt.Fprintf(&buf, "| %s | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |\n", contextIcon)
161
162 // AvailableToolsets() returns toolsets that have tools, sorted by ID
163 // Exclude context (custom description above)
164 for _, ts := range i.AvailableToolsets("context") {
165 icon := octiconImg(ts.Icon)
166 fmt.Fprintf(&buf, "| %s | `%s` | %s |\n", icon, ts.ID, ts.Description)
167 }
168
169 return strings.TrimSuffix(buf.String(), "\n")
170}
171
172func generateToolsDoc(r *inventory.Inventory) string {
173 tools := r.ToolsForRegistration(context.Background())

Callers 1

generateReadmeDocsFunction · 0.85

Calls 3

octiconImgFunction · 0.85
AvailableToolsetsMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected