Skip to main content
Glama

ng_new

Create a new Angular workspace with a specified name and directory structure, generating the initial project files and configuration for Angular development.

Instructions

Run 'ng new' to create a new Angular workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the new workspace
directoryNoThe directory to create the workspace in
appRootNoThe 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 ng new

Implementation Reference

  • Handler logic for the 'ng_new' tool. Sets up the 'npx ng new' command using the provided name, optionally sets working directory from 'directory' arg, and appends any options as flags.
    case "ng_new": { command = "npx"; commandArgs = ["ng", "new", args.name]; if (args.directory) { cwd = args.directory; } if (args.options) { for (const [key, value] of Object.entries(args.options)) { commandArgs.push(`--${key}`, String(value)); } } break;
  • Schema definition for the 'ng_new' tool, including input schema with required 'name' and optional 'directory', 'appRoot', 'options'.
    { name: "ng_new", description: "Run 'ng new' to create a new Angular workspace", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the new workspace", }, directory: { type: "string", description: "The directory to create the workspace in", }, 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 ng new", additionalProperties: { type: "string" }, }, }, required: ["name"], }, },
  • Registration of tool handlers on the MCP server: ListTools returns the list of tools including 'ng_new', CallTool dispatches to handleToolCall based on name.
    export function setupRequestHandlers(server: Server, tools: Tool[]) { // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
  • src/index.ts:22-26 (registration)
    Initializes the tool definitions array (including 'ng_new') and sets up the request handlers on the server.
    // Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, 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