openmarkets 0.1.0.dev44__tar.gz → 0.1.0.dev50__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.pre-commit-config.yaml +3 -3
  2. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/CITATION.cff +3 -3
  3. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/PKG-INFO +12 -12
  4. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/README.md +9 -9
  5. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/pyproject.toml +5 -6
  6. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/__init__.py +1 -1
  7. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/_version.py +2 -2
  8. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/server.py +2 -2
  9. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/options.py +26 -1
  10. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.editorconfig +0 -0
  11. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.gitattributes +0 -0
  12. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.github/CODEOWNERS +0 -0
  13. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.gitignore +0 -0
  14. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/.python-version +0 -0
  15. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/LICENSE +0 -0
  16. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/py.typed +0 -0
  17. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/__init__.py +0 -0
  18. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/analyst_data.py +0 -0
  19. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/calendar.py +0 -0
  20. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/corporate_actions.py +0 -0
  21. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/crypto.py +0 -0
  22. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/extended_market.py +0 -0
  23. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/financial_statements.py +0 -0
  24. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/funds.py +0 -0
  25. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/historical_data.py +0 -0
  26. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/market_data.py +0 -0
  27. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/news.py +0 -0
  28. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/screener.py +0 -0
  29. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/stock_info.py +0 -0
  30. {openmarkets-0.1.0.dev44/src/mcp_server_yfinance → openmarkets-0.1.0.dev50/src/openmarkets}/tools/technical_analysis.py +0 -0
  31. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/__init__.pyi +0 -0
  32. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/base.pyi +0 -0
  33. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/cache.pyi +0 -0
  34. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/const.pyi +0 -0
  35. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/data.pyi +0 -0
  36. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/domain/__init__.pyi +0 -0
  37. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/domain/domain.pyi +0 -0
  38. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/domain/industry.pyi +0 -0
  39. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/domain/market.pyi +0 -0
  40. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/domain/sector.pyi +0 -0
  41. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/exceptions.pyi +0 -0
  42. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/live.pyi +0 -0
  43. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/lookup.pyi +0 -0
  44. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/multi.pyi +0 -0
  45. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/pricing_pb2.pyi +0 -0
  46. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/__init__.pyi +0 -0
  47. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/analysis.pyi +0 -0
  48. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/fundamentals.pyi +0 -0
  49. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/funds.pyi +0 -0
  50. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/history.pyi +0 -0
  51. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/holders.pyi +0 -0
  52. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/scrapers/quote.pyi +0 -0
  53. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/screener/__init__.pyi +0 -0
  54. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/screener/query.pyi +0 -0
  55. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/screener/screener.pyi +0 -0
  56. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/search.pyi +0 -0
  57. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/shared.pyi +0 -0
  58. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/ticker.pyi +0 -0
  59. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/tickers.pyi +0 -0
  60. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/utils.pyi +0 -0
  61. {openmarkets-0.1.0.dev44 → openmarkets-0.1.0.dev50}/typings/yfinance/version.pyi +0 -0
@@ -9,12 +9,12 @@ default_install_hook_types:
9
9
 
10
10
  repos:
11
11
  - repo: https://github.com/astral-sh/uv-pre-commit
12
- rev: 0.7.7
12
+ rev: 0.7.10
13
13
  hooks:
14
14
  - id: uv-sync
15
- args: ["--locked", "--all-packages"]
15
+ args: ["--all-packages"]
16
16
  - repo: https://github.com/astral-sh/ruff-pre-commit
17
- rev: v0.11.11
17
+ rev: v0.11.12
18
18
  hooks:
19
19
  - id: ruff
20
20
  args: [--fix, --exit-non-zero-on-fix]
@@ -4,11 +4,11 @@ authors:
4
4
  - family-names: "Danchev"
5
5
  given-names: "D."
6
6
  orcid: "https://orcid.org/0009-0002-2750-9563"
7
- title: "MCP Server YFinance"
7
+ title: "OpenMarkets: A Comprehensive Open-Source Market Analysis Tool"
8
8
  version: 0.0.1
9
9
  doi: 10.5281/zenodo.1234
10
10
  date-released: 2025-06-01
11
- url: "https://github.com/danchev/mcp-server-yfinance"
11
+ url: "https://github.com/danchev/openmarkets"
12
12
  type: software
13
13
  license: "AGPL-3.0-or-later"
14
- repository-code: "https://github.com/danchev/mcp-server-yfinance"
14
+ repository-code: "https://github.com/danchev/openmarkets"
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openmarkets
3
- Version: 0.1.0.dev44
3
+ Version: 0.1.0.dev50
4
4
  Summary: A Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
5
- Project-URL: Homepage, https://github.com/danchev/mcp-server-yfinance
6
- Project-URL: Issues, https://github.com/danchev/mcp-server-yfinance/issues
5
+ Project-URL: Homepage, https://github.com/danchev/openmarkets
6
+ Project-URL: Issues, https://github.com/danchev/openmarkets/issues
7
7
  Author-email: Dobri Danchev <python-dist@danchev.net>
