Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_create_table

Generate MySQL tables using structured SQL commands. Streamline table creation within MySQL databases, enabling efficient schema design and data organization.

Instructions

创建表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes创建表的 SQL 语句

Implementation Reference

  • The handler function for the 'mysql_create_table' tool. It executes the provided SQL via the DatabaseManager and returns a success message.
    private async handleCreateTable(args: { sql: string }): Promise<any> { await this.dbManager.createTable(args.sql); return { content: [ { type: 'text', text: '成功创建表', }, ], }; }
  • Input schema definition for the mysql_create_table tool, specifying the required 'sql' parameter.
    name: 'mysql_create_table', description: '创建表', inputSchema: { type: 'object', properties: { sql: { type: 'string', description: '创建表的 SQL 语句' }, }, required: ['sql'], }, },
  • src/server.ts:247-248 (registration)
    Switch case in the CallToolRequest handler that routes 'mysql_create_table' calls to the appropriate handler method.
    case 'mysql_create_table': return await this.handleCreateTable(args as any);
  • Helper method in DatabaseManager that executes the raw CREATE TABLE SQL query.
    async createTable(sql: string): Promise<void> { await this.query(sql); }

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