Skip to main content
Glama

drop_table

Remove a table from your MSSQL database to delete data and free storage space. Specify the table name to execute this schema operation.

Instructions

Drops a table from the MSSQL Database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table to drop

Implementation Reference

  • The async run method that executes the drop_table tool logic: validates tableName, executes DROP TABLE query via MSSQL, returns success/error response.
    async run(params: any) {
      try {
        const { tableName } = params;
        // Basic validation to prevent SQL injection
        if (!/^[\w\d_]+$/.test(tableName)) {
          throw new Error("Invalid table name.");
        }
        const query = `DROP TABLE [${tableName}]`;
        await new sql.Request().query(query);
        return {
          success: true,
          message: `Table '${tableName}' dropped successfully.`
        };
      } catch (error) {
        console.error("Error dropping table:", error);
        return {
          success: false,
          message: `Failed to drop table: ${error}`
        };
      }
    }
  • Input schema definition for drop_table tool, specifying required 'tableName' string property.
    inputSchema = {
      type: "object",
      properties: {
        tableName: { type: "string", description: "Name of the table to drop" }
      },
      required: ["tableName"],
    } as any;
  • src/index.ts:115-119 (registration)
    Registration of dropTableTool in the ListToolsRequestSchema handler's tools array (non-readonly mode).
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: isReadOnly
        ? [listTableTool, readDataTool, describeTableTool] // todo: add searchDataTool to the list of tools available in readonly mode once implemented
        : [insertDataTool, readDataTool, describeTableTool, updateDataTool, createTableTool, createIndexTool, dropTableTool, listTableTool], // add all new tools here
    }));
  • src/index.ts:144-146 (registration)
    Switch case in CallToolRequestSchema handler that routes 'drop_table' calls to dropTableTool.run().
    case dropTableTool.name:
      result = await dropTableTool.run(args);
      break;
  • src/index.ts:95-95 (registration)
    Instantiation of the DropTableTool instance referenced throughout the server.
    const dropTableTool = new DropTableTool();
Behavior2/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. It states the action ('Drops') which implies a destructive mutation, but it doesn't elaborate on critical traits such as irreversibility, permission requirements, or potential side effects (e.g., data loss, dependencies). This is a significant gap for a destructive tool.

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, direct sentence with zero waste—it states the action and resource efficiently. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly without unnecessary elaboration.

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 high complexity (destructive database operation) and lack of annotations or output schema, the description is incomplete. It fails to address critical context like safety warnings, return values, or error conditions, which are essential for proper agent usage in this scenario.

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?

The schema description coverage is 100%, with the single parameter 'tableName' clearly documented in the schema. The description doesn't add any additional meaning or context beyond what the schema provides, such as format examples 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.

Purpose4/5

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

The description clearly states the action ('Drops') and resource ('a table from the MSSQL Database'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_table' or 'describe_table' beyond the obvious verb difference, which keeps it from a perfect score.

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., table must exist), exclusions (e.g., irreversible nature), or comparisons to siblings like 'list_table' or 'update_data', leaving the agent with minimal context for decision-making.

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/Nirmal123K/mssql-mcp'

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