Skip to main content
Glama
financial-datasets

Financial Datasets MCP Server

Official

get_current_crypto_price

Retrieve current cryptocurrency prices using ticker symbols to monitor market values or integrate financial data into applications.

Instructions

Get the current / latest price of a crypto currency.

Args:
    ticker: Ticker symbol of the crypto currency (e.g. BTC-USD). The list of available crypto tickers can be retrieved via the get_available_crypto_tickers tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYes

Implementation Reference

  • The main handler function for the 'get_current_crypto_price' tool. It fetches the current price snapshot for a given crypto ticker from the Financial Datasets API using the shared make_request helper, handles errors, and returns a JSON string of the snapshot.
    @mcp.tool()
    async def get_current_crypto_price(ticker: str) -> str:
        """Get the current / latest price of a crypto currency.
    
        Args:
            ticker: Ticker symbol of the crypto currency (e.g. BTC-USD). The list of available crypto tickers can be retrieved via the get_available_crypto_tickers tool.
        """
        # Fetch data from the API
        url = f"{FINANCIAL_DATASETS_API_BASE}/crypto/prices/snapshot/?ticker={ticker}"
        data = await make_request(url)
    
        # Check if data is found
        if not data:
            return "Unable to fetch current price or no current price found."
    
        # Extract the current price
        snapshot = data.get("snapshot", {})
    
        # Check if current price is found
        if not snapshot:
            return "Unable to fetch current price or no current price found."
    
        # Stringify the current price
        return json.dumps(snapshot, indent=2)
  • server.py:311-311 (registration)
    The @mcp.tool() decorator registers the get_current_crypto_price function as an MCP tool.
    @mcp.tool()
  • Shared helper function used by get_current_crypto_price to make authenticated API requests to the Financial Datasets API.
    async def make_request(url: str) -> dict[str, any] | None:
        """Make a request to the Financial Datasets API with proper error handling."""
        # Load environment variables from .env file
        load_dotenv()
        
        headers = {}
        if api_key := os.environ.get("FINANCIAL_DATASETS_API_KEY"):
            headers["X-API-KEY"] = api_key
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(url, headers=headers, timeout=30.0)
                response.raise_for_status()
                return response.json()
            except Exception as e:
                return {"Error": str(e)}
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates this is a read operation ('Get') but lacks details on rate limits, error handling, data freshness, or response format. It adds some context by mentioning ticker availability via another tool, but overall behavioral traits are minimally covered.

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 front-loaded with the core purpose in the first sentence, followed by parameter details in a structured 'Args' section. Every sentence adds value without redundancy, making it efficient and well-organized for quick understanding.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is adequate but has gaps. It covers the basic purpose and parameter guidance but lacks details on return values, error cases, or behavioral constraints like rate limits, which would enhance completeness for a price-fetching tool.

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

Parameters4/5

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

The schema has 0% description coverage, so the description must compensate. It adds meaning by explaining the 'ticker' parameter as a symbol (e.g., BTC-USD) and referencing get_available_crypto_tickers for valid values. This clarifies semantics beyond the bare schema, though it could provide more detail on format constraints.

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

Purpose5/5

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

The description clearly states the specific action ('Get the current / latest price') and resource ('crypto currency'), distinguishing it from siblings like get_historical_crypto_prices (historical vs current) and get_crypto_prices (plural vs singular). It directly addresses what the tool does without being vague or tautological.

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

Usage Guidelines4/5

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

The description provides clear context by referencing the get_available_crypto_tickers tool for valid ticker symbols, which implicitly guides usage. However, it does not explicitly state when to use this tool versus alternatives like get_crypto_prices or get_historical_crypto_prices, missing explicit exclusions or comparisons.

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/financial-datasets/mcp-server'

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