list_procedures
Retrieve stored procedures from a Microsoft SQL Server database, optionally filtered by schema. Supports database exploration and understanding via natural language.
Instructions
List stored procedures, optionally filtered by schema.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_procedures"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No |
Implementation Reference
- src/db.ts:234-244 (handler)The actual execution logic: queries sys.procedures with optional schema filtering.
async listProcedures(schema?: string) { const r = await (await this.getPool()) .request() .input('schema', sql.NVarChar, schema ?? null).query(` SELECT s.name AS schema_name, p.name AS procedure_name FROM sys.procedures p INNER JOIN sys.schemas s ON p.schema_id = s.schema_id WHERE (@schema IS NULL OR s.name = @schema) ORDER BY s.name, p.name `); return r.recordset; - src/index.ts:133-140 (registration)Registers the 'list_procedures' tool with MCP server, defining description and schema.
server.tool( 'list_procedures', 'List stored procedures, optionally filtered by schema.', { schema: z.string().optional(), }, async ({ schema }) => runTool(() => db.listProcedures(schema)) ); - src/index.ts:136-137 (schema)Input schema for list_procedures: optional schema filter string.
{ schema: z.string().optional(),