Skip to main content
Glama
HatriGt

HANA Cloud MCP Server

by HatriGt

hana_describe_index

Retrieve the structure of a specific index in SAP HANA Cloud to understand its columns, organization, and properties for database optimization and query performance analysis.

Instructions

Describe the structure of a specific index

Input Schema

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

Implementation Reference

  • The handler function IndexTools.describeIndex that implements the core logic for the hana_describe_index tool: validates parameters, fetches index details via QueryExecutor, formats output, and handles errors.
    static async describeIndex(args) {
      logger.tool('hana_describe_index', args);
      
      let { schema_name, table_name, index_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', 'index_name'], 'hana_describe_index');
      if (!validation.valid) {
        return Formatters.createErrorResponse('Error: table_name and index_name parameters are required', validation.error);
      }
      
      // Validate schema, table, and index 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);
      }
      
      const indexValidation = Validators.validateIndexName(index_name);
      if (!indexValidation.valid) {
        return Formatters.createErrorResponse('Invalid index name', indexValidation.error);
      }
      
      try {
        const results = await QueryExecutor.getIndexDetails(schema_name, table_name, index_name);
        
        const formattedDetails = Formatters.formatIndexDetails(results, schema_name, table_name, index_name);
        
        return Formatters.createResponse(formattedDetails);
      } catch (error) {
        logger.error('Error describing index:', error.message);
        return Formatters.createErrorResponse('Error describing index', error.message);
      }
    }
  • The input schema definition for hana_describe_index, specifying properties and required fields: table_name and index_name.
      name: "hana_describe_index",
      description: "Describe the structure of a specific index",
      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 containing the index"
          },
          index_name: {
            type: "string",
            description: "Name of the index to describe"
          }
        },
        required: ["table_name", "index_name"]
      }
    },
  • Tool registration mapping 'hana_describe_index' to IndexTools.describeIndex in the TOOL_IMPLEMENTATIONS object used by ToolRegistry.
    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 the full burden of behavioral disclosure. It states the tool describes index structure but doesn't reveal any behavioral traits such as whether it's a read-only operation, potential performance impacts, error handling, or output format. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 extremely concise and front-loaded with a single, clear sentence that directly states the tool's purpose. There is no wasted language or unnecessary elaboration, making it efficient and easy to parse for an AI agent.

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 tool's complexity (describing database index structure) and lack of annotations and output schema, the description is insufficiently complete. It doesn't cover behavioral aspects, usage context, or what information is returned, leaving the agent with inadequate guidance for effective tool invocation in a database management scenario.

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 input schema has 100% description coverage, clearly documenting all three parameters (schema_name, table_name, index_name) with their types and optionality. The description adds no additional semantic context beyond what the schema provides, such as explaining relationships between parameters or usage examples, so it meets the baseline for high schema coverage without compensating value.

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 tool's purpose with a specific verb ('describe') and resource ('structure of a specific index'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'hana_describe_table' or 'hana_list_indexes', which would require mentioning it focuses on detailed structural metadata rather than listing or describing tables.

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 sibling tools like 'hana_list_indexes' for listing indexes or 'hana_describe_table' for table details, nor does it specify prerequisites or contexts for usage, leaving the agent to infer appropriate scenarios.

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