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

Method ToolsForRegistration

pkg/inventory/registry.go:185–191  ·  view source on GitHub ↗

ToolsForRegistration returns AvailableTools(ctx) post-processed exactly as RegisterTools would expose them: with MCP Apps UI metadata stripped when the client cannot consume it. Useful for documentation generators and diagnostics that need the same view of the tool surface the server would register.

(ctx context.Context)

Source from the content-addressed store, hash-verified

183// capability is unknown (e.g. stdio paths that do not populate the
184// context flag) the feature-flag gate is the sole source of truth.
185func (r *Inventory) ToolsForRegistration(ctx context.Context) []ServerTool {
186 tools := r.AvailableTools(ctx)
187 if shouldStripMCPAppsMetadata(ctx, r.checkFeatureFlag(ctx, mcpAppsFeatureFlag)) {
188 tools = stripMCPAppsMetadata(tools)
189 }
190 return tools
191}
192
193// shouldStripMCPAppsMetadata centralises the strip decision so the same logic
194// is exercised by tests and by RegisterTools.

Callers 6

RegisterToolsMethod · 0.95
captureRegisteredToolsFunction · 0.80
generateFlaggedToolsDocFunction · 0.80
flaggedToolDiffFunction · 0.80
generateToolsDocFunction · 0.80

Calls 4

AvailableToolsMethod · 0.95
checkFeatureFlagMethod · 0.95
stripMCPAppsMetadataFunction · 0.85