Skip to main content
Glama

generate_sql

Create stored procedures, views, functions, triggers, migrations, and indexes from a specification. Returns structured SQL file content ready to save, without writing to disk.

Instructions

Generate SQL objects — stored procedures, views, functions, triggers, migrations, indexes — from a specification. Returns structured, saveable file content — never writes to disk itself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesSpecification of the SQL object(s) to generate: purpose, tables involved, parameters, expected behavior
modelNoModel to use (default: deepseek-chat)
providerNoAI Provider
database_typeNoDB Engine (e.g. PostgreSQL, SQL Server, MySQL, SQLite)
target_folderNoTarget folder for the generated SQL file(s)
project_contextNoExisting schema/tables/conventions the output must match
sql_object_typeNoKind of SQL object (e.g. Stored Procedure, View, Function, Trigger, Migration, Index)
naming_conventionNoNaming convention for SQL objects
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It explicitly states that the tool returns structured, saveable file content and never writes to disk itself, which is a critical safety and usage trait. It does not cover other behaviors like error handling or rate limits, but for a generation tool this is a strong disclosure of side effects.

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 sentences that immediately state the action, enumerate the object types, and disclose the key non-persistence behavior. Every word adds value, with no fluff or repeated schema information.

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 the tool's moderate complexity (8 parameters, 1 required) and no output schema, the description provides adequate context: it decribes the output as structured, saveable file content and clarifies the no-disk-write behavior. The schema covers all parameters, so the description is complete enough, though more detail on the exact return structure (e.g., file paths or content layout) would improve it.

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?

The input schema has 100% coverage with descriptive parameter comments, so the description does not need to add parameter details. The description provides examples of object types and the fact that output is file content, but it does not elaborate on parameter relationships or add meaning beyond the schema, so the baseline of 3 is appropriate.

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?

Clearly states it generates SQL objects from a specification, enumerating object types (stored procedures, views, etc.). This distinguishes it from sibling tools like generate_code or generate_files by focusing specifically on SQL objects and explicitly framing its output as file content, not a mutation or analysis operation.

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?

The description clearly implies when to use this tool: when you need to generate SQL objects from a specification. It does not explicitly name alternatives or state when-not-to-use, but the scope is unambiguous enough that an agent can infer the appropriate context, distinguishing it from more general code generation tools.

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/Abbas-F-R/DeepSeek-MCP'

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