list_databases
Retrieve all accessible databases on a MySQL server to identify available data sources for querying and analysis.
Instructions
List all accessible databases on the MySQL server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:135-149 (handler)Handler for the 'list_databases' tool. Executes 'SHOW DATABASES' SQL query using the shared executeQuery function and returns the results as formatted JSON text content.case "list_databases": { console.error('[Tool] Executing list_databases'); const { rows } = await executeQuery( pool, 'SHOW DATABASES' ); return { content: [{ type: "text", text: JSON.stringify(rows, null, 2) }] }; }
- src/index.ts:66-74 (registration)Registration of the 'list_databases' tool in the ListTools response, including name, description, and empty input schema (no parameters required).{ name: "list_databases", description: "List all accessible databases on the MySQL server", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:69-73 (schema)Input schema definition for 'list_databases' tool: an empty object (no input parameters).inputSchema: { type: "object", properties: {}, required: [] }