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)
| 282 | // Returns the tool, its toolset ID, and an error if not found. |
| 283 | // This searches ALL tools regardless of filters. |
| 284 | func (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. |
| 294 | func (r *Inventory) HasToolset(toolsetID ToolsetID) bool { |