Skip to main content
Glama
desk3
by desk3

get_suggest_gas

Retrieve EIP1559 gas fee estimates for blockchain transactions by specifying a network chain ID to optimize transaction costs.

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

  • The core handler function that implements the get_suggest_gas tool logic by querying the Desk3 API 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}")
  • The JSON schema defining the input parameters for the get_suggest_gas tool, registered in list_tools().
        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"],
        },
    ),
  • The dispatch logic in the MCP server's call_tool handler that invokes the get_suggest_gas function upon tool call.
    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}")
  • Helper function used by get_suggest_gas to make authenticated API requests to the Desk3 endpoints.
    def request_api(method: str, url: str, params: dict = None, data: dict = None) -> any:
        headers = {
            'Accepts': 'application/json',
            'X-DESK3_PRO_API_KEY': API_KEY,
        }
        try:
            logging.info(f"Requesting {method.upper()} {url} params={params} data={data}")
            if method.lower() == 'get':
                response = requests.get(url, headers=headers, params=params)
            elif method.lower() == 'post':
                response = requests.post(url, headers=headers, json=data)
            else:
                raise ValueError(f"Unsupported HTTP method: {method}")
            response.raise_for_status()
            logging.info(f"Response {response.status_code} for {url}")
            return json.loads(response.text)
        except Exception as e:
            logging.error(f"Error during {method.upper()} {url}: {e}")
            raise
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool returns ('estimated gas info') but doesn't describe the return format, whether it's real-time or cached data, rate limits, error conditions, or authentication requirements. The description is minimal and leaves critical behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates the core purpose and key requirement. There's no wasted language or unnecessary elaboration, making it efficiently front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'estimated gas info' includes (base fee, priority fee, etc.), doesn't mention typical use cases, and provides no context about the data source or reliability. Given the complexity of blockchain gas estimation, more contextual information would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'chainid' well-documented in the schema. The description adds minimal value beyond the schema by mentioning 'chainid required,' which is already clear from the required field. This meets the baseline for high schema coverage scenarios.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('EIP1559 estimated gas info'), making the purpose understandable. However, it doesn't differentiate this tool from its many siblings (like get_exchange_rate or get_token_price), which all appear to retrieve different types of cryptocurrency/blockchain data but share similar naming patterns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'chainid required' as a parameter requirement, but doesn't explain use cases, prerequisites, or how this differs from other gas estimation tools that might exist outside this server.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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