mysql_drop_table
Remove a table from a MySQL database by specifying the table name. This tool helps manage database structure by deleting unnecessary tables.
Instructions
删除表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes | 表名称 |
Implementation Reference
- src/server.ts:382-393 (handler)MCP tool handler for 'mysql_drop_table'. Extracts tableName argument and delegates to DatabaseManager.dropTable, returning success message.private async handleDropTable(args: { tableName: string }): Promise<any> { await this.dbManager.dropTable(args.tableName); return { content: [ { type: 'text', text: `成功删除表: ${args.tableName}`, }, ], }; }
- src/server.ts:128-138 (schema)Tool schema registration including input schema for 'mysql_drop_table' (requires tableName).{ name: 'mysql_drop_table', description: '删除表', inputSchema: { type: 'object', properties: { tableName: { type: 'string', description: '表名称' }, }, required: ['tableName'], }, },
- src/server.ts:249-250 (registration)Switch case in CallToolRequestSchema handler that routes 'mysql_drop_table' calls to handleDropTable.case 'mysql_drop_table': return await this.handleDropTable(args as any);
- src/database.ts:182-184 (helper)DatabaseManager helper method that executes the actual DROP TABLE SQL statement via the query method.async dropTable(tableName: string): Promise<void> { await this.query(`DROP TABLE \`${tableName}\``); }