mssql_manage_functions
Manage SQL Server functions and stored procedures: list existing objects, create new ones with parameters and body, or drop them with a single operation.
Instructions
Manage SQL Server functions and stored procedures - get, create, or drop with a single tool. Examples: operation="get" to list, operation="create" with functionName="fn_total", parameters="@price DECIMAL(10,2), @tax DECIMAL(5,2)", returnType="DECIMAL(10,2)", functionBody="RETURN @price + (@price * @tax)"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Schema name (defaults to dbo) | |
| cascade | No | Accepted for compatibility; no effect | |
| replace | No | Use CREATE OR ALTER | |
| ifExists | No | Include IF EXISTS clause (for drop operation) | |
| language | No | Only T-SQL is supported | tsql |
| security | No | EXECUTE AS CALLER (INVOKER) or OWNER (DEFINER) | INVOKER |
| operation | Yes | Operation to perform: get (list/info), create (new function or procedure), or drop (remove) | |
| objectType | No | function (default for create/drop) or procedure; filters get when supplied | |
| parameters | No | Parameter list, e.g. "@a INT, @b nvarchar(50)". Use "" for no parameters | |
| returnType | No | Function return type: scalar type, "TABLE" (inline TVF) or "@name TABLE (...)" (multi-statement TVF). Not used for procedures | |
| volatility | No | Accepted for compatibility; ignored by SQL Server | |
| functionBody | No | Module body (T-SQL). BEGIN/END or RETURN wrappers are added automatically when missing | |
| functionName | No | Name of the function/procedure (required for create/drop, optional for get to filter) | |
| connectionString | No | SQL Server connection string (optional; requires --allow-tool-connection-string) |