tools

package
v0.0.92 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOptions added in v0.0.79

type CallOptions struct {
	ProgressToken      any
	LogData            map[string]any
	ReturnInput        bool
	ReturnOutput       bool
	Target             any
	ToolCallInvocation *ToolCallInvocation
	Meta               map[string]any
}

func (CallOptions) Merge added in v0.0.79

func (o CallOptions) Merge(other CallOptions) (result CallOptions)

type ListToolsOptions

type ListToolsOptions struct {
	Servers []string
	Tools   []string
}

type ListToolsResult

type ListToolsResult struct {
	Server string     `json:"server,omitempty"`
	Tools  []mcp.Tool `json:"tools,omitempty"`
}

type Options added in v0.0.79

type Options struct {
	Roots                         []mcp.Root
	Concurrency                   int
	CallbackHandler               mcp.CallbackHandler
	OAuthRedirectURL              string
	TokenStorage                  mcp.TokenStorage
	TokenExchangeEndpoint         string
	TokenExchangeClientID         string
	TokenExchangeClientSecret     string
	OAuthClientIDMetadataDocument string
	AuditLogCollector             auditlogs.Collector
	BlockLoopback                 bool
	BlockPrivateIP                bool
	BlockLinkLocal                bool
	AllowedHosts                  []string
}

func (Options) Complete added in v0.0.79

func (r Options) Complete() Options

func (Options) Merge added in v0.0.79

func (r Options) Merge(other Options) (result Options)

type SampleCallOptions

type SampleCallOptions struct {
	ProgressToken any
}

func (SampleCallOptions) Merge added in v0.0.79

func (s SampleCallOptions) Merge(other SampleCallOptions) (result SampleCallOptions)

type Sampler

type Sampler interface {
	Sample(ctx context.Context, sampling mcp.CreateMessageRequest, opts ...sampling.SamplerOptions) (*types.CallResult, error)
}

type Service added in v0.0.79

type Service struct {
	// contains filtered or unexported fields
}

func NewToolsService added in v0.0.79

func NewToolsService(opts ...Options) *Service

func (*Service) AddServer added in v0.0.79

func (s *Service) AddServer(name string, factory func(name string) mcp.MessageHandler)

func (*Service) BuildToolMappings added in v0.0.79

func (s *Service) BuildToolMappings(ctx context.Context, toolList []string, opts ...types.BuildToolMappingsOptions) (types.ToolMappings, error)

func (*Service) Call added in v0.0.79

func (s *Service) Call(ctx context.Context, server, tool string, args any, opts ...CallOptions) (ret *types.CallResult, err error)

func (*Service) GetAgentAttributes added in v0.0.79

func (s *Service) GetAgentAttributes(_ context.Context, name string) (agentConfigName string, agentAttribute map[string]any, _ error)

func (*Service) GetClient added in v0.0.79

func (s *Service) GetClient(ctx context.Context, name string) (*mcp.Client, error)

func (*Service) GetDynamicInstruction added in v0.0.79

func (s *Service) GetDynamicInstruction(ctx context.Context, instruction types.DynamicInstructions) (string, error)

func (*Service) GetPrompt added in v0.0.79

func (s *Service) GetPrompt(ctx context.Context, target, prompt string, args map[string]string) (*mcp.GetPromptResult, error)

func (*Service) ListTools added in v0.0.79

func (s *Service) ListTools(ctx context.Context, opts ...ListToolsOptions) (result []ListToolsResult, _ error)

func (*Service) RunHook added in v0.0.79

func (s *Service) RunHook(ctx context.Context, in, out any, target string) (hasOutput bool, _ error)

func (*Service) SetSampler added in v0.0.79

func (s *Service) SetSampler(sampler Sampler)

type ToolCallInvocation added in v0.0.79

type ToolCallInvocation struct {
	MessageID string         `json:"messageID,omitempty"`
	ItemID    string         `json:"itemID,omitempty"`
	ToolCall  types.ToolCall `json:"toolCall,omitempty"`
}

Jump to

Keyboard shortcuts

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