Skip to main content
Glama
samscarrow

Oracle MCP Server

by samscarrow

describe_table

Retrieve detailed table structure, including column names, data types, and constraints, from Oracle databases using schema-specific or global searches.

Instructions

Get table structure including columns, data types, and constraints

Input Schema

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

Implementation Reference

  • The handler function for describe_table tool. Queries Oracle's all_tab_columns view to fetch table columns, data types, lengths, precision, scale, nullability, defaults, and orders them by column_id. Returns formatted JSON with table info and columns.
    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 string and optional schema string.
    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)
    Switch case registration that dispatches describe_table tool calls to the handleDescribeTable method.
    case 'describe_table': return await this.handleDescribeTable(args);
  • 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'] } },

Other Tools

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

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