Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_directory_list

Retrieve structured directory lists for financial data, including stocks, ETFs, exchanges, sectors, industries, and more. Specify list_type to access targeted market or company information directly from Yahoo Finance.

Instructions

获取市场或公司目录列表。

参数说明: list_type: str 可选值:stock、financial_statement_symbol、cik、symbol_change、etf、 actively_trading、earnings_transcript、available_exchanges、 available_sectors、available_industries、available_countries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_typeYes

Implementation Reference

  • The handler function that implements the get_directory_list tool logic. It retrieves the API key, maps the list_type to an FMP endpoint, fetches data via HTTP GET, handles errors, and returns JSON string.
    async def get_directory_list(list_type: str) -> 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 = {
            "stock": "stock-list",
            "financial_statement_symbol": "financial-statement-symbol-list",
            "cik": "cik-list",
            "symbol_change": "symbol-change",
            "etf": "etf-list",
            "actively_trading": "actively-trading-list",
            "earnings_transcript": "earnings-transcript-list",
            "available_exchanges": "available-exchanges",
            "available_sectors": "available-sectors",
            "available_industries": "available-industries",
            "available_countries": "available-countries",
        }
        endpoint = endpoint_map.get(list_type.lower())
        if not endpoint:
            return "Error: invalid list type"
        url = f"{base}/{endpoint}"
        try:
            resp = requests.get(url, params={"apikey": api_key}, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting directory list for {list_type}: {e}"
        return json.dumps(data)
  • server.py:917-926 (registration)
    The decorator that registers the get_directory_list tool with its name and description including parameter details, serving as schema.
    @fmp_server.tool(
        name="get_directory_list",
        description="""获取市场或公司目录列表。
    
    参数说明:
        list_type: str
            可选值:stock、financial_statement_symbol、cik、symbol_change、etf、
            actively_trading、earnings_transcript、available_exchanges、
            available_sectors、available_industries、available_countries""",
    )
  • The description string in the decorator provides input schema details for the list_type parameter.
        description="""获取市场或公司目录列表。
    
    参数说明:
        list_type: str
            可选值:stock、financial_statement_symbol、cik、symbol_change、etf、
            actively_trading、earnings_transcript、available_exchanges、
            available_sectors、available_industries、available_countries""",
    )
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 what the tool does ('获取市场或公司目录列表') without mentioning permissions, rate limits, response format, or other behavioral traits. This is inadequate for a tool with no annotation coverage.

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 and front-loaded, with the purpose stated first followed by parameter details. It avoids unnecessary fluff, though the parameter explanation could be slightly more integrated. Overall, it's efficient and structured.

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) and no output schema, the description is minimally adequate. It covers the purpose and parameter semantics well, but lacks behavioral context and usage guidelines, leaving gaps in completeness for effective agent use.

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 significant value beyond the input schema, which has 0% coverage. It explains the single parameter 'list_type' with a detailed list of possible values (e.g., stock, financial_statement_symbol), clarifying its semantics. This compensates well for the schema's lack of descriptions.

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 tool's purpose: '获取市场或公司目录列表' (Get market or company directory list). It specifies the verb '获取' (get) and resource '目录列表' (directory list), making the function unambiguous. However, it doesn't differentiate from sibling tools like 'get_crypto_list' or 'search_companies', which also retrieve lists, so it doesn't reach the highest score.

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. It doesn't mention sibling tools like 'get_crypto_list' for cryptocurrency data or 'search_companies' for company searches, nor does it specify contexts or exclusions. This leaves the agent without usage direction.

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