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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/schema.ts:95-105 (handler)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)}`); }
- src/tools/schema.ts:23-27 (registration)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) );