Skip to main content
Glama
cwilby

SQL Server MCP

by cwilby

get-stored-procedures

Retrieve a comprehensive list of all stored procedures in a Microsoft SQL Server database for efficient query and schema management.

Instructions

Get a list of all stored procedures in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the logic for the 'get-stored-procedures' tool. It queries INFORMATION_SCHEMA.ROUTINES for procedures and returns a formatted result.
    async getStoredProcedures() {
        const procedures = await database.query(`
            SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION
            FROM INFORMATION_SCHEMA.ROUTINES
            WHERE ROUTINE_TYPE = 'PROCEDURE'
        `);
    
        if (!procedures.length) return this.toResult("No stored procedures found in the database.");
    
        return this.toResult(`Stored procedures found in the database:\n${JSON.stringify(procedures)}`);
    }
  • The exact registration of the 'get-stored-procedures' tool using server.tool(), binding the handler method.
    server.tool(
        "get-stored-procedures", 
        "Get a list of all stored procedures in the database", 
        tools.getStoredProcedures.bind(tools)
    );
Install Server

Other Tools

Related 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/cwilby/mcp-node-mssql'

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