Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_drop_database

Delete a MySQL database from the server to remove data and free storage space. Specify the database name to execute this operation.

Instructions

删除数据库

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes数据库名称

Implementation Reference

  • The main handler function for the 'mysql_drop_database' tool. It extracts the database name from arguments and delegates to DatabaseManager.dropDatabase(), then returns a success message.
    private async handleDropDatabase(args: { name: string }): Promise<any> { await this.dbManager.dropDatabase(args.name); return { content: [ { type: 'text', text: `成功删除数据库: ${args.name}`, }, ], }; }
  • Core helper method in DatabaseManager that executes the actual DROP DATABASE SQL command using the query method.
    async dropDatabase(name: string): Promise<void> { await this.query(`DROP DATABASE \`${name}\``); }
  • src/server.ts:84-94 (registration)
    Tool registration in the ListTools response, defining the tool name, description, and input schema.
    { name: 'mysql_drop_database', description: '删除数据库', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '数据库名称' }, }, required: ['name'], }, },
  • src/server.ts:241-242 (registration)
    Dispatch registration in the CallToolRequest switch statement, routing to the handler function.
    case 'mysql_drop_database': return await this.handleDropDatabase(args as any);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/mysql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server