improved tool debugging

This commit is contained in:
Luxferre
2026-03-22 12:01:29 +02:00
parent 77d0d17c89
commit cd2de78c2c
16 changed files with 986 additions and 592 deletions
+4 -2
View File
@@ -19,7 +19,8 @@ type mcpGoClientWrapper struct {
client *client.Client
}
func (w *mcpGoClientWrapper) CallTool(ctx context.Context, name string, args map[string]interface{}) (string, error) {
func (w *mcpGoClientWrapper) CallTool(ctx context.Context, name string,
args map[string]interface{}) (string, error) {
req := mcp.CallToolRequest{}
req.Params.Name = name
req.Params.Arguments = args
@@ -130,7 +131,8 @@ func SetMCPClientFactory(factory MCPClientFactory) {
}
// CallExternalTool creates a scoped MCP connection, calls the tool, and cleans up
func CallExternalTool(ctx context.Context, toolset string, toolName string, args map[string]interface{}) (string, error) {
func CallExternalTool(ctx context.Context, toolset string, toolName string,
args map[string]interface{}) (string, error) {
c, err := defaultMCPFactory(toolset)
if err != nil {
return "", fmt.Errorf("failed to create MCP client for %s: %w", toolset, err)