Skip to main content
Glama
isaacgounton

SQLite MCP Server

drop_table

Delete a table from the SQLite database permanently. Provide the table name to remove the table and all its data irreversibly.

Instructions

Drop (delete) a table from the database. This action is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to drop

Implementation Reference

  • The handler for the 'drop_table' tool. Extracts table_name from args, validates it, executes DROP TABLE IF EXISTS, and returns a success message.
    case 'drop_table': {
      const { table_name } = toolArgs as { table_name: string };
      validateTableName(table_name);
      db.run(`DROP TABLE IF EXISTS "${table_name}"`);
      return { content: [{ type: 'text', text: `Table "${table_name}" dropped successfully` }] };
    }
  • Registration and input schema definition for the 'drop_table' tool. Defines the input schema requiring 'table_name' (a string) and provides the tool description.
    {
      name: 'drop_table',
      description: 'Drop (delete) a table from the database. This action is irreversible.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          table_name: { type: 'string', description: 'Name of the table to drop' },
        },
        required: ['table_name'],
      },
    },
  • src/index.ts:196-274 (registration)
    Tool registration via ListToolsRequestSchema handler. All tools including 'drop_table' are registered here in the tools array passed to the server.
    // ── Tools ──
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'read_query',
          description: 'Execute a read-only SQL query (SELECT, WITH/CTE, or EXPLAIN). Use this for fetching data.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              query: { type: 'string', description: 'The SELECT SQL query to execute' },
            },
            required: ['query'],
          },
        },
        {
          name: 'write_query',
          description: 'Execute a data modification query (INSERT, UPDATE, DELETE, REPLACE). Returns affected row count.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              query: { type: 'string', description: 'The SQL modification query to execute' },
            },
            required: ['query'],
          },
        },
        {
          name: 'create_table',
          description: 'Create a new table in the database with a full CREATE TABLE SQL statement.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              query: { type: 'string', description: 'CREATE TABLE SQL statement' },
            },
            required: ['query'],
          },
        },
        {
          name: 'drop_table',
          description: 'Drop (delete) a table from the database. This action is irreversible.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              table_name: { type: 'string', description: 'Name of the table to drop' },
            },
            required: ['table_name'],
          },
        },
        {
          name: 'list_tables',
          description: 'List all user-created tables in the database.',
          inputSchema: {
            type: 'object' as const,
            properties: {},
          },
        },
        {
          name: 'describe_table',
          description: 'Get the schema of a table: columns, types, constraints, indexes, and foreign keys.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              table_name: { type: 'string', description: 'Name of the table to describe' },
            },
            required: ['table_name'],
          },
        },
        {
          name: 'append_insight',
          description: 'Add a business insight to the insights memo resource. Useful for recording observations from analysis.',
          inputSchema: {
            type: 'object' as const,
            properties: {
              insight: { type: 'string', description: 'The business insight to record' },
            },
            required: ['insight'],
          },
        },
      ],
    }));
  • Validation helper used by drop_table handler. Validates that the table name matches the pattern /^[a-zA-Z_][a-zA-Z0-9_]*$/ to prevent SQL injection.
    function validateTableName(name: string): void {
      if (!VALID_IDENTIFIER.test(name)) {
        throw new McpError(ErrorCode.InvalidParams, `Invalid table name: "${name}". Use only letters, numbers, and underscores.`);
      }
    }
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses irreversibility but not other behaviors like permission requirements or cascading effects.

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 two succinct sentences with the verb front-loaded, no wasted words.

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

Completeness4/5

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

Given the low complexity (one param, no output schema), the description covers the essential purpose and one key behavior (irreversibility), which is sufficient.

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 coverage is 100% and the param description is clear. The tool description adds little beyond the schema, so a baseline of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the verb (drop/delete) and resource (table) and distinguishes it from siblings like create_table, describe_table, list_tables.

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

Usage Guidelines3/5

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

The description mentions irreversibility as a caution but does not explicitly state when to use versus alternatives or provide prerequisites.

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/isaacgounton/sqlite-mcp-server'

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