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()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves the current tenant name but doesn't describe what 'current' means in context (e.g., based on session, default, or active connection), whether it requires authentication, potential errors, or the format of the return value. This leaves significant gaps for an agent to understand how the tool behaves.

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

Conciseness5/5

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

The description is a single, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a string, object, or error), how 'current' is determined, or any dependencies on other tools like 'configure_db_connection'. For a tool that likely interacts with a database system, more context is needed to use it effectively.

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?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description appropriately doesn't discuss parameters, which is correct for this case. A baseline of 4 is applied as it meets expectations without needing to compensate for any parameter gaps.

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

Purpose4/5

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

The description clearly states the action ('Get') and the resource ('current tenant name from oceanbase'), making the purpose immediately understandable. However, it doesn't distinguish this tool from siblings like 'get_all_server_nodes' or 'get_resource_capacity' in terms of what specific information it retrieves versus other get operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether a database connection must be configured first using 'configure_db_connection'), typical use cases, or relationships with sibling tools like 'execute_sql' that might also retrieve tenant information.

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

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

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