Skip to main content
Glama
financial-datasets

Financial Datasets MCP Server

Official

get_crypto_prices

Retrieve historical cryptocurrency price data for analysis by specifying ticker, date range, and interval parameters.

Instructions

Gets historical prices for a crypto currency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYes
start_dateYes
end_dateYes
intervalNoday
interval_multiplierNo

Implementation Reference

  • The handler function decorated with @mcp.tool() for the get_crypto_prices MCP tool. It fetches historical cryptocurrency prices from the Financial Datasets API based on ticker, date range, and interval parameters, handles errors, and returns the prices as a formatted JSON string.
    @mcp.tool()
    async def get_crypto_prices(
        ticker: str,
        start_date: str,
        end_date: str,
        interval: str = "day",
        interval_multiplier: int = 1,
    ) -> str:
        """
        Gets historical prices for a crypto currency.
        """
        # Fetch data from the API
        url = f"{FINANCIAL_DATASETS_API_BASE}/crypto/prices/?ticker={ticker}&interval={interval}&interval_multiplier={interval_multiplier}&start_date={start_date}&end_date={end_date}"
        data = await make_request(url)
    
        # Check if data is found
        if not data:
            return "Unable to fetch prices or no prices found."
    
        # Extract the prices
        prices = data.get("prices", [])
    
        # Check if prices are found
        if not prices:
            return "Unable to fetch prices or no prices found."
    
        # Stringify the prices
        return json.dumps(prices, indent=2)
  • Helper function used by the get_crypto_prices tool to make authenticated HTTP GET requests to the Financial Datasets API, loading API key from environment, handling timeouts and errors.
    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)}
  • Constant defining the base URL for the Financial Datasets API, used in constructing endpoints for crypto prices.
    FINANCIAL_DATASETS_API_BASE = "https://api.financialdatasets.ai"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool gets historical prices but doesn't specify what data format is returned, if there are rate limits, authentication requirements, or error handling. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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

Conciseness4/5

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

The description is a single, straightforward sentence that efficiently conveys the core function. It's front-loaded with the main purpose and avoids unnecessary words, though it could be slightly more informative without sacrificing brevity.

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?

Given the complexity (5 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain the return values, error cases, or how to interpret parameters like 'interval' and 'interval_multiplier.' For a tool with multiple parameters and no structured support, more detail is needed to be complete.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the parameters have descriptions in the schema. The description mentions 'historical prices' and implies parameters like ticker and dates, but it doesn't explain what 'interval' or 'interval_multiplier' mean or provide any additional semantic context beyond what's inferred from the parameter names.

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

Purpose3/5

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

The description states the tool 'Gets historical prices for a crypto currency,' which clearly identifies the action (gets) and resource (historical prices for crypto currency). However, it doesn't distinguish this from its sibling 'get_historical_crypto_prices,' which appears to serve a nearly identical purpose, making the purpose somewhat vague in context.

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. For example, it doesn't explain how it differs from 'get_current_crypto_price' or 'get_historical_crypto_prices,' nor does it mention any prerequisites or exclusions for usage.

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