Skip to main content
Glama
HatriGt

HANA Cloud MCP Server

by HatriGt

hana_describe_table

Retrieve table structure details including column names, data types, and constraints from SAP HANA Cloud Database to understand data organization and relationships.

Instructions

Describe the structure of a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schema_nameNoName of the schema containing the table (optional)
table_nameYesName of the table to describe

Implementation Reference

  • Main execution logic for hana_describe_table tool: handles args, defaults schema, validates inputs, queries table columns, formats and returns structure.
    static async describeTable(args) {
      logger.tool('hana_describe_table', args);
      
      let { schema_name, table_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 required parameters
      const validation = Validators.validateRequired(args, ['table_name'], 'hana_describe_table');
      if (!validation.valid) {
        return Formatters.createErrorResponse('Error: table_name parameter is required', validation.error);
      }
      
      // Validate schema and table names
      const schemaValidation = Validators.validateSchemaName(schema_name);
      if (!schemaValidation.valid) {
        return Formatters.createErrorResponse('Invalid schema name', schemaValidation.error);
      }
      
      const tableValidation = Validators.validateTableName(table_name);
      if (!tableValidation.valid) {
        return Formatters.createErrorResponse('Invalid table name', tableValidation.error);
      }
      
      try {
        const columns = await QueryExecutor.getTableColumns(schema_name, table_name);
        
        if (columns.length === 0) {
          return Formatters.createErrorResponse(`Table '${schema_name}.${table_name}' not found or no columns available`);
        }
        
        const formattedStructure = Formatters.formatTableStructure(columns, schema_name, table_name);
        
        return Formatters.createResponse(formattedStructure);
      } catch (error) {
        logger.error('Error describing table:', error.message);
        return Formatters.createErrorResponse('Error describing table', error.message);
      }
    }
  • Input schema definition for hana_describe_table, specifying optional schema_name and required table_name.
    {
      name: "hana_describe_table",
      description: "Describe the structure of a specific table",
      inputSchema: {
        type: "object",
        properties: {
          schema_name: {
            type: "string",
            description: "Name of the schema containing the table (optional)"
          },
          table_name: {
            type: "string",
            description: "Name of the table to describe"
          }
        },
        required: ["table_name"]
      }
    },
  • ToolRegistry maps tool names to implementations, registering hana_describe_table to TableTools.describeTable.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks critical details: it doesn't specify if this is a read-only operation, what permissions are required, what the output format looks like (e.g., column names, types, constraints), or any error conditions (e.g., invalid table names). For a tool with no annotation coverage, this is a significant gap in transparency.

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 ('Describe the structure of a specific table') with zero wasted words. It avoids redundancy and is appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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 for effective tool use. It doesn't explain what 'describe' entails (e.g., returns metadata like columns and data types), potential side effects, or error handling. For a tool with no structured output information, the description should compensate by detailing return values or usage constraints, which it fails to do.

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?

Schema description coverage is 100%, with clear documentation for both parameters (schema_name and table_name). The description adds minimal value beyond the schema, as it only implies that table_name is the key input without providing additional context like format examples or relationships between parameters. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 verb ('describe') and resource ('structure of a specific table'), making the purpose immediately understandable. It distinguishes this from siblings like hana_list_tables (which lists tables) and hana_describe_index (which describes indexes). However, it doesn't explicitly mention the database system (HANA) or differentiate from hana_execute_query, which could also provide structural information through queries.

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., needing a valid table name), compare it to hana_list_tables for discovery or hana_execute_query for custom queries, or specify use cases like schema exploration or query planning. The agent must infer usage from the tool name and context alone.

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