Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_create_table

Create tables in MySQL databases using SQL statements. This tool enables structured data storage by defining table schemas with columns, data types, and constraints.

Instructions

创建表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes创建表的 SQL 语句

Implementation Reference

  • The main handler function for the 'mysql_create_table' tool. It receives the SQL from arguments and delegates to DatabaseManager.createTable to execute it, then 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 that it requires a 'sql' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        sql: { type: 'string', description: '创建表的 SQL 语句' },
      },
      required: ['sql'],
    },
  • src/server.ts:247-248 (registration)
    Registration in the CallToolRequestSchema switch statement that routes calls to mysql_create_table to the handleCreateTable method.
    case 'mysql_create_table':
      return await this.handleCreateTable(args as any);
  • src/server.ts:117-127 (registration)
    Tool registration in the ListToolsRequestSchema response, defining the tool's name, description, and input schema.
    {
      name: 'mysql_create_table',
      description: '创建表',
      inputSchema: {
        type: 'object',
        properties: {
          sql: { type: 'string', description: '创建表的 SQL 语句' },
        },
        required: ['sql'],
      },
    },
  • Helper method in DatabaseManager that executes the provided CREATE TABLE SQL using the query method.
    async createTable(sql: string): Promise<void> {
      await this.query(sql);
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. '创建表' (create table) implies a write/mutation operation, but it doesn't disclose any behavioral traits such as permissions required, whether it's idempotent, error handling, or effects on the database (e.g., schema changes). This leaves critical gaps for an AI agent to understand how to invoke it safely and effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly concise at just two characters ('创建表'), leading to under-specification rather than effective brevity. It lacks structure (e.g., no front-loaded key details) and fails to earn its place by omitting essential context, making it inefficient for guiding an AI agent despite its short length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a database mutation tool with no annotations and no output schema, the description is severely incomplete. It doesn't explain what the tool does beyond the tautological name, provide usage context, detail behavioral aspects, or hint at return values. This inadequately supports an AI agent in selecting and invoking the tool correctly for a non-trivial operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'sql' parameter is documented as '创建表的 SQL 语句' or 'SQL statement to create a table'), so the schema provides full parameter semantics. The description adds no additional meaning beyond what's in the schema, but the baseline is 3 since the schema adequately covers the single parameter without needing extra explanation from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '创建表' (create table) restates the tool name 'mysql_create_table' in Chinese, making it a tautology. It specifies the verb 'create' and resource 'table' but doesn't distinguish it from sibling tools like 'mysql_create_database' beyond the obvious resource difference, nor does it clarify what 'creating a table' entails in this context (e.g., SQL execution).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a database connection via 'mysql_connect'), exclusions (e.g., not for modifying existing tables), or comparisons to siblings like 'mysql_query' for general SQL execution. The description is too minimal to imply any usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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