get_resource_capacity
Retrieve resource capacity details from OceanBase for the sys tenant. Use this tool to access and manage system-level resource allocation and utilization data.
Instructions
Get resource capacity from oceanbase. You need to be sys tenant to get resource capacity.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'get_resource_capacity' tool. It verifies sys tenant access, logs the call, and executes a SQL query on GV$OB_SERVERS via the execute_sql tool.@app.tool() def get_resource_capacity(): """ Get resource capacity from oceanbase. You need to be sys tenant to get resource capacity. """ tenant = json.loads(get_current_tenant())["data"][0][0] if tenant != "sys": raise ValueError("Only sys tenant can get resource capacity") logger.info("Calling tool: get_resource_capacity") sql_query = "select * from oceanbase.GV$OB_SERVERS" 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)}"