def call_tool()

in tablestore-java-mcp-server-rag/knowledge-data-generator/knowledge_manager.py [0:0]


    def call_tool(self, tool_name: str, args) -> Any:
        """
        Create a callable function for a specific tool.
        This allows us to execute database operations through the MCP server.

        Args:
            tool_name: The name of the tool to create a callable for

        Returns:
            A callable async function that executes the specified tool
        """
        if not self.session:
            raise RuntimeError("Not connected to MCP server")

        return self.session.call_tool(tool_name, args)