Skip to main content
Glama

Suggest a change to a Request

suggest_query_update

Suggest an update to an existing approved query. A query's text is either a statement in the datasource's dialect or an operation of a published module, and which of the two it is was settled when it was authored: propose new text of the query's own kind. The suggestion will be reviewed by an administrator before being applied. The original query keeps its current enabled or disabled state until the update is approved. Policy scope resolution reads the statement to name the tables and columns it reaches. A statement it cannot follow raises a scope_unresolved objection for an Administrator to review; browser approval requires confirmation, while MCP query-management authority records the objection without blocking. It follows SELECT, INSERT, UPDATE and DELETE; non-recursive WITH clauses; derived tables and VALUES lists in FROM, each with an alias; joins, WHERE, GROUP BY, HAVING and ORDER BY; and parameters written as {{name}}. For authoring, a write must not start with WITH; move the CTE into a derived table in the write's FROM or USING clause, and a write inside a CTE body becomes the statement itself, with RETURNING if its rows are needed. It does not follow WITH RECURSIVE, a subquery inside a select item or a predicate (write it as a join or a WITH clause), or a table or column that is not in this datasource's schema (check it with get_schema). At the top level, UNION, INTERSECT and EXCEPT resolve every SELECT arm and record the union of every arm's data scope; output columns are matched by ordinal. If any arm cannot be followed, the whole statement raises a scope_unresolved objection rather than recording a partial scope. A set operation inside a WITH clause or derived table raises a scope_unresolved objection. It also follows projected aliases in GROUP BY, HAVING, and ORDER BY expressions, interval literals and {{name}} interval values, and date-part arguments declared by the datasource adapter (including MONTH and WEEK(MONDAY) where supported). String and comment boundaries follow the target datasource. Use an explicit PostgreSQL escape string when an ordinary backslash could change where a quote ends, and write Unicode identifier characters directly inside double quotes. A statement whose output lineage it cannot follow also counts every output as possibly sensitive for the glossary term-binding requirement, which refuses a call with term_binding_required once this Project holds any glossary term; bind each output's term through schema_bindings to clear it. A top-level set operation whose operator declares name matching (BY NAME, CORRESPONDING or STRICT CORRESPONDING), or carries an outer mode in front of its operator (FULL, LEFT, RIGHT or INNER), also counts every output as possibly sensitive for that requirement even when the whole statement resolves, because which column feeds each output cannot be followed; bind every output's term through schema_bindings, or write the operation positionally where the same column order is what the Request means.

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": {
      "query_id": "<query_id>",
      "context": "<context>"
    },
    "name": "suggest_query_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoUpdated statement, for a query whose text is a statement.
nameNoUpdated name
tagsNoUpdated tags for organizing queries
moduleNoRe-freezes an operation query against a module version. Supplied together with operation and artifact_hash; the three move as a whole or not at all.
contextYesExplanation of why this update is needed
query_idYesUUID of the existing query to update
operationNoThe operation inside the module this query's text is. Supplied together with module and artifact_hash.
parametersNoUpdated parameter definitions. For request_kind "operation", a supplied list must include every parameter the operation requires and no parameter it does not declare. Omit to retain the Request's parameters.
descriptionNoUpdated description
request_kindNoOptional, and only ever the query's existing kind — a request's kind never changes. State it to be told plainly when you are proposing the wrong sort of text for this query.
artifact_hashNoThe lowercase hex SHA-256 of the module version to re-freeze against. Supplied together with module and operation.
application_idNoOptional Application UUID whose build this call serves (Administrator only). Setup steps this call opens record it, so they show on that Application's build screen; the resources themselves stay shared by the Project. A shared step it reuses keeps the Application it was opened for, so a step it returns may be watchable with get_setup_journal only without application_id. Use the build's application_id, the one you call describe_application with.
schema_bindingsNoBind existing output names and parameter names to schema columns in this datasource. Each value is namespace.entity:path. The term is resolved from that column's glossary binding, authored separately under schema-governance authority; this is the only way to attach a term to a Request, and an inline term never counts. Replaces all bindings; {} clears them. An address must name a column this datasource has — for an operation Request, one of the paths its publish declared — or this call refuses it. At approval every output that reaches sensitive data, and every output and parameter of a request tagged composable, must be bound here; a statement whose output lineage cannot be resolved counts every output as possibly sensitive, and so does a set operation that matches its arms by name or carries an outer mode, even when it resolves.
max_affected_rowsNoPositive cap for a modifying SQL statement or a declared connector operation. An operation cap must be between 1 and the manifest's declared max_affected. Omit for reads
output_column_descriptionsNoUpdated output column descriptions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / schema_bindings / description
      Previous value: -"Bind existing output names and parameter names to schema columns in this datasource. Each value is namespace.entity:path. The term is resolved from that column's glossary binding, authored separately under schema-governance authority; this is the only way to attach a term to a Request, and an inline term never counts. Replaces all bindings; {} clears them. An address must name a column this datasource has — for an operation Request, one of the paths its publish declared — or this call refuses it. At approval every output that reaches sensitive data, and every output and parameter of a request tagged composable, must be bound here; a statement whose output lineage cannot be resolved counts every output as possibly sensitive."New value: +"Bind existing output names and parameter names to schema columns in this datasource. Each value is namespace.entity:path. The term is resolved from that column's glossary binding, authored separately under schema-governance authority; this is the only way to attach a term to a Request, and an inline term never counts. Replaces all bindings; {} clears them. An address must name a column this datasource has — for an operation Request, one of the paths its publish declared — or this call refuses it. At approval every output that reaches sensitive data, and every output and parameter of a request tagged composable, must be bound here; a statement whose output lineage cannot be resolved counts every output as possibly sensitive, and so does a set operation that matches its arms by name or carries an outer mode, even when it resolves."
  2. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations only cover safety flags, and the description adds real behavioral context: the suggestion is admin-reviewed before applying, the original query keeps its enabled/disabled state until approval, browser approval requires confirmation, and MCP authority records the objection without blocking. The parser and scope-resolution rules go well beyond the flag set, earning strong credit.

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

Conciseness2/5

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

The purpose is front-loaded, but the body is a dense block of SQL-parser edge cases that repeats the scope_unresolved objection and the schema_bindings term-binding requirement three times. Much of the grammar minutiae (recursive WITH, INTERSECT/EXCEPT arms, interval literals) is reference material that buries the actionable rules.

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?

For a 15-parameter mutation-adjacent tool with no output schema, the description is exhaustive on authoring constraints and glossary/lineage requirements, which is what an author needs. It never states what the call returns (a suggestion record) or the failure shapes beyond objections, but the structured schema carries most of the remaining burden.

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 100%, so the schema already documents all 15 parameters, making 3 the baseline. The description adds some meaning by explaining {{name}} parameter syntax and the schema_bindings term-binding requirement, but it does not clarify query_id, context, or the module/operation/artifact_hash grouping beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening states a specific verb and resource: 'Suggest an update to an existing approved query,' and clarifies the text is either a datasource-dialect statement or a module operation proposed in the query's own kind. The review-before-apply sentence distinguishes it implicitly from direct-update siblings, though no sibling is named explicitly.

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 gives authoring constraints (a write must not start with WITH; move the CTE into a derived table) and points to get_schema for schema checks, which is contextual guidance. However, it never states when to use this tool versus update_approved_query or suggest_approved_query, so an agent must infer the routing from the first sentence alone.

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