Skip to main content
Glama
RawTree MCP Server

RawTree MCP Server

Official
by rawtreedb

Save Query

save-query
Destructive

Save SQL for reuse without executing it. Omit id to create a query; name, sql, and database are required. Visibility defaults to private. Supply id to update an existing query, with at least one of name, sql, database, or visibility.

Instructions

Save SQL for reuse without executing it. Omit id to create a query; name, sql, and database are required. Visibility defaults to private. Supply id to update an existing query, with at least one of name, sql, database, or visibility. Omitted fields remain unchanged; null is invalid. Use the id returned by list-saved-queries or a previous save-query call.

Requires a user session or OAuth; API keys are not supported. The authenticated user owns new queries and can update only their own queries. Set visibility to cluster to share the definition with cluster members. Returns the saved query: id, organization_id, cluster_id, user_id, name, sql, database, visibility, created_at, and updated_at.

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": "save-query"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoExisting query ID to update. Omit to create.
sqlNoSQL to save without executing. Required when creating.
nameNoQuery name. Required when creating.
clusterNoRawTree cluster to use for this operation.
databaseNoDatabase stored with the query. Required when creating; omit on update to keep the saved database.
visibilityNoprivate (default on create) or shared with the cluster. Omit on update to preserve visibility.
organizationNoRawTree organization containing the target cluster.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.2

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations, it discloses auth constraints (user session or OAuth, no API keys), ownership rules (you own new queries and can update only your own), OS-level sharing semantics via visibility=cluster, partial-update semantics (omitted fields unchanged, null invalid), and the full return payload. Since no output schema exists, the field list is doing real work here.

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 tight paragraphs: behavior and conditional requirements first, environment/permission constraints second. The enumerated return fields are long but earn their place because there is no output schema.

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?

A 7-parameter mutation tool with no output schema and no required params is fully covered: create vs update paths, required-field rules, auth viability, ownership, sharing, and return shape all appear. An agent can invoke it correctly without further lookup, aside from organization/cluster which the schema documents.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description goes further by stating the conditional-required rules that the schema only hints at per-property ("Required when creating") and by declaring that update requires at least one field and that null is rejected. It also states the visibility default of private.

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 very first sentence pins down a specific verb and resource plus a crucial negative behavior: "Save SQL for reuse without executing it." That single clause separates it from run-query and query-format, and the following sentences split the tool's two distinct modes (create without id, update with id).

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?

The description gives concrete branch conditions: omit id to create (name, sql, database required), supply id to update with at least one of name/sql/database/visibility. It also tells the agent where to get an id (list-saved-queries or a prior save-query call), which removes the main inference an agent would otherwise have to make.

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