Skip to main content
Glama
git-scarrow

Oracle MCP Server

by git-scarrow

get_table_indexes

Retrieve index information for Oracle database tables to analyze query performance and optimize database structure.

Instructions

Get indexes for a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesTable name
schemaNoSchema name (optional, searches all accessible schemas if not specified)

Implementation Reference

  • The handler function that queries Oracle's ALL_INDEXES and ALL_IND_COLUMNS views to retrieve index information for the specified table, including schema if provided.
    async handleGetTableIndexes(args) {
      const query = `
        SELECT 
          i.owner AS schema_name,
          i.index_name,
          i.index_type,
          i.uniqueness,
          i.status,
          i.tablespace_name,
          LISTAGG(ic.column_name, ', ') WITHIN GROUP (ORDER BY ic.column_position) AS columns
        FROM all_indexes i
        JOIN all_ind_columns ic ON i.index_name = ic.index_name AND i.owner = ic.index_owner
        WHERE i.table_name = :1
          ${args.schema ? 'AND i.owner = :2' : ''}
        GROUP BY i.owner, i.index_name, i.index_type, i.uniqueness, i.status, i.tablespace_name
        ORDER BY i.owner, i.index_name
      `;
      
      const params = [args.table_name.toUpperCase()];
      if (args.schema) {
        params.push(args.schema.toUpperCase());
      }
      
      const result = await this.executeQuery(query, params);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result.rows, null, 2)
          }
        ]
      };
    }
  • Input schema defining parameters for the get_table_indexes tool: table_name (required) and optional schema.
    inputSchema: {
      type: 'object',
      properties: {
        table_name: {
          type: 'string',
          description: 'Table name'
        },
        schema: {
          type: 'string',
          description: 'Schema name (optional, searches all accessible schemas if not specified)'
        }
      },
      required: ['table_name']
    }
  • src/index.js:229-246 (registration)
    Tool registration in the list of available tools returned by ListToolsRequestHandler.
    {
      name: 'get_table_indexes',
      description: 'Get indexes for a specific table',
      inputSchema: {
        type: 'object',
        properties: {
          table_name: {
            type: 'string',
            description: 'Table name'
          },
          schema: {
            type: 'string',
            description: 'Schema name (optional, searches all accessible schemas if not specified)'
          }
        },
        required: ['table_name']
      }
    },
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 action ('Get indexes') but lacks details on permissions needed, rate limits, whether it's read-only or has side effects, or what the output format might be. This is a significant gap for a tool that interacts with database structures.

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 directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy 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. It doesn't explain what the tool returns (e.g., index names, types, columns), potential errors, or how it fits into broader database operations. For a tool with 2 parameters and no structured output, more context is needed to guide effective use.

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%, so the input schema already documents both parameters ('table_name' and 'schema') clearly. The description adds no additional meaning beyond what's in the schema, such as examples or constraints, so it meets the baseline for adequate but not exceptional coverage.

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 ('Get') and resource ('indexes for a specific table'), making it easy to understand what it does. However, it doesn't differentiate from sibling tools like 'describe_table' or 'get_table_constraints', which might also provide table metadata, so it doesn't reach the highest 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. For example, it doesn't mention if this is for database optimization, debugging, or how it differs from 'describe_table' or 'get_table_constraints' in the sibling list. This leaves the agent without context for selection.

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/git-scarrow/oracle-mcp-server'

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