Documentation
¶
Overview ¶
Package registry collects MCP tool registrations as plain descriptors and binds them to a server in one pass, so the catalogue can be enumerated and filtered without a live server. Write tools are gated behind Enable.Write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Access ¶
type Access int
Access classifies a tool read-only or state-mutating; Bind gates writes.
type Enable ¶
type Enable struct {
Write bool
}
Enable selects which registrations Bind installs; Write gates writes.
type Option ¶
type Option[In any] func(*options[In])
Option configures a Read/Write registration; In is usually inferred.
func WithElicitFunc ¶
func WithElicitFunc[In any](f toolkit.ElicitParamsFunc[In]) Option[In]
WithElicitFunc sets a write tool's elicit-prompt builder; on Read panics.
func WithOutputSchema ¶
func WithOutputSchema[In any](s *jsonschema.Schema) Option[In]
WithOutputSchema sets the tool's optional output schema (pin In if alone).
func WithValidateFunc ¶
func WithValidateFunc[In any](f toolkit.ValidateFunc[In]) Option[In]
WithValidateFunc sets a validator run on decoded input before the call.
type Registration ¶
Registration is a server-independent description of one tool.
func Read ¶
func Read[In, Out any]( name, description string, in *jsonschema.Schema, call toolkit.CallFunc[In, Out], opts ...Option[In], ) Registration
Read describes a read-only tool. In/Out are inferred from call.
func Write ¶
func Write[In, Out any]( name, description string, in *jsonschema.Schema, call toolkit.CallFunc[In, Out], opts ...Option[In], ) Registration
Write describes a state-mutating tool gated by elicitation; In/Out inferred.
type Registry ¶
type Registry []Registration
Registry is an ordered, server-independent collection of registrations.
func New ¶
func New(groups ...[]Registration) Registry
New flattens tool-group slices into a Registry, preserving order.