Created
December 16, 2025 02:30
-
-
Save pranjalAI/69380a85934fc4589481e06821d25faa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from config import FMP_MCP_ENDPOINT | |
| def call_mcp_tool(tool_name: str, params: dict | None = None): | |
| payload = { | |
| "jsonrpc": "2.0", | |
| "id": 1, | |
| "method": tool_name, | |
| "params": params or {} | |
| } | |
| resp = requests.post(FMP_MCP_ENDPOINT, json=payload, timeout=30) | |
| resp.raise_for_status() | |
| data = resp.json() | |
| return data.get("result") | |
| if __name__ == "__main__": | |
| # Example: fetch company profile for NVIDIA | |
| result = call_mcp_tool("getCompanyProfile", {"symbol": "NVDA"}) | |
| print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment