Skip to main content
Glama

get_top_trending_tokens

Retrieve the top trending tokens within a specified time frame for market cap or volume comparison, using a structured request format.

Instructions

Get the top trending tokens in a particular time frame. Great for comparing market cap or volume. Expects a TopTrendingTokensRequest, returns a list of tokens with their details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_trending_tokens_requestsYes

Implementation Reference

  • The main handler function for the 'get_top_trending_tokens' tool, decorated with @mcp.tool() for registration in the MCP server. It checks if the armor_client is initialized, calls the client's top_trending_tokens method, and handles exceptions by returning error messages.
    @mcp.tool() async def get_top_trending_tokens(top_trending_tokens_requests: TopTrendingTokensRequest) -> List: """ Get the top trending tokens in a particular time frame. Great for comparing market cap or volume. Expects a TopTrendingTokensRequest, returns a list of tokens with their details. """ if not armor_client: return [{"error": "Not logged in"}] try: result: List = await armor_client.top_trending_tokens(top_trending_tokens_requests) return result except Exception as e: return [{"error": str(e)}]
  • Pydantic BaseModel defining the input schema (TopTrendingTokensRequest) for the tool, specifying the time_frame parameter with allowed values and default.
    class TopTrendingTokensRequest(BaseModel): time_frame: Literal["5m", "15m", "30m", "1h", "2h", "3h", "4h", "5h", "6h", "12h", "24h"] = Field(default="24h", description="Time frame to get the top trending tokens")
  • Supporting method in ArmorWalletAPIClient class that serializes the request data and makes the HTTP POST request to the '/tokens/trending/' API endpoint to fetch the top trending tokens.
    async def top_trending_tokens(self, data: TopTrendingTokensRequest) -> List: """Get the top trending tokens.""" payload = data.model_dump(exclude_none=True) return await self._api_call("POST", f"tokens/trending/", payload)

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/armorwallet/armor-crypto-mcp'

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