list_schemas
Retrieve a list of all schemas in an Oracle database to facilitate database introspection, query execution, and schema management tasks.
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 main handler function for the 'list_schemas' tool. It executes a SQL query against the ALL_USERS view to retrieve a list of schemas, categorizing them as SYSTEM or USER, and returns the results as 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 ListToolsRequestSchema handler. Defines the tool name, description, and empty input schema (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 for the 'list_schemas' tool, which is an empty object since no input parameters are required.inputSchema: { type: 'object', properties: {} }