Skip to main content
Glama
EvilPhatBoi

MSSQL MCP Server

by EvilPhatBoi

describe_table

Retrieve column names and data types for a specified MSSQL database table to understand its structure and schema.

Instructions

Describes the schema (columns and types) of a specified MSSQL Database table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table to describe

Implementation Reference

  • The main handler function that executes the tool logic by querying the database's INFORMATION_SCHEMA.COLUMNS for the specified table's columns and types.
    async run(params: { tableName: string }) {
      try {
        const { tableName } = params;
        const request = new sql.Request();
        const query = `SELECT COLUMN_NAME as name, DATA_TYPE as type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = @tableName`;
        request.input("tableName", sql.NVarChar, tableName);
        const result = await request.query(query);
        return {
          success: true,
          columns: result.recordset,
        };
      } catch (error) {
        return {
          success: false,
          message: `Failed to describe table: ${error}`,
        };
      }
    }
  • The tool's name, description, and input schema defining the required 'tableName' parameter.
    name = "describe_table";
    description = "Describes the schema (columns and types) of a specified MSSQL Database table.";
    inputSchema = {
      type: "object",
      properties: {
        tableName: { type: "string", description: "Name of the table to describe" },
      },
      required: ["tableName"],
    } as any;
  • src/index.ts:109-113 (registration)
    Registration of the tool in the ListToolsRequestHandler, where describeTableTool is included in the list of available tools based on 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:141-149 (registration)
    Dispatch logic in CallToolRequestHandler that validates arguments and invokes the describeTableTool.run method.
    case describeTableTool.name:
      if (!args || typeof args.tableName !== "string") {
        return {
          content: [{ type: "text", text: `Missing or invalid 'tableName' argument for describe_table tool.` }],
          isError: true,
        };
      }
      result = await describeTableTool.run(args as { tableName: string });
      break;
  • src/index.ts:90-90 (registration)
    Instantiation of the DescribeTableTool instance used throughout the server.
    const describeTableTool = new DescribeTableTool();
Behavior3/5

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

With no annotations provided, the description carries full burden. It states the tool's purpose but lacks behavioral details like whether it requires specific permissions, returns error messages for non-existent tables, or provides additional metadata beyond columns and types. The description doesn't contradict annotations (none exist).

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 front-loads the core purpose ('Describes the schema') and specifies the resource scope ('MSSQL Database table') and output details ('columns and types'). There is zero wasted verbiage.

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 single-parameter read operation with no annotations and no output schema, the description is minimally adequate. It explains what the tool does but lacks details on behavioral traits, error handling, or output format, which would be helpful given the absence of structured metadata.

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%, with the single parameter 'tableName' well-documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides, establishing the baseline score of 3 for adequate but non-enhancing coverage.

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 specific action ('Describes') and resource ('schema of a specified MSSQL Database table'), including what information is returned ('columns and types'). It distinguishes from siblings like list_table (which likely lists table names) and read_data (which reads table contents).

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 implies usage when schema information is needed, but provides no explicit guidance on when to use this tool versus alternatives like list_table or create_table. There are no exclusions or prerequisites mentioned, leaving usage context to inference.

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/EvilPhatBoi/McpSqlServer'

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