Skip to main content
Glama
Andrian17

mssql-mcp-server

by Andrian17

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

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema name (defaults to dbo)
cascadeNoAccepted for compatibility; no effect
replaceNoUse CREATE OR ALTER
ifExistsNoInclude IF EXISTS clause (for drop operation)
languageNoOnly T-SQL is supportedtsql
securityNoEXECUTE AS CALLER (INVOKER) or OWNER (DEFINER)INVOKER
operationYesOperation to perform: get (list/info), create (new function or procedure), or drop (remove)
objectTypeNofunction (default for create/drop) or procedure; filters get when supplied
parametersNoParameter list, e.g. "@a INT, @b nvarchar(50)". Use "" for no parameters
returnTypeNoFunction return type: scalar type, "TABLE" (inline TVF) or "@name TABLE (...)" (multi-statement TVF). Not used for procedures
volatilityNoAccepted for compatibility; ignored by SQL Server
functionBodyNoModule body (T-SQL). BEGIN/END or RETURN wrappers are added automatically when missing
functionNameNoName of the function/procedure (required for create/drop, optional for get to filter)
connectionStringNoSQL Server connection string (optional; requires --allow-tool-connection-string)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral disclosure burden. It only restates the operation labels (get, create, drop) which are already documented in the schema, and offers no warning about destructive side effects, permissions, reversibility, or what the operation actually does to the database. The example illustrates inputs but not behavioral consequences.

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?

The description is on sentence with a front-loaded purpose and an illustrative example, with no filler or redundant content. It is appropriately sized for the tool's scope and easy for an agent to parse quickly.

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

Completeness3/5

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

The rich schema compensates for much of the missing detail, but the description alone leaves gaps for a 14-parameter, no-annotation tool. It shows only a CREATE FUNCTION example, mentions stored procedures without any example, and does not surface conditionally required fields like functionName for create/drop. Get and drop behavior would rely entirely on the schema. Overall it is adequate but not complete.

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?

Schema coverage is 100%, so the structured fields already document all 14 parameters. The description adds value by showing a concrete composed CREATE FUNCTION example that demonstrates how functionName, parameters, returnType, and functionBody relate to each other. This is genuinely useful beyond the per-parameter schema descriptions.

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 names a specific resource (SQL Server functions and stored procedures) and gives explicit verbs (get, create, drop), so an agent can clearly tell what this tool does. It also distinguishes itself from sibling tools like mssql_manage_triggers or mssql_execute_query by targeting function/procedure DDL management. The example reinforces the purpose with concrete operation usage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use this tool: when managing SQL Server functions or stored procedures via get/create/drop operations. It does not explicitly contrast against alternatives such as mssql_execute_query or mssql_manage_schema, but the resource scope is a sufficiently clear routing signal. It provides context without explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.