Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created December 16, 2025 04:27
Show Gist options
  • Select an option

  • Save pranjalAI/2c71f6d39f796834044dc3837951387b to your computer and use it in GitHub Desktop.

Select an option

Save pranjalAI/2c71f6d39f796834044dc3837951387b to your computer and use it in GitHub Desktop.
# agents/fundamentals_agent.py
from state import ResearchState
from mcp_client import call_mcp_tool
class FundamentalsAgent:
def run(self, state: ResearchState) -> ResearchState:
symbol = state.symbol
if not symbol:
raise ValueError("Symbol missing in state.")
income = call_mcp_tool("getIncomeStatement", {"symbol": symbol, "period": "annual"})
balance = call_mcp_tool("getBalanceSheetStatement", {"symbol": symbol, "period": "annual"})
cashflow = call_mcp_tool("getCashFlowStatement", {"symbol": symbol, "period": "annual"})
state.fundamentals = {
"income_statement": income or [],
"balance_sheet": balance or [],
"cash_flow": cashflow or [],
}
return state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment