Skip to main content
Glama
isaacgounton

SQLite MCP Server

list_tables

Lists all user-created tables in the connected SQLite database.

Instructions

List all user-created tables in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_tables' tool. Executes a SQL query against sqlite_master to retrieve all user-created table names (excluding sqlite_% system tables) and returns them as a JSON array of names.
    case 'list_tables': {
      const rows = db.all(
        "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name"
      ) as { name: string }[];
      return {
        content: [{ type: 'text', text: JSON.stringify(rows.map(r => r.name), null, 2) }],
      };
    }
  • Schema definition for the 'list_tables' tool. Defines the tool name, description, and input schema (empty object, no parameters required). Registered as part of the ListTools handler.
    name: 'list_tables',
    description: 'List all user-created tables in the database.',
    inputSchema: {
      type: 'object' as const,
      properties: {},
    },
  • src/index.ts:197-274 (registration)
    Registration of the 'list_tables' tool via the ListToolsRequestSchema handler. The tool is listed along with read_query, write_query, create_table, drop_table, describe_table, and append_insight.
    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'],
          },
        },
      ],
    }));
Behavior2/5

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

No annotations provided; the description only implies a read operation but lacks details on output structure, side effects, or permissions required.

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?

Single sentence, concise, and front-loaded with the action and resource.

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?

No output schema or annotations; the description does not explain what information the listing returns (e.g., names only or full schema). Incomplete for a list operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist; schema coverage is 100% (empty schema). The description adds no extra meaning beyond the schema, but baseline for zero params is 4.

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 'list' and the resource 'user-created tables', distinguishing it from other table manipulation tools like create_table or drop_table.

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?

No guidance on when to use this tool versus alternatives like read_query or describe_table. The agent must infer usage.

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