Skip to main content
Glama
yalcin

ta-lib-mcp

by yalcin

talib_get_version_info

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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()
  • 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.")
  • 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,
    )
  • 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 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
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds specific details about returned fields (server version, TA-Lib availability, Python version), enhancing transparency beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and to the point, with one minor repetition of 'Returns version information'. It efficiently communicates the tool's output without extraneous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, straightforward purpose), the description is complete. It specifies the output as a dictionary with version components, which is sufficient for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the schema already fully covers semantics. The description adds no parameter details, but that is acceptable as there is no ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns server, Python, and TA-Lib version information. This purpose is unique among sibling tools which focus on indicators and categories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While not explicitly stating when to use or alternatives, the purpose is self-evident and distinct from siblings. A minor improvement would be to explicitly recommend using it for version checking.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yalcin/ta-lib-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server