Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_create_database

Create a new MySQL database with specified name, character set, and collation settings for organizing and storing data.

Instructions

创建数据库

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes数据库名称
charsetNo字符集(可选)utf8mb4
collationNo排序规则(可选)utf8mb4_unicode_ci

Implementation Reference

  • src/server.ts:71-83 (registration)
    Registers the 'mysql_create_database' tool in the listTools response, including its description and input schema.
    {
      name: 'mysql_create_database',
      description: '创建数据库',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: '数据库名称' },
          charset: { type: 'string', description: '字符集(可选)', default: 'utf8mb4' },
          collation: { type: 'string', description: '排序规则(可选)', default: 'utf8mb4_unicode_ci' },
        },
        required: ['name'],
      },
    },
  • MCP server handler method that calls DatabaseManager.createDatabase and returns success message.
    private async handleCreateDatabase(args: { name: string; charset?: string; collation?: string }): Promise<any> {
      await this.dbManager.createDatabase(args.name, args.charset, args.collation);
      
      return {
        content: [
          {
            type: 'text',
            text: `成功创建数据库: ${args.name}`,
          },
        ],
      };
    }
  • Core implementation that constructs and executes the CREATE DATABASE SQL statement using the query method.
    async createDatabase(name: string, charset?: string, collation?: string): Promise<void> {
      let sql = `CREATE DATABASE \`${name}\``;
      
      if (charset) {
        sql += ` CHARACTER SET ${charset}`;
      }
      
      if (collation) {
        sql += ` COLLATE ${collation}`;
      }
      
      await this.query(sql);
    }
  • src/server.ts:239-240 (registration)
    Dispatch case in CallToolRequest handler that routes to the mysql_create_database handler.
    case 'mysql_create_database':
      return await this.handleCreateDatabase(args as any);
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but fails to do so. It does not mention that this is a mutation operation (creating a database), potential permissions required, side effects, or any behavioral traits like rate limits or error handling.

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?

While concise with a single phrase, the description is under-specified rather than efficiently structured. It lacks front-loaded critical information and fails to earn its place by adding value beyond the tool name, making it ineffective despite its brevity.

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 creation tool with no annotations and no output schema, the description is severely incomplete. It does not address behavioral aspects, usage context, or output expectations, leaving significant gaps for the agent to understand the tool's full scope.

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%, with all parameters documented in the schema itself (name, charset, collation). The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or constraints, so it meets the baseline for high schema coverage.

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 database) is a tautology that restates the tool name 'mysql_create_database' in Chinese, providing no additional specificity or differentiation from siblings like 'mysql_drop_database'. It lacks a clear verb+resource combination or scope details that would help distinguish its exact function.

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 like 'mysql_list_databases' for checking existing databases or 'mysql_drop_database' for deletion. The description offers no context, prerequisites, or exclusions, leaving the agent with no usage direction.

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