Skip to main content
Glama

ng_generate

Generate Angular components, services, and other artifacts using Angular CLI schematics to accelerate development workflow.

Instructions

Run 'ng generate' to create a new Angular artifact (component, service, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schematicYesThe schematic to generate (e.g., component, service)
nameYesThe name of the artifact to generate
pathNoThe path where the artifact should be created, relative to the appRoot (do not include the app folder itself). For example, if the full path is 'webui/src/app/modules/alerts' and appRoot is 'webui', then path should be 'src/app/modules/alerts'.src/app
appRootYesThe absolute path to the first folder in the 'path' property. For example, if 'path' is 'webui/src/app/modules/alerts', then 'appRoot' should be the absolute path to 'webui'.
optionsNoAdditional options for the schematic

Implementation Reference

  • Specific implementation of the 'ng_generate' tool handler: constructs the 'npx ng generate' command arguments from input parameters (schematic, name, path, options).
    case "ng_generate": {
      command = "npx";
      commandArgs = ["ng", "generate", args.schematic, args.name];
      if (args.path) {
        commandArgs.push("--path", args.path);
      }
      if (args.options) {
        for (const [key, value] of Object.entries(args.options)) {
          commandArgs.push(`--${key}`, String(value));
        }
      }
      break;
    }
  • Input schema, description, and definition for the 'ng_generate' tool.
    {
      name: "ng_generate",
      description:
        "Run 'ng generate' to create a new Angular artifact (component, service, etc.)",
      inputSchema: {
        type: "object",
        properties: {
          schematic: {
            type: "string",
            description: "The schematic to generate (e.g., component, service)",
          },
          name: {
            type: "string",
            description: "The name of the artifact to generate",
          },
          path: {
            type: "string",
            description:
              "The path where the artifact should be created, relative to the appRoot (do not include the app folder itself). For example, if the full path is 'webui/src/app/modules/alerts' and appRoot is 'webui', then path should be 'src/app/modules/alerts'.",
            default: "src/app",
          },
          appRoot: {
            type: "string",
            description:
              "The absolute path to the first folder in the 'path' property. For example, if 'path' is 'webui/src/app/modules/alerts', then 'appRoot' should be the absolute path to 'webui'.",
          },
          options: {
            type: "object",
            description: "Additional options for the schematic",
            properties: {
              defaults: {
                type: "boolean",
                description:
                  "Disable interactive input prompts for options with a default.",
                default: false,
              },
              dryRun: {
                type: "boolean",
                description:
                  "Run through and report activity without writing out results.",
                default: false,
              },
              force: {
                type: "boolean",
                description: "Force overwriting of existing files.",
                default: false,
              },
              help: {
                type: "boolean",
                description:
                  "Shows a help message for this command in the console.",
                default: false,
              },
              interactive: {
                type: "boolean",
                description: "Enable interactive input prompts.",
                default: true,
              },
            },
            additionalProperties: { type: "string" },
          },
        },
        required: ["schematic", "name", "appRoot"],
      },
    },
  • src/index.ts:23-26 (registration)
    Registers the tools including 'ng_generate' by calling createToolDefinitions() and setting up handlers on the MCP server.
    const TOOLS = createToolDefinitions();
    
    // Setup request handlers
    setupRequestHandlers(server, TOOLS);
  • Registers handler for listing available tools, exposing 'ng_generate' schema to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
  • Registers generic call tool handler that dispatches 'ng_generate' calls to handleToolCall based on name.
    // Call tool handler
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions creating artifacts but lacks details on permissions, side effects (e.g., file system changes), error handling, or output format. For a tool that likely modifies files, this is a significant gap in behavioral disclosure.

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?

The description is a single, efficient sentence that front-loads the core action and purpose without any wasted words. It directly communicates the tool's function in a structured and clear manner.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, nested objects, no output schema, and no annotations), the description is insufficient. It doesn't explain what happens after generation, error cases, or the impact of options like 'force' or 'dryRun', leaving critical context gaps for a file-creating tool.

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 description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no additional meaning beyond implying 'schematic' and 'name' are used for artifact generation, but it doesn't clarify parameter interactions or usage beyond what the schema provides, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Run ng generate') and resource ('to create a new Angular artifact'), specifying examples like component and service. It distinguishes from siblings like ng_add or ng_new by focusing on artifact generation rather than adding packages or creating new projects, though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like ng_add or ng_new, nor does it mention prerequisites or context for generating artifacts. It simply states what the tool does without indicating appropriate scenarios or exclusions.

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/talzach/mcp-angular-cli'

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