Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_drop_database

Delete a MySQL database from the server to remove data and free storage space. Specify the database name to execute this operation.

Instructions

删除数据库

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes数据库名称

Implementation Reference

  • The main handler function for the 'mysql_drop_database' tool. It extracts the database name from arguments and delegates to DatabaseManager.dropDatabase(), then returns a success message.
    private async handleDropDatabase(args: { name: string }): Promise<any> {
      await this.dbManager.dropDatabase(args.name);
      
      return {
        content: [
          {
            type: 'text',
            text: `成功删除数据库: ${args.name}`,
          },
        ],
      };
    }
  • Core helper method in DatabaseManager that executes the actual DROP DATABASE SQL command using the query method.
    async dropDatabase(name: string): Promise<void> {
      await this.query(`DROP DATABASE \`${name}\``);
    }
  • src/server.ts:84-94 (registration)
    Tool registration in the ListTools response, defining the tool name, description, and input schema.
    {
      name: 'mysql_drop_database',
      description: '删除数据库',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: '数据库名称' },
        },
        required: ['name'],
      },
    },
  • src/server.ts:241-242 (registration)
    Dispatch registration in the CallToolRequest switch statement, routing to the handler function.
    case 'mysql_drop_database':
      return await this.handleDropDatabase(args as any);
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. '删除数据库' implies a destructive, irreversible mutation, but it fails to specify critical details: whether it requires admin permissions, if it deletes all associated tables/data, what happens on success/failure (e.g., error if database doesn't exist), or any rate limits. This is inadequate for a high-risk operation.

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

Conciseness5/5

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

The description is a single phrase ('删除数据库'), which is maximally concise and front-loaded with the core action. There is zero wasted verbiage, making it efficient for quick comprehension, though this brevity contributes to gaps in other dimensions.

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

Completeness2/5

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

Given the high complexity and risk of a destructive database operation, with no annotations and no output schema, the description is severely incomplete. It lacks essential context: behavioral traits (e.g., irreversibility), error handling, permissions, and output expectations. This leaves the agent under-informed for safe and effective use.

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 the single parameter 'name' documented as '数据库名称' (database name). The description adds no additional meaning beyond this—it doesn't clarify naming conventions, case sensitivity, or validation rules. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description '删除数据库' (delete database) clearly states the verb (delete) and resource (database), making the purpose immediately understandable. It distinguishes from siblings like mysql_create_database (create) and mysql_list_databases (list), though it doesn't explicitly mention the MySQL context which is implied by the tool name.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a connection via mysql_connect), exclusions (e.g., not for tables—use mysql_drop_table instead), or consequences (e.g., irreversible data loss). This leaves the agent to infer usage from context alone.

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