Skip to main content
Glama
egarcia74

Warp SQL Server MCP

by egarcia74

describe_table

Retrieve schema information for a SQL Server table to understand its structure, including column names, data types, and constraints.

Instructions

Get the schema information for a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to describe
databaseNoDatabase name (optional)
schemaNoSchema name (optional, defaults to dbo)

Implementation Reference

  • Core handler function that constructs and executes a SQL query to retrieve detailed schema information (columns, types, nullability, primary keys) for the specified table using INFORMATION_SCHEMA views.
    async describeTable(tableName, database = null, schema = 'dbo') {
      let query;
    
      if (database) {
        query = `
          SELECT 
            c.COLUMN_NAME as column_name,
            c.DATA_TYPE as data_type,
            c.IS_NULLABLE as is_nullable,
            c.COLUMN_DEFAULT as column_default,
            c.CHARACTER_MAXIMUM_LENGTH as max_length,
            c.NUMERIC_PRECISION as precision,
            c.NUMERIC_SCALE as scale,
            CASE WHEN pk.COLUMN_NAME IS NOT NULL THEN 'YES' ELSE 'NO' END as is_primary_key
          FROM [${database}].INFORMATION_SCHEMA.COLUMNS c
          LEFT JOIN [${database}].INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc 
            ON c.TABLE_NAME = tc.TABLE_NAME 
            AND c.TABLE_SCHEMA = tc.TABLE_SCHEMA 
            AND tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
          LEFT JOIN [${database}].INFORMATION_SCHEMA.KEY_COLUMN_USAGE pk 
            ON c.COLUMN_NAME = pk.COLUMN_NAME 
            AND c.TABLE_NAME = pk.TABLE_NAME 
            AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA 
            AND tc.CONSTRAINT_NAME = pk.CONSTRAINT_NAME
          WHERE c.TABLE_NAME = '${tableName}' 
            AND c.TABLE_SCHEMA = '${schema}'
          ORDER BY c.ORDINAL_POSITION
        `;
      } else {
        query = `
          SELECT 
            c.COLUMN_NAME as column_name,
            c.DATA_TYPE as data_type,
            c.IS_NULLABLE as is_nullable,
            c.COLUMN_DEFAULT as column_default,
            c.CHARACTER_MAXIMUM_LENGTH as max_length,
            c.NUMERIC_PRECISION as precision,
            c.NUMERIC_SCALE as scale,
            CASE WHEN pk.COLUMN_NAME IS NOT NULL THEN 'YES' ELSE 'NO' END as is_primary_key
          FROM INFORMATION_SCHEMA.COLUMNS c
          LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc 
            ON c.TABLE_NAME = tc.TABLE_NAME 
            AND c.TABLE_SCHEMA = tc.TABLE_SCHEMA 
            AND tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
          LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE pk 
            ON c.COLUMN_NAME = pk.COLUMN_NAME 
            AND c.TABLE_NAME = pk.TABLE_NAME 
            AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA 
            AND tc.CONSTRAINT_NAME = pk.CONSTRAINT_NAME
          WHERE c.TABLE_NAME = '${tableName}' 
            AND c.TABLE_SCHEMA = '${schema}'
          ORDER BY c.ORDINAL_POSITION
        `;
      }
    
      const result = await this.executeQuery(query, 'describe_table');
      return this.formatResults(result);
    }
  • Tool metadata definition including name, description, and input schema for parameter validation (table_name required, database and schema optional).
      name: 'describe_table',
      description: 'Get the schema information for a specific table',
      inputSchema: {
        type: 'object',
        properties: {
          table_name: { type: 'string', description: 'Name of the table to describe' },
          database: { type: 'string', description: 'Database name (optional)' },
          schema: { type: 'string', description: 'Schema name (optional, defaults to dbo)' }
        },
        required: ['table_name']
      }
    },
  • index.js:266-273 (registration)
    Tool call dispatching in the main MCP server switch statement, mapping 'describe_table' calls to the DatabaseToolsHandler.describeTable method.
    case 'describe_table':
      return {
        content: await this.databaseTools.describeTable(
          args.table_name,
          args.database,
          args.schema
        )
      };
  • index.js:241-242 (registration)
    MCP server registration for listing available tools, which includes 'describe_table' via getAllTools() from tool-registry.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: getAllTools()
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 but lacks details on permissions needed, rate limits, response format, or whether it's read-only (implied by 'Get' but not explicit). This leaves gaps for a tool with 3 parameters and no output schema.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple read operation, with no wasted information.

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 complexity (3 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what schema information is returned (e.g., column names, types, constraints) or address behavioral aspects like error handling, making it inadequate for full agent understanding.

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 input schema has 100% description coverage, providing clear details for all parameters. The description adds no additional parameter semantics beyond what's in the schema, such as examples or constraints, so it meets the baseline for high schema coverage without extra value.

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 ('Get') and resource ('schema information for a specific table'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like 'list_tables' (which lists table names) or 'get_table_data' (which retrieves row data), missing full sibling distinction.

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 use cases like schema inspection before queries or contrast with siblings such as 'list_tables' for metadata overview or 'explain_query' for query-specific schema details.

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