Methods
# async callTool(toolName, args, userContext, timeout, _retryCount) → {Promise.<Object>}
Call an MCP tool with arguments
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
toolName |
string
|
Name of the tool to call |
|
args |
Object
|
Tool arguments |
|
userContext |
Object
|
null | User context for authorization (passed to tool) |
timeout |
number
|
30000 | Timeout in milliseconds (default: 30000) |
_retryCount |
number
|
0 | Internal retry counter (do not set manually) |
Tool result
Promise.<Object>
# async connect()
Connect to the MCP server Spawns the server as a child process if not already running
# async forceReconnect()
Force reconnect - closes existing connection and spawns fresh MCP server Use this when MCP server code has changed
# async getTool(toolName) → {Promise.<(Object|null)>}
Get a specific tool definition by name
Parameters:
| Name | Type | Description |
|---|---|---|
toolName |
string
|
Name of the tool |
Tool definition or null if not found
Promise.<(Object|null)>
# async listTools() → {Promise.<Array>}
List all available tools
Array of tool definitions
Promise.<Array>