Skip to main content
Glama

Save definition

upsert_definition
DestructiveIdempotent

Create a business definition on a connection, such as "active customer", or replace the one with the same name (names match in any case). Give a plain-language description and, when there is one, the SQL that computes it in the connection's dialect. AI tools read definitions from get_context. Changes what every AI tool and person on this connection reads, and is recorded in SaturnSQL with your name. Only make it when the user asked for it or confirmed it. Needs the write scope, the connection's owner or an admin, and a plan that includes Context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connectionId": "<connectionId>",
      "name": "<name>"
    },
    "name": "upsert_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoSQL expression or query that computes it. null removes it; omit to keep the current SQL when replacing.
nameYesThe term, e.g. "active customer".
descriptionNoWhat it means. Omit to keep the current text when replacing.
connectionIdYesConnection id from list_connections.

Output Schema

NameRequiredDescriptionDefault
idNo
sqlNoSQL expression or query in the connection's dialect, when the definition has one.
nameNo
updatedAtNo
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=true), the description discloses that replacing is keyed on case-insensitive name matching, that the change affects every AI tool and person on the connection, and that it is recorded in SaturnSQL under the caller's name. It also spells out authorization requirements (write scope, connection owner or admin, Context plan), which the annotations do not convey.

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?

Purpose and upsert semantics are front-loaded, followed by prerequisites and the confirmation gate, so nothing important is buried. It is dense and slightly run-on in places (the parenthetical name-matching rule, the crammed sentence about AI tools plus audit recording), but every sentence carries information an agent needs.

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

Completeness5/5

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

For a destructive, idempotent write tool with four params, the description covers side effects, audience impact, audit trail, authorization, and a confirmation requirement. With annotations and an output schema already present and full schema coverage, nothing material is missing for correct invocation.

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 baseline is 3, and the description adds real meaning on top: the name is a plain-language term matched case-insensitively, the description should be plain language, and the SQL must be written in the connection's dialect. The null-vs-omit distinction for sql and description is left to the schema, which already covers it well.

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 states a specific verb and resource ('Create a business definition on a connection') and immediately clarifies the upsert behavior ('or replace the one with the same name') plus the matching rule ('names match in any case'). It also distinguishes this from reading, pointing at get_context as the consumer of definitions, so an agent can separate this write tool from its read counterpart.

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

Usage Guidelines5/5

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

It gives an explicit gating rule for when to invoke: 'Only make it when the user asked for it or confirmed it.' It also names the read-side alternative ('AI tools read definitions from get_context') so the agent knows where definitions surface, and lists prerequisites that gate eligibility (write scope, owner/admin, plan with Context).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources