Skip to main content
Glama
git-scarrow

Oracle MCP Server

by git-scarrow

describe_table

Retrieve table structure details including columns, data types, and constraints from Oracle databases to understand database schema organization.

Instructions

Get table structure including columns, data types, and constraints

Input Schema

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

Implementation Reference

  • The handler function that executes the describe_table tool. It constructs a SQL query against ALL_TAB_COLUMNS to retrieve column metadata for the specified table, optionally filtered by schema, and returns formatted JSON.
    async handleDescribeTable(args) {
      const query = `
        SELECT 
          owner AS schema_name,
          column_name,
          data_type,
          data_length,
          data_precision,
          data_scale,
          nullable,
          data_default,
          column_id
        FROM all_tab_columns
        WHERE table_name = :1
          ${args.schema ? 'AND owner = :2' : ''}
        ORDER BY owner, column_id
      `;
      
      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({
              table: args.table_name,
              schema: args.schema || 'all accessible schemas',
              columns: result.rows
            }, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the describe_table tool, specifying table_name as required and schema as optional.
    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:211-228 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for describe_table.
    {
      name: 'describe_table',
      description: 'Get table structure including columns, data types, and constraints',
      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:288-289 (registration)
    Dispatch in CallToolRequest handler switch statement that routes describe_table calls to the handler function.
    case 'describe_table':
      return await this.handleDescribeTable(args);
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. While 'Get' implies a read-only operation, the description doesn't specify whether this requires specific permissions, what happens if the table doesn't exist, whether it returns metadata in a structured format, or if there are any rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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. Every word earns its place by specifying what is retrieved ('table structure') and what details are included ('columns, data types, and constraints'). There's no redundancy or unnecessary elaboration.

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 no annotations and no output schema, the description is incomplete for a tool that retrieves metadata. It doesn't describe the return format (e.g., structured JSON, plain text), what happens on errors, or whether the output includes additional details like column defaults or foreign keys. For a metadata retrieval tool with rich sibling tools, more context is needed.

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%, so the schema already documents both parameters ('table_name' and 'schema') with clear descriptions. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain format requirements for table names or default behavior for schema searches). Baseline 3 is appropriate when 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 ('Get') and resource ('table structure') with specific details about what information is included ('columns, data types, and constraints'). It distinguishes from siblings like 'list_tables' (which would list names only) and 'get_table_constraints' (which would focus only on constraints). However, it doesn't explicitly mention how it differs from 'get_table_indexes' or 'execute_query' for structure 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 when this tool is preferred over 'get_table_constraints' (for just constraints) or 'execute_query' (for custom SQL queries about table structure). There's no context about prerequisites, error conditions, or performance considerations.

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