Skip to main content
Glama
egarcia74

Warp SQL Server MCP

by egarcia74

list_tables

Retrieve all tables in a SQL Server database to explore schema structure and identify available data sources for queries and analysis.

Instructions

List all tables in a specific database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional, uses current database if not specified)
schemaNoSchema name (optional, defaults to dbo)

Implementation Reference

  • Core handler function that constructs and executes SQL query to list tables in a database/schema
    async listTables(database = null, schema = 'dbo') {
      let query;
    
      if (database) {
        query = `
          SELECT 
            t.TABLE_SCHEMA as schema_name,
            t.TABLE_NAME as table_name,
            t.TABLE_TYPE as table_type
          FROM [${database}].INFORMATION_SCHEMA.TABLES t
          WHERE t.TABLE_SCHEMA = '${schema}'
          ORDER BY t.TABLE_SCHEMA, t.TABLE_NAME
        `;
      } else {
        query = `
          SELECT 
            t.TABLE_SCHEMA as schema_name,
            t.TABLE_NAME as table_name,
            t.TABLE_TYPE as table_type
          FROM INFORMATION_SCHEMA.TABLES t
          WHERE t.TABLE_SCHEMA = '${schema}'
          ORDER BY t.TABLE_SCHEMA, t.TABLE_NAME
        `;
      }
    
      const result = await this.executeQuery(query, 'list_tables');
      return this.formatResults(result);
    }
  • index.js:261-264 (registration)
    Tool dispatch/registration in the main MCP server switch statement, calling the databaseTools handler
    case 'list_tables':
      return {
        content: await this.databaseTools.listTables(args.database, args.schema)
      };
  • Tool schema definition including input validation schema for list_tables
    name: 'list_tables',
    description: 'List all tables in a specific database',
    inputSchema: {
      type: 'object',
      properties: {
        database: {
          type: 'string',
          description: 'Database name (optional, uses current database if not specified)'
        },
        schema: { type: 'string', description: 'Schema name (optional, defaults to dbo)' }
      }
    }
  • index.js:241-242 (registration)
    Registration of the tool list handler which provides all tools including list_tables via tool-registry.js
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: getAllTools()
  • Wrapper handler method on the main server class for testing/compatibility purposes, delegates to databaseTools.listTables
    async listTables(...args) {
      try {
        return { content: await this.databaseTools.listTables(...args) };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, error.message);
      }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'all tables' which implies completeness, but doesn't address pagination, permissions needed, rate limits, or what happens when database/schema parameters are omitted. For a read operation with zero annotation coverage, this leaves significant behavioral questions unanswered.

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, efficient sentence that gets straight to the point. Every word earns its place - 'List' (verb), 'all tables' (scope), 'in a specific database' (context). There's no wasted language or unnecessary elaboration for this straightforward operation.

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

Completeness3/5

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

For a simple listing tool with 2 optional parameters and 100% schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it should ideally mention something about the return format (e.g., 'returns table names and metadata') or typical use cases. The description works but leaves the agent guessing about what exactly gets returned.

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%, so the schema already fully documents both parameters. The description adds no additional parameter information beyond what's in the schema - it mentions 'specific database' which aligns with the 'database' parameter but provides no extra context about format, validation, or interaction between parameters. This 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 verb ('List') and resource ('tables in a specific database'), making the purpose immediately understandable. It distinguishes from siblings like 'list_databases' by specifying tables rather than databases, but doesn't explicitly differentiate from other table-related tools like 'describe_table' or 'get_table_data'.

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. With siblings like 'describe_table', 'get_table_data', and 'list_databases', there's no indication of when this listing operation is preferred over more detailed or different scoped operations. The description only states what it does, not when to use it.

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/egarcia74/warp-sql-server-mcp'

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