Skip to main content
Glama

get_suggest_gas

Retrieve EIP1559 gas fee estimates for blockchain transactions using a specific chain ID with Desk3 MCP Server, enabling efficient transaction planning and cost optimization.

Instructions

Get EIP1559 estimated gas info (chainid required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainidYesChain ID for the blockchain network (e.g., 1 for Ethereum mainnet, 137 for Polygon)

Implementation Reference

  • Core handler function implementing the logic for the get_suggest_gas tool by querying the Desk3 API endpoint for EIP1559 gas suggestions.
    async def get_suggest_gas(chainid: str) -> dict[str, Any]: """ Get EIP1559 estimated gas information. :param chainid: Chain ID, required :return: Gas suggestion and trend information """ url = 'https://mcp.desk3.io/v1/price/getSuggestGas' params = {'chainid': chainid} try: return request_api('get', url, params=params) except Exception as e: raise RuntimeError(f"Failed to fetch suggest gas data: {e}")
  • JSON Schema defining the input parameters for the get_suggest_gas tool, requiring a 'chainid' string parameter.
    inputSchema={ "type": "object", "properties": { "chainid": { "type": "string", "description": "Chain ID for the blockchain network (e.g., 1 for Ethereum mainnet, 137 for Polygon)", "examples": ["1", "137", "56", "42161"], "pattern": "^[0-9]+$" }, }, "required": ["chainid"], },
  • Registration of the get_suggest_gas tool in the server's list_tools method, including name, description, and input schema.
    types.Tool( name="get_suggest_gas", description="Get EIP1559 estimated gas info (chainid required)", inputSchema={ "type": "object", "properties": { "chainid": { "type": "string", "description": "Chain ID for the blockchain network (e.g., 1 for Ethereum mainnet, 137 for Polygon)", "examples": ["1", "137", "56", "42161"], "pattern": "^[0-9]+$" }, }, "required": ["chainid"], }, ),
  • MCP server tool dispatch handler for get_suggest_gas, which validates input, calls the core handler, formats JSON response, and returns as TextContent.
    case "get_suggest_gas": if not arguments or "chainid" not in arguments: raise ValueError("Missing required argument: chainid") chainid = arguments["chainid"] try: data = await get_suggest_gas(chainid=chainid) return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch suggest gas data: {e}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/desk3/cryptocurrency-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server