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

Method FindToolByName

pkg/inventory/registry.go:284–291  ·  view source on GitHub ↗

FindToolByName searches all tools for one matching the given name. Returns the tool, its toolset ID, and an error if not found. This searches ALL tools regardless of filters.

(toolName string)

Source from the content-addressed store, hash-verified

282// Returns the tool, its toolset ID, and an error if not found.
283// This searches ALL tools regardless of filters.
284func (r *Inventory) FindToolByName(toolName string) (*ServerTool, ToolsetID, error) {
285 for i := range r.tools {
286 if r.tools[i].Tool.Name == toolName {
287 return &r.tools[i], r.tools[i].Toolset.ID, nil
288 }
289 }
290 return nil, "", NewToolDoesNotExistError(toolName)
291}
292
293// HasToolset checks if any tool/resource/prompt belongs to the given toolset.
294func (r *Inventory) HasToolset(toolsetID ToolsetID) bool {

Callers 1

TestFindToolByNameFunction · 0.80

Calls 1

NewToolDoesNotExistErrorFunction · 0.85

Tested by 1

TestFindToolByNameFunction · 0.64