Skip to main content
Glama

ng_update

Update Angular packages and run migrations with 'ng update'. Specify packages, manage versions, handle peer dependencies, and enable source control commits in Angular projects.

Instructions

Run 'ng update' to update Angular packages and run migrations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allowDirtyNoAllow updating when the repository contains modified or untracked files.
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'.
createCommitsNoCreate source control commits for updates and migrations.
forceNoIgnore peer dependency version mismatches.
fromNoVersion from which to migrate from (only with migrate-only and single package).
migrateOnlyNoOnly perform a migration, do not update the installed version.
nameNoThe name of the migration to run (only with migrate-only and single package).
nextNoUse the prerelease version, including beta and RCs.
packagesYes
toNoVersion up to which to apply migrations (only with migrate-only and single package).
verboseNoDisplay additional details about internal operations during execution.

Implementation Reference

  • Defines the tool 'ng_update' including its name, description, and detailed input schema for parameters such as packages, appRoot, and various ng update options.
    { name: "ng_update", description: "Run 'ng update' to update Angular packages and run migrations.", inputSchema: { type: "object", properties: { packages: { oneOf: [ { type: "string", description: "The name of the package to update (e.g., @angular/core)", }, { type: "array", items: { type: "string" }, description: "The names of packages to update.", }, ], }, 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'.", }, next: { type: "boolean", description: "Use the prerelease version, including beta and RCs.", default: false, }, force: { type: "boolean", description: "Ignore peer dependency version mismatches.", default: false, }, allowDirty: { type: "boolean", description: "Allow updating when the repository contains modified or untracked files.", default: false, }, createCommits: { type: "boolean", description: "Create source control commits for updates and migrations.", default: false, }, from: { type: "string", description: "Version from which to migrate from (only with migrate-only and single package).", }, to: { type: "string", description: "Version up to which to apply migrations (only with migrate-only and single package).", }, migrateOnly: { type: "boolean", description: "Only perform a migration, do not update the installed version.", default: false, }, name: { type: "string", description: "The name of the migration to run (only with migrate-only and single package).", }, verbose: { type: "boolean", description: "Display additional details about internal operations during execution.", default: false, }, }, required: ["packages", "appRoot"], }, },
  • Registers the list tools handler which includes the 'ng_update' tool in the returned tools list from createToolDefinitions().
    // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
  • src/index.ts:22-26 (registration)
    Calls createToolDefinitions() to include 'ng_update' tool definition and passes it to setupRequestHandlers for registration on the MCP server.
    // Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, TOOLS);
  • The generic handleToolCall function processes tool calls via switch on name. 'ng_update' falls to default case returning 'Unknown tool' error, indicating no specific handler implementation exists.
    try { let command = ""; let commandArgs: string[] = []; let cwd = args.appRoot || process.cwd(); switch (name) { 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; } case "ng_add": { command = "npx"; commandArgs = ["ng", "add", args.package]; if (args.options) { for (const [key, value] of Object.entries(args.options)) { commandArgs.push(`--${key}`, String(value)); } } break; } 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; } case "ng_run": { command = "npx"; commandArgs = ["ng", "run", args.target]; if (args.options) { for (const [key, value] of Object.entries(args.options)) { commandArgs.push(`--${key}`, String(value)); } } break; } default: return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true, }; } const output = await runCommand(command, commandArgs, cwd); return { content: [{ type: "text", text: output }], isError: false, }; } catch (error) {

Other Tools

Related 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