Skip to main content
Glama

Revise a suggested Request

revise_query_suggestion

Revise a pending query suggestion in place. Its id, its approval_url and its place in review all stay the same, so an approval link already handed to a person still points at the query you just fixed. Use it instead of rejecting a suggestion and suggesting a replacement: a replacement gets a new id, leaves a rejected twin behind under the same name, and opens a second setup journal entry. Only a pending suggestion can be revised. An approved query is changed with update_approved_query (direct) or suggest_query_update (for review); a rejected one is not revived by editing it. The revision is recorded on the suggestion with the context you give, so a reviewer can see it was changed and why.

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": {
      "suggestion_id": "<suggestion_id>",
      "context": "<context>"
    },
    "name": "revise_query_suggestion"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoUpdated statement, for a suggestion whose text is a statement.
nameNoUpdated name
tagsNoUpdated tags for organizing queries
moduleNoAn operation request's published module. Supplied together with operation and artifact_hash, and only for request_kind "operation".
contextYesWhy this suggestion is being revised. Recorded on the suggestion and in its lifecycle evidence.
operationNoThe operation inside the module that this query's text is. Supplied together with module and artifact_hash, and only for request_kind "operation".
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_kindNoWhat this query's text is: "statement" (the default) for a statement in the datasource's dialect, or "operation" for an operation of a module published to the Request Service. A statement request carries `sql` and nothing else; an operation request carries `module`, `operation` and `artifact_hash` and no statement.
artifact_hashNoThe lowercase hex SHA-256 of the module version this query is frozen against, from the published artifact. Supplied together with module and operation, and only for request_kind "operation".
suggestion_idYesUUID of the pending suggestion to revise in place
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 write cap for a modifying SQL statement or declared operation; an operation cap must be between 1 and its declared max_affected. Omit to retain its cap; 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

A4.6/5.0
Behavior5/5

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

Annotations declare a non-read-only, non-destructive, non-idempotent mutation, and the description adds behavior beyond them: identity and approval_url stability so handed-out links still resolve, the state precondition on revision, and the fact that the revision plus its context lands in the suggestion's lifecycle evidence. These are exactly the side-effect and invariant details an agent cannot infer from annotations.

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 sentences, front-loaded with the core action and invariant, then the sibling routing, then the precondition, then the audit note. Every sentence adds distinct information with no repetition of the schema or annotations.

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 complex 14-parameter mutation with nested objects and no output schema, the description covers state preconditions, identity invariants, alternatives, and the audit trail. It stops short of explaining the return value or whether an update must resupply complete field sets rather than deltas, which is the only remaining gap.

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% across 14 parameters, including lengthy per-parameter docs for sql, parameters, schema_bindings, and max_affected_rows, so the schema carries the load and the baseline is 3. The description adds only the role of the required context argument ('so a reviewer can see it was changed and why') and does not clarify partial-update semantics such as whether omitted fields are retained.

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 precise verb and resource ('Revise a pending query suggestion in place') and immediately qualifies the scope as pending-only. It is unmistakable against siblings such as update_approved_query and reject_query_suggestion because it names both the resource and the state constraint.

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 explicit when-to-use guidance against the main alternative ('Use it instead of rejecting a suggestion and suggesting a replacement') and spells out the cost of the alternative: a new id, a rejected twin, and a second setup journal entry. It also states when-not-to-use and names the correct tool for each case (update_approved_query for direct edits, suggest_query_update for review) and notes a rejected suggestion is not revived by editing.

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