Skip to main content
Glama
stand-out-of-my-sun

Diogenes Database Intelligence, SQL Engine & Schema Guard MCP

SQL DDL to Type-Safe ORM Entity Compiler (Prisma, Drizzle, Zod)

generate_orm_models
Read-onlyIdempotent

Compile SQL DDL schemas into type-safe Prisma, Drizzle, SQLAlchemy, or Zod models to scaffold application data layers and keep ORM entities synchronized with your database.

Instructions

Compiles SQL DDL schemas into type-safe ORM entities and TypeScript validation schemas (Prisma, Drizzle, SQLAlchemy, Zod). Use when scaffolding application models, generating TypeScript data layers, or synchronizing schemas; for translating raw SQL across dialects, use transpile_sql_dialect instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'schema_ddl' ('orm_target' defaults to 'drizzle_orm_typescript'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
orm_targetNoTarget ORM framework standard: Prisma schema, Drizzle ORM TypeScript, SQLAlchemy Python 2.0, or Zod types.
schema_ddlYesDatabase schema DDL statements defining tables, primary keys, and relationships.
include_relationsNoWhether to generate explicit foreign key relation decorators and navigation properties.

Output Schema

NameRequiredDescriptionDefault
compiled_codeYesGenerated type-safe model code matching the specified ORM or validation schema framework.
orm_frameworkYesName of the target ORM framework output produced.
models_generatedYesList of model entity names successfully parsed and compiled from the schema.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds materially new operational facts: statelessness, a 32 KB payload ceiling, 60 RPM rate limit, the '?demo=true' bypass or L402 payment of 15 sats, and HTTP 400 on invalid input. These are exactly the runtime constraints annotations cannot express.

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?

Purpose is front-loaded, then usage, then operational constraints — a sensible order. The second sentence is dense with parenthetical detail, which borders on crowded but every clause carries real decision-relevant information.

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?

An output schema exists, so return-value explanation is unnecessary; the description instead covers the things that matter for a hosted compiler call — size limit, rate limit, auth/payment path, and failure mode. An agent has everything needed to invoke it correctly.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3; the description earns a bump by disclosing the default for orm_target ('drizzle_orm_typescript'), which is absent from the schema. It does not, however, explain include_relations semantics beyond what the schema already says.

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?

Opens with a specific verb and resource — 'Compiles SQL DDL schemas into type-safe ORM entities' — and enumerates the target outputs (Prisma, Drizzle, SQLAlchemy, Zod). It also names the sibling it is not (transpile_sql_dialect), so an agent can distinguish it without opening either schema.

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?

Gives explicit trigger contexts ('scaffolding application models, generating TypeScript data layers, or synchronizing schemas') and an explicit exclusion routing to transpile_sql_dialect for raw SQL dialect translation. Nothing is left to inference.

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