MCPcopy Create free account
hub / github.com/github/gh-aw / extractBuiltinMCPTools

Function extractBuiltinMCPTools

pkg/parser/mcp.go:231–256  ·  view source on GitHub ↗

extractBuiltinMCPTools reads the tools section and appends github/playwright configs to configs. It returns an error if a removed tool (serena) is present.

(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig)

Source from the content-addressed store, hash-verified

229// extractBuiltinMCPTools reads the tools section and appends github/playwright configs to configs.
230// It returns an error if a removed tool (serena) is present.
231func extractBuiltinMCPTools(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig) error {
232 toolsSection, hasTools := frontmatter["tools"]
233 if !hasTools {
234 return nil
235 }
236 tools, ok := toolsSection.(map[string]any)
237 if !ok {
238 return nil
239 }
240 for toolName, toolValue := range tools {
241 if toolName == "serena" {
242 return errors.New("tools.serena is removed")
243 }
244 if toolName == "github" || toolName == "playwright" {
245 config, err := processBuiltinMCPTool(toolName, toolValue, serverFilter)
246 if err != nil {
247 return err
248 }
249 if config != nil {
250 mcpLog.Printf("Added built-in MCP tool: %s", toolName)
251 *configs = append(*configs, *config)
252 }
253 }
254 }
255 return nil
256}
257
258// processBuiltinMCPTool handles built-in MCP tools (github and playwright)
259func processBuiltinMCPTool(toolName string, toolValue any, serverFilter string) (*RegistryMCPServerConfig, error) {

Callers 1

ExtractMCPConfigurationsFunction · 0.85

Calls 2

processBuiltinMCPToolFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected