Help us shape the future of Go! Take the 2026 Go Developer Survey

tooldiscovery

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxSearchResults = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SearchOptions

type SearchOptions struct {
	MaxResults int `json:"maxResults"` // Maximum number of results to return (default: 3)
}

SearchOptions configures search behavior.

type SearchResult

type SearchResult struct {
	Tool      mcp.Tool `json:"tool"`
	Score     float64  `json:"score"`
	MatchedIn []string `json:"matchedIn"` // Signals that contributed to scoring (e.g. name:token, description, parameter:token).
}
func Search(query string, options ...SearchOptions) ([]SearchResult, error)

Search returns the most relevant tools for a free-text query.

Prefer using SearchTools and passing an explicit tool list. This function is kept for API compatibility and currently searches an empty tool set.

func SearchTools

func SearchTools(tools []mcp.Tool, query string, options ...SearchOptions) ([]SearchResult, error)

SearchTools is like Search, but searches across the provided tool list.

Matching uses a weighted combination of:

  • tool name matches (strongest)
  • description matches
  • input parameter name matches (JSON schema property names)
  • fuzzy similarity as a tie-breaker

Empty or whitespace-only queries return (nil, nil).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL