Documentation
¶
Overview ¶
Package router provides smart MCP server selection using a fast AI model to determine which servers are relevant to a user's question.
Index ¶
Constants ¶
View Source
const ( // DefaultTimeout is the maximum time allowed for the routing call. DefaultTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func DefaultMaxTokens ¶
func DefaultMaxTokens() int
DefaultMaxTokens returns the max tokens for routing responses.
func Route ¶
func Route(ctx context.Context, client MessageSender, question string, servers []ServerInfo) []string
Route uses a fast AI model to select which MCP servers are relevant to the question. Returns server names. On any error, falls back to returning all servers.
Types ¶
type MessageSender ¶
MessageSender is the minimal interface needed for routing — just SendMessage.
type ServerInfo ¶
ServerInfo holds the name and description of an MCP server for routing decisions.
Click to show internal directories.
Click to hide internal directories.