Skip to main content
Glama
S-CurveLabs

io.github.S-CurveLabs/sqlglass

Official
by S-CurveLabs

build_procedure

Read-only

Generate a CREATE OR ALTER PROCEDURE script from a query, converting inline SQL or library queries into a stored procedure with typed parameters. Returns SQL, undo script, and an EXEC example.

Instructions

Generate a CREATE OR ALTER PROCEDURE script (TEXT ONLY -- never executed here) around a query. Give inline 'sql', or a library 'query' -- then its header params (name, type, default) become the procedure's parameters automatically. Every @variable in the body must be a typed parameter. params: [{"name": "@StartDate", "type": "date", "default": "'2026-01-01'", "description": "first order date"}] Returns sql + undo_sql + notes (including an EXEC example).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNo
nameYes
queryNo
paramsNo
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

The description adds significant behavioral detail beyond the readOnlyHint annotation: it explicitly says 'TEXT ONLY -- never executed', and describes the return format ('Returns sql + undo_sql + notes (including an EXEC example)') and the parameter auto-generation behavior. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the core purpose. It includes a helpful params example and return info, but is a single dense paragraph without clear separation of sections. Still, every sentence adds value, so it's efficient.

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

Completeness4/5

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

Given the tool's complexity (5 params, no output schema), the description is fairly complete: it explains inputs, output structure, constraints, and an example. It lacks explicit details on the 'name' and 'description' parameters, but these are likely self-evident. Overall, it covers what an agent needs to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains sql and query inputs and gives a concrete params example with name/type/default, but does not elaborate on the 'name' (required) or 'description' parameters. It partially clarifies parameter usage but not fully.

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 clearly states the tool's function: 'Generate a CREATE OR ALTER PROCEDURE script (TEXT ONLY -- never executed here) around a query.' It names the specific resource (procedure) and action (generate script), and distinguishes itself from siblings like build_view and build_create_table by focusing on procedures.

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

Usage Guidelines3/5

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

The description provides input-format guidance ('Give inline sql, or a library query') and a constraint ('Every @variable in the body must be a typed parameter'), but does not explicitly state when to use this tool over alternatives like build_view or build_select. It does note 'TEXT ONLY -- never executed here', which implies it's not for execution, but lacks explicit exclusions or comparison to siblings.

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