Documentation
¶
Overview ¶
Copyright 2026 Teradata
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Teradata ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package registry provides tool indexing and search capabilities. It maintains an FTS5 index of all available tools (builtin, MCP, custom) and supports LLM-assisted search for high accuracy tool discovery.
Copyright 2026 Teradata ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type BuiltinIndexer
- type Config
- type CustomIndexer
- type Indexer
- type MCPIndexer
- type Registry
- func (r *Registry) Close() error
- func (r *Registry) GetTool(ctx context.Context, toolID string) (*loomv1.IndexedTool, error)
- func (r *Registry) GetToolsByCapability(ctx context.Context, capability string, sourceFilters []loomv1.ToolSource, ...) ([]*loomv1.IndexedTool, error)
- func (r *Registry) IndexAll(ctx context.Context) (*loomv1.IndexToolsResponse, error)
- func (r *Registry) ListSources(ctx context.Context) ([]*loomv1.ToolSourceInfo, error)
- func (r *Registry) Search(ctx context.Context, req *loomv1.SearchToolsRequest) (*loomv1.SearchToolsResponse, error)
- type SearchTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltinIndexer ¶
type BuiltinIndexer struct {
// contains filtered or unexported fields
}
BuiltinIndexer indexes builtin tools from pkg/shuttle.
func NewBuiltinIndexer ¶
func NewBuiltinIndexer(tracer observability.Tracer, tools ...shuttle.Tool) *BuiltinIndexer
NewBuiltinIndexer creates a new builtin tool indexer. If no tools provided, it will use builtin.All(nil) to get all builtin tools.
func (*BuiltinIndexer) Index ¶
func (i *BuiltinIndexer) Index(ctx context.Context) ([]*loomv1.IndexedTool, error)
Index indexes all builtin tools.
func (*BuiltinIndexer) Source ¶
func (i *BuiltinIndexer) Source() loomv1.ToolSource
Source returns the tool source type.
type Config ¶
type Config struct {
DBPath string // Path to SQLite database
LLM types.LLMProvider // LLM provider for search assistance
Tracer observability.Tracer
Indexers []Indexer // Tool source indexers
}
Config holds registry configuration.
type CustomIndexer ¶
type CustomIndexer struct {
// contains filtered or unexported fields
}
CustomIndexer indexes custom tool definitions from YAML files.
func NewCustomIndexer ¶
func NewCustomIndexer(configPath string, tracer observability.Tracer) *CustomIndexer
NewCustomIndexer creates a new custom tool indexer.
func (*CustomIndexer) Index ¶
func (i *CustomIndexer) Index(ctx context.Context) ([]*loomv1.IndexedTool, error)
Index indexes custom tool definitions.
func (*CustomIndexer) Source ¶
func (i *CustomIndexer) Source() loomv1.ToolSource
Source returns the tool source type.
type Indexer ¶
type Indexer interface {
// Name returns the indexer name for logging.
Name() string
// Source returns the tool source type.
Source() loomv1.ToolSource
// Index indexes all tools from this source.
Index(ctx context.Context) ([]*loomv1.IndexedTool, error)
}
Indexer is an interface for tool source indexers.
type MCPIndexer ¶
type MCPIndexer struct {
// contains filtered or unexported fields
}
MCPIndexer indexes tools from MCP servers.
func NewMCPIndexer ¶
func NewMCPIndexer(mgr *manager.Manager, tracer observability.Tracer) *MCPIndexer
NewMCPIndexer creates a new MCP tool indexer.
func (*MCPIndexer) Index ¶
func (i *MCPIndexer) Index(ctx context.Context) ([]*loomv1.IndexedTool, error)
Index indexes tools from all connected MCP servers.
func (*MCPIndexer) Source ¶
func (i *MCPIndexer) Source() loomv1.ToolSource
Source returns the tool source type.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the tool index and provides search capabilities.
func (*Registry) GetToolsByCapability ¶
func (r *Registry) GetToolsByCapability(ctx context.Context, capability string, sourceFilters []loomv1.ToolSource, maxResults int) ([]*loomv1.IndexedTool, error)
GetToolsByCapability returns tools with a specific capability tag.
func (*Registry) ListSources ¶
ListSources returns all registered tool sources.
func (*Registry) Search ¶
func (r *Registry) Search(ctx context.Context, req *loomv1.SearchToolsRequest) (*loomv1.SearchToolsResponse, error)
Search performs LLM-assisted tool search.
type SearchTool ¶
type SearchTool struct {
// contains filtered or unexported fields
}
SearchTool is a builtin tool that enables agents to search for tools. It provides LLM-assisted tool discovery with high accuracy.
func NewSearchTool ¶
func NewSearchTool(registry *Registry) *SearchTool
NewSearchTool creates a new tool search tool.
func (*SearchTool) Backend ¶
func (t *SearchTool) Backend() string
Backend returns empty string as this tool is backend-agnostic.
func (*SearchTool) Description ¶
func (t *SearchTool) Description() string
Description returns the tool description.
func (*SearchTool) Execute ¶
func (t *SearchTool) Execute(ctx context.Context, params map[string]interface{}) (*shuttle.Result, error)
Execute searches for tools matching the query.
func (*SearchTool) InputSchema ¶
func (t *SearchTool) InputSchema() *shuttle.JSONSchema
InputSchema returns the JSON schema for tool parameters.