Skip to main content
Glama

create_saved_query

Save SQL text as a reusable query in SQL Lab, associated with a database and optional schema.

Instructions

Create a new saved SQL query in SQL Lab.

Saved queries persist reusable SQL snippets associated with a database.

Args: label: Name / label for the saved query. sql: The SQL text to save. database_id: ID of the database this query targets. schema: Optional schema context (e.g. 'public'). description: Optional description of the query. dry_run: If True, preview the action without executing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYes
sqlYes
database_idYes
schemaNo
descriptionNo
dry_runNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations provided, so description carries full burden. Discloses dry_run behavior but omits side effects (creates resource), auth requirements, and conflict handling. Missing expected write operation transparency.

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?

Concise with front-loaded purpose. Includes structured Args section. Minor inefficiency in repeating parameter descriptions that could be integrated, but overall clear.

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?

Given output schema exists (return values not needed), description covers creation and parameters. Missing mention of persistence or link to retrieval tools, but acceptable with sibling context.

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 description coverage is 0%, but the 'Args' section fully explains each parameter's purpose (label, sql, database_id, schema, description, dry_run), compensating completely.

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?

Clear verb+resource: 'create' and 'saved SQL query'. Distinguishes from siblings like 'run_sql' (execute) and 'delete_saved_query' (delete).

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?

States that saved queries persist reusable SQL snippets, implying use for saving SQL. No explicit when-not-to-use, but context and sibling names provide sufficient differentiation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Evan-Kim2028/preset-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server