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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_databases"
}
}Input 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: [] }