Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_drop_table

Remove a specified table from a MySQL database using natural language commands on the MySQL MCP Server. Simplifies table deletion for streamlined database management.

Instructions

删除表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYes表名称

Implementation Reference

  • The handler function for the 'mysql_drop_table' tool. It extracts the tableName from arguments, calls dbManager.dropTable to perform the drop operation, and returns a success message.
    private async handleDropTable(args: { tableName: string }): Promise<any> { await this.dbManager.dropTable(args.tableName); return { content: [ { type: 'text', text: `成功删除表: ${args.tableName}`, }, ], }; }
  • The tool registration object including name, description, and input schema definition for 'mysql_drop_table'. The schema requires a 'tableName' string.
    { name: 'mysql_drop_table', description: '删除表', inputSchema: { type: 'object', properties: { tableName: { type: 'string', description: '表名称' }, }, required: ['tableName'], }, },
  • The DatabaseManager.dropTable method that executes the actual DROP TABLE SQL query.
    async dropTable(tableName: string): Promise<void> { await this.query(`DROP TABLE \`${tableName}\``); }
  • src/server.ts:249-250 (registration)
    The switch case in the main request handler that routes calls to 'mysql_drop_table' to the handleDropTable function.
    case 'mysql_drop_table': return await this.handleDropTable(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