Skip to main content
Glama
Elekto MCP for SQL Server

Elekto MCP for SQL Server

Official

Table structure

get_table_schema
Read-onlyIdempotent

Retrieve a SQL Server table or view's full schema—columns with exact types, keys, constraints, indexes, and extended properties—before writing queries or inspecting data.

Instructions

Returns the full structure of one table or view: columns with an unambiguous type_declaration (such as 'nvarchar(250)'), max_length_chars, every extended property, computed-column definitions and whether they are persisted; plus primary key, foreign keys, check and unique constraints, and indexes with key column order and declared key width, leaving hypothetical ones to get_index_health. Call it before query_table to learn exact column names and types; for a view's SQL text use get_view_definition. max_length is the raw sys.columns value in BYTES, so reason about text length with type_declaration or max_length_chars.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>",
      "table": "<table>"
    },
    "name": "get_table_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYesTable name, bare, with no schema prefix. Example: 'GenericSecurity'
schemaNoTable schema. Empty searches every schema. Example: 'Feeder'
databaseYesName of the database as registered in the configuration.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already establish read-only, idempotent, non-destructive behavior, but the description adds substantial return-shape detail, notes hypothetical indexes are excluded, and warns that max_length is the raw sys.columns byte value so text length should be reasoned about via type_declaration or max_length_chars. This is meaningful behavioral context beyond what the annotations provide.

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 front-loaded with what the tool returns, followed by sibling routing and an important unit caveat. It is dense but every clause carries useful information, with no filler.

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

Completeness5/5

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

For a read-only introspection tool with no output schema, the description thoroughly enumerates the returned structure and clarifies sibling boundaries and a key type-unit caveat. It is complete enough for an agent to invoke the tool correctly.

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?

Schema coverage is 100%, so the schema already documents table, schema, and database. The description adds useful meaning by stating the target may be a table or view, which extends the schema's 'Table name' wording, though it does not add further syntax or edge-case semantics for the database and schema parameters.

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?

States a specific verb and resource: returns the full structure of one table or view, then enumerates columns, extended properties, constraints, and indexes. It clearly distinguishes itself from get_index_health and get_view_definition, so an agent can identify the tool without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit positive guidance to call it before query_table to learn exact column names and types. It also provides exclusions and alternatives: view SQL text goes to get_view_definition and hypothetical indexes are left to get_index_health.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.