Skip to main content
Glama
nilsir

MCP Server MySQL

by nilsir

drop_table

Delete a table from a MySQL database to remove unnecessary data structures, manage storage, or reorganize database schemas.

Instructions

Drop/delete a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name
databaseNoDatabase name (optional)

Implementation Reference

  • Handler function for the drop_table tool. It constructs the table name (optionally qualified with database), executes the DROP TABLE SQL command using the connection pool, prepares a success output, and returns a structured response with text content.
    async ({ table, database }) => {
      const p = await getPool();
    
      const tableName = database ? `\`${database}\`.\`${table}\`` : `\`${table}\``;
      await p.execute(`DROP TABLE ${tableName}`);
    
      const output = { success: true, table, database: database || null };
    
      return {
        content: [
          {
            type: "text" as const,
            text: `Table ${table} dropped successfully`,
          },
        ],
        structuredContent: output,
      };
    }
  • Zod schema defining the input parameters for the drop_table tool: required 'table' string and optional 'database' string.
    {
      table: z.string().describe("Table name"),
      database: z.string().optional().describe("Database name (optional)"),
    },
  • src/index.ts:409-434 (registration)
    Registration of the drop_table tool via server.tool(), including name, description, input schema, and handler function.
    server.tool(
      "drop_table",
      "Drop/delete a table",
      {
        table: z.string().describe("Table name"),
        database: z.string().optional().describe("Database name (optional)"),
      },
      async ({ table, database }) => {
        const p = await getPool();
    
        const tableName = database ? `\`${database}\`.\`${table}\`` : `\`${table}\``;
        await p.execute(`DROP TABLE ${tableName}`);
    
        const output = { success: true, table, database: database || null };
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Table ${table} dropped successfully`,
            },
          ],
          structuredContent: output,
        };
      }
    );
Behavior2/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. 'Drop/delete' implies a destructive, irreversible mutation, but the description doesn't specify whether this requires specific permissions, what happens to dependent objects (like indexes), whether it's transactional, or what confirmation/response to expect. For a destructive tool with zero annotation coverage, this is a significant gap.

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 extremely concise ('Drop/delete a table')—just three words—with zero wasted language. It's front-loaded with the core action and resource, making it efficient for quick understanding. Every word earns its place by specifying both the verb and target.

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 tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address critical context like irreversible deletion, permissions needed, effects on related objects, or what the tool returns (e.g., success/failure message). For a high-stakes mutation tool, more behavioral and output information is warranted.

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 clear parameter descriptions ('Table name' for 'table', 'Database name (optional)' for 'database'). The description adds no additional parameter semantics beyond what the schema provides, such as format examples (e.g., case sensitivity) or default database behavior. With high schema coverage, a baseline score of 3 is appropriate.

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 'Drop/delete a table' clearly states the action (drop/delete) and the resource (a table), making the purpose immediately understandable. It distinguishes from siblings like 'drop_database' by specifying 'table' rather than 'database', but doesn't explicitly differentiate from similar tools like 'alter_table' or 'execute' that might also modify tables.

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 (like needing to connect to a database first), when not to use it (e.g., for temporary removal vs. permanent deletion), or how it differs from siblings like 'alter_table' (which modifies structure) or 'execute' (which might run DELETE statements).

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/nilsir/mcp-server-mysql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server