feat: add JSON-RPC MCP Call with ToolError

This commit is contained in:
2026-09-01 11:44:03 -05:00
parent 3b85bc4816
commit 076c8c81b8
3 changed files with 143 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package client
import (
"context"
"encoding/json"
"net/http"
)
// Client is a Robinhood Agentic MCP client.
type Client struct {
URL, Token, Name, Version string
HTTP *http.Client
Hook Caller
session any
}
// Call invokes an MCP tool by name and returns its JSON result.
func (c *Client) Call(ctx context.Context, name string, args map[string]any) (json.RawMessage, error) {
if c.Hook != nil {
return c.Hook.Call(ctx, name, args)
}
return c.rpcCall(ctx, name, args)
}