Skip to main content
Glama

ng_update

Update Angular packages and run migrations to maintain project compatibility and apply framework changes.

Instructions

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

Input Schema

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

Implementation Reference

  • Defines the input schema, description, and parameters for the 'ng_update' tool.
    {
      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, exposing the 'ng_update' tool schema in the tools list.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
  • Registers the call tool handler, which dispatches 'ng_update' calls to handleToolCall based on tool name.
    // Call tool handler
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
  • Generic handler for tool calls. Dispatches via switch on tool name to construct and run 'npx ng ...' commands. 'ng_update' has no specific case and returns an 'Unknown tool' error.
    export async function handleToolCall(
      name: string,
      args: any,
      server: any
    ): Promise<CallToolResult> {
      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) {
        return {
          content: [
            {
              type: "text",
              text: error instanceof Error ? error.message : String(error),
            },
          ],
          isError: true,
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions that the tool 'updates Angular packages and run migrations' which implies mutation/write operations, but doesn't disclose important behavioral aspects like whether this modifies project files, requires specific permissions, has side effects, or what happens on failure. For a complex update tool with 11 parameters, this is inadequate.

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 extremely concise - a single sentence that directly states the tool's purpose without any fluff or unnecessary elaboration. It's front-loaded with the core functionality and wastes no words.

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?

For a complex Angular update tool with 11 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'run migrations' entails, what gets modified, potential risks, or typical use cases. The combination of high complexity and minimal description creates significant gaps for an AI agent.

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?

The description provides no parameter-specific information, but with 91% schema description coverage, the input schema already documents most parameters well. The baseline score of 3 is appropriate since the schema does the heavy lifting, though the description adds no value beyond what's in the structured schema.

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 action ('Run ng update') and purpose ('to update Angular packages and run migrations'), providing a specific verb+resource combination. It doesn't explicitly differentiate from sibling tools like ng_add or ng_generate, but the focus on updating packages is reasonably distinct from adding packages or generating code.

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_generate, nor does it mention prerequisites or typical contexts for running Angular updates. It simply states what the tool does without usage context.

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