8
8
  License: AGPL-3.0-or-later
9
9
  License-File: LICENSE
@@ -30,15 +30,15 @@ Requires-Dist: mcp[cli]>=1.9.0
30
30
  Requires-Dist: yfinance>=0.2.61
31
31
  Description-Content-Type: text/markdown
32
32
 
33
- ![PyPI](https://img.shields.io/pypi/v/mcp-server-yfinance)
34
- [![PyPI - Downloads](https://static.pepy.tech/badge/mcp-server-yfinance)](https://pepy.tech/project/mcp-server-yfinance)
35
- ![PyPI - Monthly Downloads](https://static.pepy.tech/badge/mcp-server-yfinance/month)
33
+ ![PyPI](https://img.shields.io/pypi/v/openmarkets)
34
+ [![PyPI - Downloads](https://static.pepy.tech/badge/openmarkets)](https://pepy.tech/project/openmarkets)
35
+ ![PyPI - Monthly Downloads](https://static.pepy.tech/badge/openmarkets/month)
36
36
 
37
- # MCP Server YFinance
37
+ # Open Markets
38
38
 
39
39
  A Model Context Protocol (MCP) server for agentic retrieval of financial data from Yahoo Finance. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
40
40
 
41
- This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.
41
+ This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop, n8n, and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.
42
42
 
43
43
  ## Features
44
44
 
@@ -72,7 +72,7 @@ This MCP server can be used with various LLM applications that support the Model
72
72
  "yfinance": {
73
73
  "command": "uvx",
74
74
  "args": [
75
- "mcp-server-yfinance@latest"
75
+ "openmarkets@latest"
76
76
  ]
77
77
  }
78
78
  }
@@ -85,7 +85,7 @@ This MCP server can be used with various LLM applications that support the Model
85
85
 
86
86
  For quick installation, use one of the one-click installation buttons below:
87
87
 
88
- [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-yfinance%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-yfinance%22%5D%7D&quality=insiders)
88
+ [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D&quality=insiders)
89
89
 
90
90
  For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.
91
91
 
@@ -102,7 +102,7 @@ Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace
102
102
  "yfinance": {
103
103
  "command": "uvx",
104
104
  "args": [
105
- "mcp-server-yfinance@latest"
105
+ "openmarkets@latest"
106
106
  ]
107
107
  }
108
108
  }
@@ -229,7 +229,7 @@ This list reflects the tools registered in the codebase and their main arguments
229
229
  To test the MCP server locally, install the `uvx` and `npx` and run the following command:
230
230
 
231
231
  ```bash
232
- npx @modelcontextprotocol/inspector uvx mcp-server-yfinance@latest
232
+ npx @modelcontextprotocol/inspector uvx openmarkets@latest
233
233
  ```
234
234
 
235
235
  This command will start the MCP server and open the MCP Inspector in your default web browser. You can then interact with the server and test its functionality.
@@ -1,12 +1,12 @@
1
- ![PyPI](https://img.shields.io/pypi/v/mcp-server-yfinance)
2
- [![PyPI - Downloads](https://static.pepy.tech/badge/mcp-server-yfinance)](https://pepy.tech/project/mcp-server-yfinance)
3
- ![PyPI - Monthly Downloads](https://static.pepy.tech/badge/mcp-server-yfinance/month)
1
+ ![PyPI](https://img.shields.io/pypi/v/openmarkets)
2
+ [![PyPI - Downloads](https://static.pepy.tech/badge/openmarkets)](https://pepy.tech/project/openmarkets)
3
+ ![PyPI - Monthly Downloads](https://static.pepy.tech/badge/openmarkets/month)
4
4
 
5
- # MCP Server YFinance
5
+ # Open Markets
6
6
 
7
7
  A Model Context Protocol (MCP) server for agentic retrieval of financial data from Yahoo Finance. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
8
8
 
9
- This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.
9
+ This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop, n8n, and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.
10
10
 
11
11
  ## Features
12
12
 
@@ -40,7 +40,7 @@ This MCP server can be used with various LLM applications that support the Model
40
40
  "yfinance": {
41
41
  "command": "uvx",
42
42
  "args": [
43
- "mcp-server-yfinance@latest"
43
+ "openmarkets@latest"
44
44
  ]
45
45
  }
46
46
  }
@@ -53,7 +53,7 @@ This MCP server can be used with various LLM applications that support the Model
53
53
 
54
54
  For quick installation, use one of the one-click installation buttons below:
55
55
 
56
- [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-yfinance%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-yfinance%22%5D%7D&quality=insiders)
56
+ [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D&quality=insiders)
57
57
 
58
58
  For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.
59
59
 
@@ -70,7 +70,7 @@ Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace
70
70
  "yfinance": {
71
71
  "command": "uvx",
72
72
  "args": [
73
- "mcp-server-yfinance@latest"
73
+ "openmarkets@latest"
74
74
  ]
75
75
  }
76
76
  }
@@ -197,7 +197,7 @@ This list reflects the tools registered in the codebase and their main arguments
197
197
  To test the MCP server locally, install the `uvx` and `npx` and run the following command:
198
198
 
199
199
  ```bash
200
- npx @modelcontextprotocol/inspector uvx mcp-server-yfinance@latest
200
+ npx @modelcontextprotocol/inspector uvx openmarkets@latest
201
201
  ```
202
202
 
203
203
  This command will start the MCP server and open the MCP Inspector in your default web browser. You can then interact with the server and test its functionality.
@@ -32,22 +32,21 @@ dependencies = [
32
32
  ]
33
33
 
34
34
  [project.urls]
35
- Homepage = "https://github.com/danchev/mcp-server-yfinance"
36
- Issues = "https://github.com/danchev/mcp-server-yfinance/issues"
35
+ Homepage = "https://github.com/danchev/openmarkets"
36
+ Issues = "https://github.com/danchev/openmarkets/issues"
37
37
 
38
38
  [project.scripts]
39
- mcp-server-yfinance = "mcp_server_yfinance.server:main"
40
- openmarkets = "mcp_server_yfinance.server:main"
39
+ openmarkets = "openmarkets.server:main"
41
40
 
42
41
  [build-system]
43
42
  requires = ["hatchling", "hatch-vcs"]
44
43
  build-backend = "hatchling.build"
45
44
 
46
45
  [tool.hatch.build.targets.wheel]
47
- packages = ["src/mcp_server_yfinance"]
46
+ packages = ["src/openmarkets"]
48
47
 
49
48
  [tool.hatch.build.hooks.vcs]
50
- version-file = "src/mcp_server_yfinance/_version.py"
49
+ version-file = "src/openmarkets/_version.py"
51
50
 
52
51
  [tool.hatch.envs.default]
53
52
  installer = "uv"
@@ -1,5 +1,5 @@
1
1
  from importlib.metadata import version
2
2
 
3
- __version__ = version("mcp-server-yfinance")
3
+ __version__ = version("openmarkets")
4
4
 
5
5
  __all__ = ["__version__"]
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.1.0.dev44'
21
- __version_tuple__ = version_tuple = (0, 1, 0, 'dev44')
20
+ __version__ = version = '0.1.0.dev50'
21
+ __version_tuple__ = version_tuple = (0, 1, 0, 'dev50')
@@ -1,4 +1,4 @@
1
- """MCP Server Markets - YFinance integration"""
1
+ """Open Markets Server"""
2
2
 
3
3
  from mcp.server import FastMCP
4
4
 
@@ -18,7 +18,7 @@ from .tools import (
18
18
  register_technical_analysis_tools,
19
19
  )
20
20
 
21
- mcp = FastMCP("Market Data Server", "1.0.0")
21
+ mcp = FastMCP("Open Markets Server", "0.0.1")
22
22
 
23
23
  # Register all tool modules
24
24
  register_stock_info_tools(mcp)
@@ -3,10 +3,34 @@
3
3
  import json
4
4
  from typing import Optional
5
5
 
6
+ import pandas as pd
6
7
  import yfinance as yf
7
8
  from mcp.server import FastMCP
8
9
 
9
10
 
11
+ class PandasTimestampEncoder(json.JSONEncoder):
12
+ """Custom JSON encoder to handle pandas Timestamp objects."""
13
+
14
+ def default(self, obj):
15
+ if isinstance(obj, pd.Timestamp):
16
+ return obj.isoformat()
17
+ return super().default(obj)
18
+
19
+
20
+ def _safe_json_dumps(data, indent: Optional[int] = None) -> str:
21
+ """Serialize data to a JSON string, converting pandas Timestamp objects to ISO format.
22
+
23
+ Args:
24
+ data: The data to serialize.
25
+ indent: If not None, then JSON array elements and object members will be pretty-printed
26
+ with that indent level.
27
+
28
+ Returns:
29
+ JSON string.
30
+ """
31
+ return json.dumps(data, cls=PandasTimestampEncoder, indent=indent)
32
+
33
+
10
34
  def register_options_tools(mcp: FastMCP):
11
35
  """Register options tools with the MCP server."""
12
36
 
@@ -53,7 +77,8 @@ def register_options_tools(mcp: FastMCP):
53
77
  "calls": option_chain.calls.to_dict("records") if hasattr(option_chain, "calls") else [],
54
78
  "puts": option_chain.puts.to_dict("records") if hasattr(option_chain, "puts") else [],
55
79
  }
56
- return json.dumps(result, indent=2)
80
+
81
+ return _safe_json_dumps(result, indent=2)
57
82
  except Exception as e:
58
83
  return json.dumps({"error": f"Failed to get options data: {str(e)}"})
59
84