set_rpc_url
Configure the RPC URL to enable blockchain interactions on EDUCHAIN Agent Kit, ensuring seamless data queries and transaction execution.
Instructions
Set the RPC URL for blockchain interactions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | RPC URL to use for blockchain interactions |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"description": "RPC URL to use for blockchain interactions",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/blockchain.ts:50-52 (handler)The core handler function that sets the global `rpcUrl` variable, which is used by `getProvider()` to create the ethers.JsonRpcProvider instance.export function setRpcUrl(url: string): void { rpcUrl = url; }
- src/index.ts:970-984 (registration)MCP tool dispatch/registration in the CallToolRequestSchema handler. Validates input and calls the blockchain.setRpcUrl function.case 'set_rpc_url': { if (!args.url || typeof args.url !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'RPC URL is required'); } blockchain.setRpcUrl(args.url); return { content: [ { type: 'text', text: JSON.stringify({ success: true, rpcUrl: args.url }, null, 2), }, ], };
- src/index.ts:403-414 (schema)Tool schema definition provided in ListToolsRequestSchema response, defining input validation schema.name: 'set_rpc_url', description: 'Set the RPC URL for blockchain interactions', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'RPC URL to use for blockchain interactions', }, }, required: ['url'], },