Skip to main content
Glama

db_codegen_generate

Generates Spring Boot Java code (entity, DAO, service, controller, mapper) from a database table by applying customizable templates and writing files directly to the project.

Instructions

[Legacy / single-shot] Generate Java code from database table analysis using templates. Prefer the atomic workflow: codegen_build_context + codegen_render_entity/dao/service/controller/mapper (P2.2). This single-shot tool also writes files to disk in one go, with no preview/edit cycle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connection_idYesDatabase connection ID
table_nameYesTable name to generate code for
databaseNoDatabase name (optional, uses connection default if not specified)
template_categoryNoTemplate category to use for code generationMybatisPlus-Mixed
authorNoAuthor name for generated codeZXP
package_nameNoJava package name for generated codecom.example.generated
project_pathNoTarget Spring Boot project path (with src/main/java)test_project
include_swaggerNoInclude Swagger annotations in generated code
include_lombokNoInclude Lombok annotations in generated code
include_mapstructNoInclude MapStruct mappers in generated code
Behavior4/5

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

Discloses that it writes files to disk in one go with no preview/edit cycle. No annotations exist, so the description carries the full burden. It could mention overwriting behavior or error handling, but the key behavioral traits are communicated.

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, no wasted words. The first sentence states purpose, the second provides usage guidance and behavioral note. Highly efficient.

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 tool with 10 parameters and no output schema, the description covers purpose, usage alternatives, and a key behavioral side effect. Missing return value description, but overall adequate given the complexity.

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 coverage is 100% with descriptions for all 10 parameters, so baseline is 3. The description adds minimal extra meaning beyond the schema, e.g., 'using templates' and 'legacy/single-shot', which are contextual but not parameter-specific.

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 Java code from database table analysis using templates. Distinct from sibling tools by explicitly labeling itself 'single-shot' and contrasting with the atomic workflow.

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?

Explicitly recommends preferring the atomic workflow (codegen_build_context + render_* tools) instead of this legacy single-shot tool. Also warns that it writes files to disk with no preview/edit cycle, guiding when not to use it.

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/ZhaoXingPeng/DBJavaGenix'

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