Documentation
¶
Index ¶
- func ConvertMCPToolsToOpenAITools(tools *mcp.ListToolsResult) []openai.ChatCompletionToolUnionParam
- func ConvertMCPToolsToOpenAIToolsWithFilter(tools *mcp.ListToolsResult, toolsFilter []string) []openai.ChatCompletionToolUnionParam
- type MCPClient
- func (c *MCPClient) CallTool(ctx context.Context, functionName string, arguments string) (*mcp.CallToolResult, error)
- func (c *MCPClient) Close() error
- 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 ConvertMCPToolsToOpenAITools ¶
func ConvertMCPToolsToOpenAITools(tools *mcp.ListToolsResult) []openai.ChatCompletionToolUnionParam
ConvertMCPToolsToOpenAITools transforms MCP tool definitions into OpenAI tool format
func ConvertMCPToolsToOpenAIToolsWithFilter ¶ added in v0.0.1
func ConvertMCPToolsToOpenAIToolsWithFilter(tools *mcp.ListToolsResult, toolsFilter []string) []openai.ChatCompletionToolUnionParam
ConvertMCPToolsToOpenAIToolsWithFilter transforms filtered MCP tool definitions into OpenAI tool format
Types ¶
type MCPClient ¶
type MCPClient struct {
ToolsResult *mcp.ListToolsResult
// contains filtered or unexported fields
}
MCPClient wraps an MCP client connection with available tools
func NewStreamableHttpMCPClient ¶
NewStreamableHttpMCPClient creates and initializes a new MCP client over HTTP
func (*MCPClient) CallTool ¶
func (c *MCPClient) CallTool(ctx context.Context, functionName string, arguments string) (*mcp.CallToolResult, error)
CallTool executes a tool call with the given function name and JSON arguments
func (*MCPClient) OpenAITools ¶
func (c *MCPClient) OpenAITools() []openai.ChatCompletionToolUnionParam
OpenAITools converts the MCP client's tools to OpenAI-compatible format
func (*MCPClient) OpenAIToolsWithFilter ¶ added in v0.0.1
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.