Skip to main content
Glama

unfour.db.save_saved_sql

unfour.db.save_saved_sql

Creates or updates saved SQL metadata without executing SQL; use name and SQL for new entries, or savedSqlId and expectedRevision for updates.

Instructions

Creates or updates saved SQL metadata; never executes SQL. Creation requires name and sql. Updates require savedSqlId and expectedRevision; omitted fields preserve originals, including SQL. Null clears optional context, subject to the engine's default catalog inference. Returned metadata never contains SQL.

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": "unfour.db.save_saved_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNo
nameNo
schemaNo
catalogNo
savedSqlIdNo
workspaceIdNo
connectionIdNo
expectedRevisionNo

Output Schema

NameRequiredDescriptionDefault
savedSqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-readOnly, non-destructive mutation, and the description adds genuinely new behavior: partial-update semantics (omitted fields preserve originals, including SQL), null-clearing of optional context, and that returned metadata never contains SQL. The only gap is that it doesn't say what happens on a revision mismatch.

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?

Four short sentences, zero filler, and the most important constraint ('never executes SQL') is front-loaded. Each sentence contributes a distinct rule about mode selection, preservation, null handling, or return content.

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?

An output schema exists, so the description doesn't need to enumerate return fields, yet it still adds the useful note that returned metadata omits SQL. For a mutation tool with no required params in the schema, the mode-dependent requirements and partial-update semantics make it largely complete, though revision-conflict behavior and workspaceId/connectionId usage remain unstated.

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?

With 0% schema description coverage and 8 parameters, the description must carry the load, and it does explain the roles of name, sql, savedSqlId, expectedRevision, and the null-clearing behavior of optional context fields. It leaves workspaceId, connectionId, and the meaning of expectedRevision (optimistic concurrency) undocumented.

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+resource pair ('Creates or updates saved SQL metadata') and immediately distinguishes the operation from its nearest confusing sibling by stating it 'never executes SQL'. An agent can tell this apart from unfour.db.execute or unfour.db.get_saved_sql without reading any schema.

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?

It clearly splits the two modes and gives the required inputs for each: creation needs name and sql; updates need savedSqlId and expectedRevision. It does not name the sibling tools for reading or deleting saved SQL, but the 'never executes SQL' clause supplies the main routing signal.

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

Deploy Server

Other Tools