Bankless Onchain MCP Server

Official

read_contract

Read and decode blockchain contract states by specifying contract addresses, methods, input parameters, and expected output types, ensuring accurate data retrieval for nested structs and tuples.

Instructions

Read contract state from a blockchain. important:

In case of a tuple, don't use type tuple, but specify the inner types (found in the source) in order. For nested structs, include the substructs types. Example: struct DataTypeA { DataTypeB b; //the liquidity index. Expressed in ray uint128 liquidityIndex; } struct DataTypeB { address token; } results in outputs for function with return type DataTypeA (tuple in abi): outputs: [{"type": "address"}, {"type": "uint128"}]

Input Schema

NameRequiredDescriptionDefault
contractYesThe contract address
inputsYesInput parameters for the method call
methodYesThe contract method to call
networkYesThe blockchain network (e.g., "ethereum", "base")
outputsYesExpected output types for the method call. In case of a tuple, don't use type tuple, but specify the inner types (found in the source) in order. For nested structs, include the substructs types. Example: struct DataTypeA { DataTypeB b; //the liquidity index. Expressed in ray uint128 liquidityIndex; } struct DataTypeB { address token; } results in outputs for function with return type DataTypeA (tuple in abi): outputs: [{"type": "address"}, {"type": "uint128"}]

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "contract": { "description": "The contract address", "type": "string" }, "inputs": { "description": "Input parameters for the method call", "items": { "additionalProperties": false, "properties": { "type": { "description": "The type of the input parameter", "type": "string" }, "value": { "description": "The value of the input parameter" } }, "required": [ "type" ], "type": "object" }, "type": "array" }, "method": { "description": "The contract method to call", "type": "string" }, "network": { "description": "The blockchain network (e.g., \"ethereum\", \"base\")", "type": "string" }, "outputs": { "description": "Expected output types for the method call. \n In case of a tuple, don't use type tuple, but specify the inner types (found in the source) in order. For nested structs, include the substructs types.\n \n Example: \n struct DataTypeA {\n DataTypeB b;\n //the liquidity index. Expressed in ray\n uint128 liquidityIndex;\n }\n \n struct DataTypeB {\n address token;\n }\n \n results in outputs for function with return type DataTypeA (tuple in abi): outputs: [{\"type\": \"address\"}, {\"type\": \"uint128\"}]\n ", "items": { "additionalProperties": false, "properties": { "components": { "description": "optional components for tuple types", "items": { "$ref": "#/properties/outputs/items" }, "type": "array" }, "type": { "description": "Expected output types for the method call. \n In case of a tuple, don't use type tuple, but specify the inner types (found in the source) in order. For nested structs, include the substructs types.\n \n Example: \n struct DataTypeA {\n DataTypeB b;\n //the liquidity index. Expressed in ray\n uint128 liquidityIndex;\n }\n \n struct DataTypeB {\n address token;\n }\n \n results in outputs for function with return type DataTypeA (tuple in abi): outputs: [{\"type\": \"address\"}, {\"type\": \"uint128\"}]\n ", "type": "string" } }, "required": [ "type" ], "type": "object" }, "type": "array" } }, "required": [ "network", "contract", "method", "inputs", "outputs" ], "type": "object" }

You must be authenticated.

Other Tools from Bankless Onchain MCP Server

Related Tools

ID: uawv4sbvqj