talib_get_version_info
Retrieve version details of the TA-Lib server, Python, and TA-Lib library to verify your environment.
Instructions
Return server, Python, and TA-Lib version information.
Returns version information including the ta-lib-mcp server version, TA-Lib availability, and Python version.
Returns: Version information dictionary.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/ta_lib_mcp/server.py:153-170 (handler)The tool handler function 'talib_get_version_info' decorated with @mcp.tool. It calls talib_versions() and returns a VersionInfo Pydantic model as a dict.
@mcp.tool(annotations=_TOOL_ANNOTATIONS) def talib_get_version_info() -> dict[str, Any]: """Return server, Python, and TA-Lib version information. Returns version information including the ta-lib-mcp server version, TA-Lib availability, and Python version. Returns: Version information dictionary. """ versions = talib_versions() return VersionInfo( mcp_server_version=ta_lib_mcp.__version__, python_version=sys.version, talib_available=versions["python_package_version"] is not None, talib_python_version=versions["python_package_version"], talib_core_version=versions["core_version"], ).model_dump() - src/ta_lib_mcp/models.py:111-118 (schema)VersionInfo Pydantic model defining the output schema with fields: mcp_server_version, python_version, talib_available, talib_python_version, talib_core_version.
class VersionInfo(BaseModel): """Version and environment information.""" mcp_server_version: str = Field(description="ta-lib-mcp server version.") python_version: str = Field(description="Python version.") talib_available: bool = Field(description="Whether TA-Lib is installed.") talib_python_version: str | None = Field(description="TA-Lib Python package version.") talib_core_version: str | None = Field(description="TA-Lib C library version.") - src/ta_lib_mcp/server.py:38-44 (registration)Tool annotations _TOOL_ANNOTATIONS defining read-only, non-destructive, idempotent, closed-world hints, used by @mcp.tool decorator on line 153.
# Tool annotations: all tools are read-only, non-destructive, idempotent, closed-world _TOOL_ANNOTATIONS = ToolAnnotations( readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False, ) - src/ta_lib_mcp/indicators.py:42-61 (helper)Helper function 'talib_versions' that loads TA-Lib and extracts the Python package version (talib.__version__) and C core version (talib.__ta_version__).
def talib_versions() -> dict[str, str | None]: """Return installed TA-Lib package/core versions, if available.""" loaded = _load_talib() if loaded is None: return {"python_package_version": None, "core_version": None} talib, _ = loaded try: package_version: str | None = str(talib.__version__) except AttributeError: package_version = None try: core_version: str | None = str(talib.__ta_version__) except AttributeError: core_version = None return { "python_package_version": package_version, "core_version": core_version, } - tests/test_server.py:78-98 (helper)Tests for talib_get_version_info covering both the case when TA-Lib is available and unavailable.
def test_get_version_info() -> None: with patch.object( server, "talib_versions", lambda: {"python_package_version": "0.4.99", "core_version": "0.6.99"}, ): result = server.talib_get_version_info() assert result["talib_available"] is True assert result["talib_python_version"] == "0.4.99" def test_get_version_info_talib_unavailable() -> None: with patch.object( server, "talib_versions", lambda: {"python_package_version": None, "core_version": None}, ): result = server.talib_get_version_info() assert result["talib_available"] is False assert result["talib_python_version"] is None assert result["talib_core_version"] is None