Documentation
¶
Index ¶
- func ConvertMCPListToolsResultToOpenAITools(tools *mcp.ListToolsResult) []openai.ChatCompletionToolUnionParam
- func ConvertMCPListToolsResultToOpenAIToolsWithFilter(tools *mcp.ListToolsResult, toolsFilter []string) []openai.ChatCompletionToolUnionParam
- func ConvertMCPToolsToOpenAITools(tools []mcp.Tool) []openai.ChatCompletionToolUnionParam
- func ConvertMCPToolsToOpenAIToolsWithFilter(tools []mcp.Tool, toolsFilter []string) []openai.ChatCompletionToolUnionParam
- func Exec[I, O any](mcpClient *MCPClient, functionName string, input I) (O, error)
- type MCPClient
- func (c *MCPClient) Close() error
- func (c *MCPClient) ExecToolWithAny(functionName string, input any) (string, error)
- func (c *MCPClient) ExecToolWithMap(functionName string, input map[string]any) (string, error)
- func (c *MCPClient) ExecToolWithString(functionName string, input string) (string, error)
- func (c *MCPClient) GetTools() []mcp.Tool
- func (c *MCPClient) GetToolsWithFilter(toolsFilter []string) []mcp.Tool
- func (c *MCPClient) OpenAITools() []openai.ChatCompletionToolUnionParam
- func (c *MCPClient) OpenAIToolsWithFilter(toolsFilter []string) []openai.ChatCompletionToolUnionParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMCPListToolsResultToOpenAITools ¶
func ConvertMCPListToolsResultToOpenAITools(tools *mcp.ListToolsResult) []openai.ChatCompletionToolUnionParam
ConvertMCPListToolsResultToOpenAITools transforms MCP tool definitions into OpenAI tool format
func ConvertMCPListToolsResultToOpenAIToolsWithFilter ¶
func ConvertMCPListToolsResultToOpenAIToolsWithFilter(tools *mcp.ListToolsResult, toolsFilter []string) []openai.ChatCompletionToolUnionParam
ConvertMCPListToolsResultToOpenAIToolsWithFilter transforms filtered MCP tool definitions into OpenAI tool format
func ConvertMCPToolsToOpenAITools ¶
func ConvertMCPToolsToOpenAITools(tools []mcp.Tool) []openai.ChatCompletionToolUnionParam
func ConvertMCPToolsToOpenAIToolsWithFilter ¶
func ConvertMCPToolsToOpenAIToolsWithFilter(tools []mcp.Tool, toolsFilter []string) []openai.ChatCompletionToolUnionParam
Types ¶
type MCPClient ¶
type MCPClient struct {
ToolsResult *mcp.ListToolsResult
// contains filtered or unexported fields
}
MCPClient wraps an MCP client connection with available tools
func NewStdioMCPClient ¶
func NewStreamableHttpMCPClient ¶
NewStreamableHttpMCPClient creates and initializes a new MCP client over HTTP
func (*MCPClient) ExecToolWithAny ¶
func (*MCPClient) ExecToolWithMap ¶
func (*MCPClient) ExecToolWithString ¶
func (*MCPClient) GetToolsWithFilter ¶
GetToolsWithFilter returns only the tools that match the provided filter names
func (*MCPClient) OpenAITools ¶
func (c *MCPClient) OpenAITools() []openai.ChatCompletionToolUnionParam
OpenAITools converts the MCP client's tools to OpenAI-compatible format
func (*MCPClient) OpenAIToolsWithFilter ¶
func (c *MCPClient) OpenAIToolsWithFilter(toolsFilter []string) []openai.ChatCompletionToolUnionParam
OpenAIToolsWithFilter converts only the filtered MCP tools to OpenAI-compatible format
Click to show internal directories.
Click to hide internal directories.