Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_ma_data

Retrieve mergers and acquisitions data from Yahoo Finance. Specify action type, company name, page number, and results limit to search or fetch the latest updates.

Instructions

获取并购相关数据。

参数说明: action_type: str latest 或 search name: str 搜索模式下的公司名称 page: int 页码,默认 0 limit: int 返回数量,默认 100

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
action_typeYes
limitNo
nameNo
pageNo

Implementation Reference

  • The asynchronous handler function that executes the get_ma_data tool. It fetches mergers and acquisitions data from the Financial Modeling Prep API, supporting 'latest' or 'search' by company name, with pagination.
    async def get_ma_data(
        action_type: str,
        name: str = "",
        page: int = 0,
        limit: int = 100,
    ) -> str:
        """获取并购信息"""
    
        api_key = os.environ.get("FMP_API_KEY")
        if not api_key:
            return "Error: FMP_API_KEY environment variable not set."
    
        base = "https://financialmodelingprep.com/stable"
        endpoint_map = {
            "latest": "mergers-acquisitions-latest",
            "search": "mergers-acquisitions-search",
        }
        endpoint = endpoint_map.get(action_type.lower())
        if not endpoint:
            return "Error: invalid action type"
    
        params = {"apikey": api_key, "page": page, "limit": limit}
        if action_type == "search":
            if not name:
                return "Error: name is required for search"
            params["name"] = name
    
        url = f"{base}/{endpoint}"
        try:
            resp = requests.get(url, params=params, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting M&A data {action_type}: {e}"
        return json.dumps(data)
  • server.py:395-408 (registration)
    Registers the get_ma_data tool with the FastMCP server using the @fmp_server.tool decorator, specifying the name and a description that outlines the input parameters.
    @fmp_server.tool(
        name="get_ma_data",
        description="""获取并购相关数据。
    
    参数说明:
        action_type: str
            latest 或 search
        name: str
            搜索模式下的公司名称
        page: int
            页码,默认 0
        limit: int
            返回数量,默认 100""",
    )
  • Type annotations defining the input schema (action_type: str required, name/page/limit optional with defaults) and output as str (JSON).
    async def get_ma_data(
        action_type: str,
        name: str = "",
        page: int = 0,
        limit: int = 100,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions two modes ('latest' or 'search') but doesn't disclose behavioral traits like whether this is a read-only operation, potential rate limits, authentication requirements, data freshness, or what happens when parameters are invalid. The description adds minimal context beyond the 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 appropriately sized with a clear purpose statement followed by parameter documentation. The structure is front-loaded with the main function, though the parameter section could be more integrated. No wasted sentences, but the formatting as a code block with indentation is slightly awkward.

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?

For a 4-parameter tool with no annotations and no output schema, the description is incomplete. It covers parameters adequately but lacks crucial context about what data is returned (structure, fields), error conditions, rate limits, or authentication requirements. The absence of output schema means the description should ideally explain return values, which it doesn't.

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?

With 0% schema description coverage, the description compensates well by explaining all 4 parameters: 'action_type' (latest or search), 'name' (company name in search mode), 'page' (page number, default 0), and 'limit' (return count, default 100). This adds crucial meaning beyond the bare schema, though it could provide more detail about format constraints or search behavior.

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 '获取并购相关数据' (get M&A related data), which provides a basic purpose but is vague about what specific data is retrieved and how. It doesn't distinguish this tool from potential siblings like 'search_companies' or 'get_financial_statement' that might also provide M&A data. The verb '获取' (get) is generic rather than specific.

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 many sibling tools available (e.g., 'search_companies', 'get_financial_statement'), there's no indication of whether this is the primary M&A data source or how it differs from other data retrieval tools. Usage is implied through parameter documentation but not explicitly stated.

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

Related 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/16Coffee/finance-mcp'

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