estimate_gas_cost
Calculate transaction gas costs by specifying gas limit, confidence level, and blockchain network. Optimize gas fees with accurate predictions tailored to your transaction requirements.
Instructions
Estimate gas cost for a transaction based on gas limit, confidence level, and chain.
Parameters:
- gas_limit (int): The gas limit for the transaction (e.g., 21000 for a simple transfer).
- confidence (int): The confidence level for gas price prediction (0-100).
- chain_id (int): The ID of the blockchain network (e.g., 1 for Ethereum Mainnet). Default: 1.
- ctx (Optional[Context]): The MCP context object. Default: None.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
chain_id | No | ||
confidence | No | ||
ctx | No | ||
gas_limit | Yes |
Input Schema (JSON Schema)
{
"$defs": {
"Context": {
"description": "Context object providing access to MCP capabilities.\n\nThis provides a cleaner interface to MCP's RequestContext functionality.\nIt gets injected into tool and resource functions that request it via type hints.\n\nTo use context in a tool function, add a parameter with the Context type annotation:\n\n```python\n@server.tool()\ndef my_tool(x: int, ctx: Context) -> str:\n # Log messages to the client\n ctx.info(f\"Processing {x}\")\n ctx.debug(\"Debug info\")\n ctx.warning(\"Warning message\")\n ctx.error(\"Error message\")\n\n # Report progress\n ctx.report_progress(50, 100)\n\n # Access resources\n data = ctx.read_resource(\"resource://data\")\n\n # Get request info\n request_id = ctx.request_id\n client_id = ctx.client_id\n\n return str(x)\n```\n\nThe context parameter name can be anything as long as it's annotated with Context.\nThe context is optional - tools that don't need it can omit the parameter.",
"properties": {},
"title": "Context",
"type": "object"
}
},
"properties": {
"chain_id": {
"default": 1,
"title": "Chain Id",
"type": "integer"
},
"confidence": {
"default": 99,
"title": "Confidence",
"type": "integer"
},
"ctx": {
"anyOf": [
{
"$ref": "#/$defs/Context"
},
{
"type": "null"
}
],
"default": null
},
"gas_limit": {
"title": "Gas Limit",
"type": "integer"
}
},
"required": [
"gas_limit"
],
"title": "estimate_gas_costArguments",
"type": "object"
}