IndexToolsToIndex 将工具添加到工具索引(延迟加载模式)
(index *search.ToolIndex)
| 174 | |
| 175 | // IndexToolsToIndex 将工具添加到工具索引(延迟加载模式) |
| 176 | func (s *MCPServer) IndexToolsToIndex(index *search.ToolIndex) error { |
| 177 | entries := s.GetToolIndexEntries() |
| 178 | for _, entry := range entries { |
| 179 | if err := index.IndexToolEntry(entry); err != nil { |
| 180 | return fmt.Errorf("index tool %s: %w", entry.Name, err) |
| 181 | } |
| 182 | } |
| 183 | return nil |
| 184 | } |
no test coverage detected