Skip to main content
Glama

describe_table

Retrieve the schema structure of any MSSQL database table, including column names and data types, to understand table composition for query planning and data analysis.

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 `run` method implementing the core logic of the `describe_table` tool, which queries the INFORMATION_SCHEMA.COLUMNS to retrieve column names and data types for the specified table.
    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 input schema defining the required `tableName` parameter for the `describe_table` tool.
    inputSchema = {
      type: "object",
      properties: {
        tableName: { type: "string", description: "Name of the table to describe" },
      },
      required: ["tableName"],
    } as any;
  • src/index.ts:96-96 (registration)
    Instantiation of the DescribeTableTool instance used throughout the server.
    const describeTableTool = new DescribeTableTool();
  • src/index.ts:116-119 (registration)
    Registration of `describeTableTool` in the list of available tools returned by ListToolsRequestSchema handler, conditionally based on readonly mode.
      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:147-155 (registration)
    Dispatch logic in CallToolRequestSchema handler for executing the `describe_table` tool, including input validation.
    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;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states what the tool does but does not disclose behavioral traits such as whether it requires specific permissions, how it handles errors (e.g., invalid table names), or if it has rate limits. This is a significant gap for a tool with no annotation coverage.

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 purpose without unnecessary words. It directly communicates the tool's function, making it appropriately sized and well-structured.

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?

Given no annotations and no output schema, the description is minimal but adequate for a simple read operation. It covers the basic purpose but lacks details on behavioral aspects and output format, which are important for a tool with no structured data support.

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 documents the single parameter 'tableName' with its description. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, meeting the baseline for high schema 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 verb ('describes') and resource ('schema of a specified MSSQL Database table'), specifying it includes columns and types. It distinguishes from siblings like list_table (which likely lists table names) and read_data (which reads actual data).

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 does not explicitly state when to use this tool versus alternatives like list_table or create_table. It provides basic context but lacks explicit guidance on prerequisites or exclusions.

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/Nirmal123K/mssql-mcp'

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