Skip to main content
Glama
cgrdavies

mcp-clickhouse-long-running

by cgrdavies

list_databases

Retrieve a list of all available ClickHouse databases on the mcp-clickhouse-long-running server for database querying and management.

Instructions

List available ClickHouse databases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_databases' tool. It is decorated with @mcp.tool() which registers the tool with the MCP server. The function connects to the ClickHouse client and executes the SHOW DATABASES command to list all available databases.
    @mcp.tool() def list_databases(): """List available ClickHouse databases""" logger.info("Listing all databases") client = create_clickhouse_client() result = client.command("SHOW DATABASES") logger.info(f"Found {len(result) if isinstance(result, list) else 1} databases") return result
  • The @mcp.tool() decorator registers the list_databases function as an MCP tool.
    @mcp.tool() def list_databases(): """List available ClickHouse databases""" logger.info("Listing all databases") client = create_clickhouse_client() result = client.command("SHOW DATABASES") logger.info(f"Found {len(result) if isinstance(result, list) else 1} databases") return result
  • Exports the list_databases function from mcp_server.py for use in other modules, such as tests.
    from .mcp_server import ( create_clickhouse_client, list_databases, list_tables, run_select_query, )

Other Tools

Related 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/cgrdavies/mcp-clickhouse'

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