Skip to main content
Glama
financial-datasets

Financial Datasets MCP Server

Official

get_company_news

Retrieve company news articles by entering a stock ticker symbol to access relevant financial updates and market information.

Instructions

Get news for a company.

Args:
    ticker: Ticker symbol of the company (e.g. AAPL, GOOGL)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYes

Implementation Reference

  • server.py:201-201 (registration)
    The @mcp.tool() decorator registers the get_company_news function as an MCP tool in the FastMCP server.
    @mcp.tool()
  • The handler function that fetches news articles for the given ticker symbol from the Financial Datasets API, processes the response, handles errors, and returns the news data as a formatted JSON string.
    async def get_company_news(ticker: str) -> str:
        """Get news for a company.
    
        Args:
            ticker: Ticker symbol of the company (e.g. AAPL, GOOGL)
        """
        # Fetch data from the API
        url = f"{FINANCIAL_DATASETS_API_BASE}/news/?ticker={ticker}"
        data = await make_request(url)
    
        # Check if data is found
        if not data:
            return "Unable to fetch news or no news found."
    
        # Extract the news
        news = data.get("news", [])
    
        # Check if news are found
        if not news:
            return "Unable to fetch news or no news found."
        return json.dumps(news, indent=2)
  • Helper function used by get_company_news (and other tools) to make authenticated HTTP GET 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)}
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 only states the basic action without details on permissions, rate limits, data sources, or response format. This is inadequate for a tool that likely involves external data fetching, leaving the agent with insufficient context for safe and effective use.

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 brief and front-loaded with the main purpose, followed by parameter details in a structured 'Args' section. It avoids unnecessary words, but the lack of additional context or guidelines means it might be overly concise for a tool with no annotations or output schema.

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 of fetching company news, the absence of annotations and output schema, and only basic parameter info, the description is incomplete. It does not cover behavioral aspects like data sources, error handling, or return structure, making it insufficient for the agent to fully understand the tool's operation.

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 description adds meaningful context for the single parameter 'ticker' by providing an example (e.g., AAPL, GOOGL), which clarifies the expected format. Since schema description coverage is 0%, this compensates well, though it could be enhanced with details like allowed ticker formats or validation rules.

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 verb 'Get' and the resource 'news for a company', making the purpose specific and understandable. However, it does not differentiate from sibling tools like 'get_sec_filings' or 'get_current_stock_price', which might also provide company-related information, leaving room for ambiguity in tool selection.

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. With siblings like 'get_sec_filings' that might overlap in providing company updates, there is no explicit mention of when this tool is preferred or what distinguishes it, such as news sources, recency, or format.

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