drop_database
Delete a MySQL database from the MCP Server MySQL to remove unused or obsolete data storage structures.
Instructions
Drop/delete a database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database name |
Implementation Reference
- src/index.ts:475-491 (handler)The asynchronous handler function that performs the DROP DATABASE operation using the MySQL connection pool and returns success response.async ({ database }) => { const p = await getPool(); await p.execute(`DROP DATABASE \`${database}\``); const output = { success: true, database }; return { content: [ { type: "text" as const, text: `Database ${database} dropped successfully`, }, ], structuredContent: output, }; }
- src/index.ts:472-474 (schema)Zod input schema defining the required 'database' parameter for the tool.{ database: z.string().describe("Database name"), },
- src/index.ts:469-492 (registration)The server.tool registration call that defines and registers the drop_database tool, including its name, description, input schema, and handler function.server.tool( "drop_database", "Drop/delete a database", { database: z.string().describe("Database name"), }, async ({ database }) => { const p = await getPool(); await p.execute(`DROP DATABASE \`${database}\``); const output = { success: true, database }; return { content: [ { type: "text" as const, text: `Database ${database} dropped successfully`, }, ], structuredContent: output, }; } );