Skip to main content
Glama
oceanbase

mcp-oceanbase

Official
by oceanbase

get_current_tenant

Retrieve the current tenant name from OceanBase using the MCP server mcp-oceanbase, simplifying tenant identification for database management.

Instructions

Get the current tenant name from oceanbase.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'get_current_tenant' MCP tool. It queries the OceanBase database for tenant names and IDs using execute_sql. The @app.tool() decorator registers it as a tool.
    @app.tool()
    def get_current_tenant() -> str:
        """
        Get the current tenant name from oceanbase.
        """
        logger.info("Calling tool: get_current_tenant")
        sql_query = "SELECT TENANT_NAME,TENANT_ID FROM oceanbase.DBA_OB_TENANTS"
        try:
            return execute_sql(sql_query)
        except Error as e:
            logger.error(f"Error executing SQL '{sql_query}': {e}")
            return f"Error executing query: {str(e)}"
  • The @app.tool() decorator registers the get_current_tenant function as an MCP tool.
    @app.tool()

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

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/oceanbase/mcp-oceanbase'

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