Skip to content

Commit ae5d0ae

Browse files
authored
fix(nx-mcp): improve generator tool descriptions (#2878)
1 parent 76141a9 commit ae5d0ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libs/nx-mcp/nx-mcp-server/src/lib/tools/nx-ide.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function registerNxIdeTools(
130130
// Register nx_run_generator tool
131131
server.tool(
132132
NX_RUN_GENERATOR,
133-
'Opens the generate ui with whatever options you provide prefilled. ALWAYS USE THIS to run nx generators. Use the nx_generators and nx_generator_schema tools to learn about the available options BEFORE using this tool. ALWAYS use this when the user wants to generate something and ALWAYS use this instead of running a generator directly via the CLI. You can also call this tool to overwrite the options for an existing generator invocation.',
133+
'Opens the Nx Console Generate UI in the IDE with the provided options pre-filled. This tool does NOT directly execute the generator - instead it opens a visual form pre-filled with your options, allowing the user to review, modify, and confirm before execution. The `cwd` parameter specifies the parent directory path (relative to workspace root) where the generated item should be created - this is particularly important when generating libraries, apps, or components in specific locations. This tool can also be called to update options for an existing generator invocation. Prefer this tool over CLI commands when an IDE is available, as it provides a user-review workflow.',
134134
{
135135
generatorName: z.string().describe('The name of the generator to run'),
136136
options: z

libs/nx-mcp/nx-mcp-server/src/lib/tools/nx-workspace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ ${targetDescriptions}`;
483483

484484
server.tool(
485485
NX_GENERATORS,
486-
'Returns a list of generators that could be relevant to the user query.',
486+
"Returns a complete list of all available Nx generators in the workspace, including both plugin-provided generators (like @nx/react:component) and local workspace generators. The output shows each generator's name with its description, useful for discovering what generators exist or finding one that matches a specific need.",
487487
{
488488
destructiveHint: false,
489489
readOnlyHint: true,
@@ -526,7 +526,7 @@ ${targetDescriptions}`;
526526

527527
server.tool(
528528
NX_GENERATOR_SCHEMA,
529-
'Returns the detailed JSON schema for an nx generator',
529+
"Returns the complete JSON schema for a specific Nx generator. The schema contains all available options with their types, descriptions, default values, validation rules, and whether they're required or optional. Many generators also include helpful examples showing common usage patterns. The tool automatically handles generator aliases (e.g., 'app' vs 'application').",
530530
{
531531
generatorName: z
532532
.string()

0 commit comments

Comments
 (0)