Skip to main content
Glama
financial-datasets

Financial Datasets MCP Server

Official

get_sec_filings

Retrieve SEC filings for companies by ticker symbol, with options to filter by filing type and limit results for financial analysis.

Instructions

Get all SEC filings for a company.

Args:
    ticker: Ticker symbol of the company (e.g. AAPL, GOOGL)
    limit: Number of SEC filings to return (default: 10)
    filing_type: Type of SEC filing (e.g. 10-K, 10-Q, 8-K)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYes
limitNo
filing_typeNo

Implementation Reference

  • The handler function for the 'get_sec_filings' tool, decorated with @mcp.tool() for automatic registration in FastMCP. It constructs an API URL using the provided ticker, optional limit, and filing_type, fetches data via the shared make_request helper, extracts filings, and returns JSON stringified data or an error message.
    @mcp.tool()
    async def get_sec_filings(
        ticker: str,
        limit: int = 10,
        filing_type: str | None = None,
    ) -> str:
        """Get all SEC filings for a company.
    
        Args:
            ticker: Ticker symbol of the company (e.g. AAPL, GOOGL)
            limit: Number of SEC filings to return (default: 10)
            filing_type: Type of SEC filing (e.g. 10-K, 10-Q, 8-K)
        """
        # Fetch data from the API
        url = f"{FINANCIAL_DATASETS_API_BASE}/filings/?ticker={ticker}&limit={limit}"
        if filing_type:
            url += f"&filing_type={filing_type}"
     
        # Call the API
        data = await make_request(url)
    
        # Extract the SEC filings
        filings = data.get("filings", [])
    
        # Check if SEC filings are found
        if not filings:
            return f"Unable to fetch SEC filings or no SEC filings found."
    
        # Stringify the SEC filings
        return json.dumps(filings, indent=2)
  • Shared helper function used by get_sec_filings (and other tools) to make authenticated HTTP 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)}
  • server.py:337-337 (registration)
    The @mcp.tool() decorator registers the get_sec_filings function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
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 mentions the action ('Get') and parameters but doesn't describe traits like whether it's read-only, requires authentication, has rate limits, returns paginated results, or what the output format is. This leaves significant gaps for a tool with 3 parameters and no output schema.

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, starting with the core purpose followed by parameter details. Each sentence adds value, with no redundant information. It could be slightly more structured (e.g., bullet points), but it's efficient and easy to parse.

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 (3 parameters, no annotations, no output schema), the description is incomplete. It covers parameters well but lacks behavioral context (e.g., output format, error handling) and usage guidelines. Without annotations or output schema, more detail is needed to fully inform an agent, especially for a data retrieval 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 description adds meaningful context beyond the input schema, which has 0% description coverage. It explains each parameter: 'ticker' as the company symbol with examples, 'limit' as the number of filings to return with a default, and 'filing_type' as the type with examples. This compensates well for the low schema coverage, though it doesn't detail constraints like valid ticker formats or filing type options.

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 all SEC filings for a company.' It specifies the verb ('Get') and resource ('SEC filings'), distinguishing it from sibling tools that focus on financial statements, news, or prices. However, it doesn't explicitly differentiate from hypothetical similar tools (e.g., 'get_sec_filings_with_details'), though siblings don't include direct alternatives.

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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., needing a valid ticker), exclusions (e.g., not for historical data), or comparisons to siblings like 'get_balance_sheets' for financial data. Usage is implied by the purpose 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

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