Skip to main content
Glama
samscarrow

Oracle MCP Server

by samscarrow

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);

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

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