Skip to main content
Glama
HatriGt

HANA Cloud MCP Server

by HatriGt

hana_list_tables

List all tables in a specific schema within SAP HANA Cloud Database to manage database structure and access data efficiently.

Instructions

List all tables in a specific schema

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schema_nameNoName of the schema to list tables from (optional)

Implementation Reference

  • The main handler function for the 'hana_list_tables' tool. It handles optional schema_name (defaults from config), validates it, queries tables using QueryExecutor.getTables, formats the result, and returns a formatted response or error.
    static async listTables(args) {
      logger.tool('hana_list_tables', args);
      
      let { schema_name } = args || {};
      
      // Use default schema if not provided
      if (!schema_name) {
        if (config.hasDefaultSchema()) {
          schema_name = config.getDefaultSchema();
          logger.info(`Using default schema: ${schema_name}`);
        } else {
          return Formatters.createErrorResponse(
            'Schema name is required', 
            'Please provide schema_name parameter or set HANA_SCHEMA environment variable'
          );
        }
      }
      
      // Validate schema name
      const schemaValidation = Validators.validateSchemaName(schema_name);
      if (!schemaValidation.valid) {
        return Formatters.createErrorResponse('Invalid schema name', schemaValidation.error);
      }
      
      try {
        const tables = await QueryExecutor.getTables(schema_name);
        const formattedTables = Formatters.formatTableList(tables, schema_name);
        
        return Formatters.createResponse(formattedTables);
      } catch (error) {
        logger.error('Error listing tables:', error.message);
        return Formatters.createErrorResponse('Error listing tables', error.message);
      }
    }
  • The input schema definition for the 'hana_list_tables' tool, defining schema_name as an optional string parameter.
      name: "hana_list_tables",
      description: "List all tables in a specific schema",
      inputSchema: {
        type: "object",
        properties: {
          schema_name: {
            type: "string",
            description: "Name of the schema to list tables from (optional)"
          }
        },
        required: []
      }
    },
  • The TOOL_IMPLEMENTATIONS object registers 'hana_list_tables' mapping to TableTools.listTables, used by ToolRegistry.executeTool to dispatch tool calls.
    const TOOL_IMPLEMENTATIONS = {
      hana_show_config: ConfigTools.showConfig,
      hana_test_connection: ConfigTools.testConnection,
      hana_show_env_vars: ConfigTools.showEnvVars,
      hana_list_schemas: SchemaTools.listSchemas,
      hana_list_tables: TableTools.listTables,
      hana_describe_table: TableTools.describeTable,
      hana_list_indexes: IndexTools.listIndexes,
      hana_describe_index: IndexTools.describeIndex,
      hana_execute_query: QueryTools.executeQuery
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool lists tables but doesn't describe what the output looks like (e.g., format, pagination), whether it requires specific permissions, or any limitations (e.g., performance with large schemas). This leaves significant gaps for a tool that presumably returns data.

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, efficient sentence that front-loads the core purpose ('List all tables') without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it optimally concise.

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 address behavioral aspects like output format, error handling, or usage context relative to siblings. For a simple list tool, this might be minimally adequate, but the absence of output details and sibling differentiation is a notable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'schema_name' documented as optional in the schema. The description adds minimal value beyond this, only implying the parameter's purpose without explaining edge cases (e.g., what happens if omitted, default behavior). Baseline 3 is appropriate given the schema does the heavy lifting.

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 ('List all tables') and resource ('in a specific schema'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'hana_list_schemas' or 'hana_describe_table' beyond the obvious scope difference, preventing a perfect score.

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 like 'hana_list_schemas' (for listing schemas instead of tables) or 'hana_describe_table' (for detailed table info). It also doesn't mention prerequisites or exclusions, leaving usage context entirely implicit.

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

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/HatriGt/hana-mcp-server'

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