tools

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tools provides the tools infrastructure for the Cortex MCP platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages all available tools

func NewManager

func NewManager(logger *logging.Logger) *Manager

NewManager creates a new tools manager

func (*Manager) GetAllTools

func (m *Manager) GetAllTools() []*domain.Tool

GetAllTools returns all tool definitions from all providers

func (*Manager) RegisterProvider

func (m *Manager) RegisterProvider(provider ToolProvider)

RegisterProvider registers an external tool provider

type ToolProvider

type ToolProvider interface {
	// RegisterTool registers the tool with the provided registry
	RegisterTool(registerFunc func(string, func(context.Context, map[string]interface{}, *domain.ClientSession) (interface{}, error)))

	// GetToolDefinitions returns the tool definitions
	GetToolDefinitions() []*domain.Tool
}

ToolProvider is an interface for a service that provides tools

type ToolRegistry

type ToolRegistry interface {
	RegisterToolHandler(name string, handler func(ctx context.Context, params map[string]interface{}, session *domain.ClientSession) (interface{}, error))
}

ToolRegistry provides registration methods for tool handlers

Jump to

Keyboard shortcuts

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