Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created December 16, 2025 02:30
Show Gist options
  • Select an option

  • Save pranjalAI/69380a85934fc4589481e06821d25faa to your computer and use it in GitHub Desktop.

Select an option

Save pranjalAI/69380a85934fc4589481e06821d25faa to your computer and use it in GitHub Desktop.
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