Skip to main content
Glama
S-CurveLabs

io.github.S-CurveLabs/sqlglass

Official
by S-CurveLabs

build_view

Read-only

Turn a SELECT or library query into a CREATE OR ALTER VIEW script, rejecting invalid view syntax like parameters, DECLARE, or unbounded ORDER BY.

Instructions

Generate a CREATE OR ALTER VIEW script (TEXT ONLY -- never executed here) from a SELECT or a library query. Refuses what a view cannot contain: parameters, DECLARE, ORDER BY without TOP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNo
nameYes
queryNo
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description adds valuable behavioral detail: output is text-only, the script is never executed, and the tool refuses unsupported constructs like parameters, DECLARE, and ORDER BY without TOP. This goes well beyond the annotation without contradicting it.

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?

Two sentences, no filler, with the most important constraints front-loaded: the core action, the text-only/no-execution guarantee, and the refusal rules. Every sentence earns its place.

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?

The description covers the tool's main behavior, input sources, and key constraints, which is strong for a read-only script generator. Minor gaps remain around the exact roles of the name and description parameters and the precise return shape, but the required name is already visible in the schema.

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

Parameters2/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 for parameter meaning. It indirectly maps 'SELECT' to sql and 'library query' to query, but it does not explain the purpose of name or description, nor clarify how the two input sources relate. This leaves several parameters under-documented.

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 opens with a specific verb and resource: 'Generate a CREATE OR ALTER VIEW script', which clearly identifies the tool's function. It also distinguishes itself from siblings such as run_query by stating 'TEXT ONLY -- never executed here', and from build_create_table/build_procedure by specifying VIEW.

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 implies when to use the tool ('from a SELECT or a library query') and excludes execution via 'never executed here', but it does not explicitly name alternative tools or state when not to use it. Usage context is inferable but not fully explicit.

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