Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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
Expand Down Expand Up @@ -228,7 +228,7 @@ async def get_available_crypto_tickers() -> str:
Gets all available crypto tickers.
"""
# Fetch data from the API
url = f"{FINANCIAL_DATASETS_API_BASE}/crypto/prices/tickers"
url = f"{FINANCIAL_DATASETS_API_BASE}/prices/tickers/" ## Fixed the url here
data = await make_request(url)

# Check if data is found
Expand Down Expand Up @@ -351,7 +351,7 @@ async def get_sec_filings(
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)

Expand All @@ -365,6 +365,7 @@ async def get_sec_filings(
# Stringify the SEC filings
return json.dumps(filings, indent=2)


if __name__ == "__main__":
# Log server startup
logger.info("Starting Financial Datasets MCP Server...")
Expand Down