get_eth_trend
Analyze Ethereum's price and network activity trends over the past three months with historical data on active and new addresses.
Instructions
Get the ETH trend chart for the past three months. Format: [[date, price, active addresses, new addresses]]
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/desk3_service/server.py:132-142 (handler)The handler function that fetches and returns the ETH trend data from the Desk3 API endpoint.async def get_eth_trend() -> list[list]: """ Get the ETH trend chart for the past three months. :return: List of [date, price, active addresses, new addresses] """ url = 'https://mcp.desk3.io/v1/market/eth/trend' try: return request_api('get', url) except Exception as e: raise RuntimeError(f"Failed to fetch ETH trend data: {e}")
- src/desk3_service/server.py:609-617 (schema)JSON schema definition for the get_eth_trend tool in the list_tools handler, specifying no required input parameters.types.Tool( name="get_eth_trend", description="Get the ETH trend chart for the past three months. Format: [[date, price, active addresses, new addresses]]", inputSchema={ "type": "object", "properties": {}, "required": [], }, ),
- src/desk3_service/server.py:795-805 (registration)Registration and execution logic for the get_eth_trend tool in the handle_call_tool function.case "get_eth_trend": try: data = await get_eth_trend() return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch ETH trend data: {e}")
- src/desk3_service/server.py:23-42 (helper)Helper function used by get_eth_trend to make authenticated API requests to the Desk3 service.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