Skip to main content
Glama
dhipskind253

mssql-mcp

by dhipskind253

list_schemas

Retrieve all user-defined schemas from the configured Microsoft SQL Server database to explore its structure.

Instructions

List user-defined schemas in the configured database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/db.ts:88-97 (handler)
    The actual implementation of list_schemas: queries sys.schemas, filtering out system schemas (prefix 'db_', 'sys', 'INFORMATION_SCHEMA', 'guest'), returning schema names ordered alphabetically.
    async listSchemas() {
      const r = await (await this.getPool()).request().query(`
        SELECT name AS schema_name
        FROM sys.schemas
        WHERE name NOT LIKE 'db[_]%'
          AND name NOT IN ('sys', 'INFORMATION_SCHEMA', 'guest')
        ORDER BY name
      `);
      return r.recordset;
    }
  • src/index.ts:61-66 (registration)
    Registration of the 'list_schemas' tool on the MCP server with name, description, empty schema (no params), and handler that calls db.listSchemas() via runTool helper.
    server.tool(
      'list_schemas',
      'List user-defined schemas in the configured database.',
      {},
      async () => runTool(() => db.listSchemas())
    );
  • The runTool helper wraps handler execution, converting the result to a text content response, and catching/formatting errors.
    async function runTool(fn: () => Promise<unknown>): Promise<ToolResult> {
      try {
        const value = await fn();
        const text =
          typeof value === 'string' ? value : JSON.stringify(value, null, 2);
        return { content: [{ type: 'text', text }] };
      } catch (err) {
        return {
          content: [{ type: 'text', text: formatDbError(err) }],
          isError: true,
        };
      }
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It only states 'list,' implying a read-only operation, but does not disclose any permissions requirements, error conditions, or other behavioral traits. For a simple listing, this is adequate but not rich.

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?

A single sentence that is perfectly concise and front-loaded. Every word is necessary and contributes to clarity.

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

Completeness4/5

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

For a parameterless list tool, the description covers its purpose and scope. It does not specify the return format, but with no output schema, it is mostly sufficient. Could mention if it returns schema names or full objects.

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?

The input schema has no parameters (0 params, 100% coverage). Per guidelines, baseline is 4. The description adds no parameter semantics since none exist.

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 action (list), the resource (user-defined schemas), and the scope (configured database). It distinguishes from sibling tools like list_tables and list_views by specifying schemas.

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?

No explicit when-to-use or when-not-to-use guidance is given. The usage is implied by the tool's name and description, but alternatives are not mentioned. However, the context of listing schemas is straightforward.

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

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