Skip to main content
Glama
pickstar-2002

MySQL MCP Server

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
NameRequiredDescriptionDefault
tableNameYes表名称

Implementation Reference

  • 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}`, }, ], }; }
  • 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);
  • 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}\``); }

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