From 48d45414cc01efca2b3b8b9f21dc31118166f35f Mon Sep 17 00:00:00 2001 From: Miles <1359698378@qq.com> Date: Sun, 22 Jun 2025 15:29:41 +0000 Subject: [PATCH] Fix boolean parameter type in rpcTools, change it from string to boolean, and convert boolean to string on execution to comply with Etherscan API requirements. --- src/core/tools/rpcTools.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/tools/rpcTools.ts b/src/core/tools/rpcTools.ts index 8a9ecf3..9f88375 100644 --- a/src/core/tools/rpcTools.ts +++ b/src/core/tools/rpcTools.ts @@ -22,11 +22,17 @@ export function registerRpcTools(server: FastMCP) { description: "Returns information about a block by block number.", parameters: z.object({ tag: z.string().describe("the block number, in hex eg. `0xC36B3C`"), - boolean: z.string().describe("the `boolean` value to show full transaction objects. when `true`, returns full transaction objects and their information, when `false` only returns a list of transactions."), + boolean: z.boolean().describe("when `true`, returns full transaction objects and their information, when `false` only returns a list of transactions."), chainid: z.string().optional().default("1").describe("chain id, default 1 ( Ethereum )"), }), execute: async (params) => { - const fullParams = { ...params, module: "proxy", action: "eth_getBlockByNumber" }; + // Convert boolean to string as required by Etherscan API + const fullParams = { + ...params, + boolean: params.boolean.toString(), + module: "proxy", + action: "eth_getBlockByNumber" + }; return await apiCall(fullParams); } });