Skip to main content
Glama
samscarrow

Oracle MCP Server

by samscarrow

list_tables

Retrieve table names from Oracle database schemas using optional filters for schema and table patterns to identify available data structures.

Instructions

List tables from specified schema or all accessible schemas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema name (optional, shows all accessible schemas if not specified)
patternNoTable name pattern (supports % wildcards)

Implementation Reference

  • The main handler function for the 'list_tables' tool. It constructs a dynamic SQL query against the ALL_TABLES view, applying optional filters for schema and table name pattern, executes it using the shared executeQuery method, and returns the results as JSON-formatted text content.
    async handleListTables(args) { let query = ` SELECT owner AS schema_name, table_name, num_rows, last_analyzed FROM all_tables WHERE 1=1 `; const params = []; if (args.schema) { query += ` AND owner = :1`; params.push(args.schema.toUpperCase()); } if (args.pattern) { query += ` AND table_name LIKE :${params.length + 1}`; params.push(args.pattern.toUpperCase()); } query += ` ORDER BY owner, table_name`; const result = await this.executeQuery(query, params); return { content: [ { type: 'text', text: JSON.stringify(result.rows, null, 2) } ] }; }
  • src/index.js:194-210 (registration)
    Tool registration in the ListToolsRequestHandler response. Defines the tool name, description, and input schema specifying optional 'schema' and 'pattern' parameters.
    { name: 'list_tables', description: 'List tables from specified schema or all accessible schemas', inputSchema: { type: 'object', properties: { schema: { type: 'string', description: 'Schema name (optional, shows all accessible schemas if not specified)' }, pattern: { type: 'string', description: 'Table name pattern (supports % wildcards)' } } } },
  • Input schema definition for the list_tables tool, validating optional schema name and table pattern parameters.
    inputSchema: { type: 'object', properties: { schema: { type: 'string', description: 'Schema name (optional, shows all accessible schemas if not specified)' }, pattern: { type: 'string', description: 'Table name pattern (supports % wildcards)' } } }

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