list_schemas
Retrieve all database schemas to enable SQL queries and database introspection across Oracle databases.
Instructions
List all schemas in the database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.js:506-529 (handler)The handler function for the 'list_schemas' tool. It executes a SQL query against the ALL_USERS view to retrieve distinct schema names, their creation dates, and classifies them as SYSTEM or USER schemas, then returns the results as formatted JSON.async handleListSchemas(args) { const query = ` SELECT DISTINCT username AS schema_name, created, CASE WHEN username IN ('SYS', 'SYSTEM', 'DBSNMP', 'SYSMAN') THEN 'SYSTEM' ELSE 'USER' END AS schema_type FROM all_users ORDER BY username `; const result = await this.executeQuery(query); return { content: [ { type: 'text', text: JSON.stringify(result.rows, null, 2) } ] }; }
- src/index.js:265-272 (registration)Registration of the 'list_schemas' tool in the ListToolsRequestHandler, including its name, description, and input schema (empty object since no parameters required).{ name: 'list_schemas', description: 'List all schemas in the database', inputSchema: { type: 'object', properties: {} } }
- src/index.js:268-271 (schema)Input schema definition for the 'list_schemas' tool, specifying an empty object as no input parameters are required.inputSchema: { type: 'object', properties: {} }
- src/index.js:297-298 (handler)Dispatch case in the CallToolRequestHandler that routes 'list_schemas' calls to the handleListSchemas method.case 'list_schemas': return await this.handleListSchemas(args);