Skip to main content
Glama
tannerpace

Oracle Database MCP Server

get_database_schema

Retrieve Oracle database schema details including table lists and column information for specific tables to understand database structure and relationships.

Instructions

Get database schema information. If tableName is provided, returns column details for that table. Otherwise, returns a list of all accessible tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameNoOptional table name to get column information for

Implementation Reference

  • The main handler function that implements the logic for the 'get_database_schema' tool. It validates the input, queries the database schema (delegating to getSchema helper), logs activity, and returns a structured success or error response.
    export async function getDatabaseSchema(input: GetSchemaInput = {}) { try { const validated = GetSchemaSchema.parse(input); logger.info('Getting database schema via MCP tool', { tableName: validated.tableName || 'all tables', }); const result = await getSchema(validated.tableName); return { success: true, data: result, }; } catch (err: any) { logger.error('Get schema tool failed', { error: err.message }); return { success: false, error: err.message || 'Unknown error occurred', }; } }
  • Zod input schema and TypeScript type definition for the 'get_database_schema' tool, defining optional tableName parameter.
    export const GetSchemaSchema = z.object({ tableName: z.string().optional(), }); export type GetSchemaInput = z.infer<typeof GetSchemaSchema>;
  • src/server.ts:61-74 (registration)
    MCP tool registration entry listing 'get_database_schema' with its description and JSON input schema, used by the server to advertise available tools.
    { name: 'get_database_schema', description: 'Get database schema information. If tableName is provided, returns column details for that table. Otherwise, returns a list of all accessible tables.', inputSchema: { type: 'object', properties: { tableName: { type: 'string', description: 'Optional table name to get column information for', }, }, }, },

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/tannerpace/mcp-oracle-database'

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