Skip to main content
Glama
starwind-ui

Starwind UI MCP Server

by starwind-ui

update_component

Generate update commands for Starwind UI components using npm, yarn, or pnpm package managers. Specify components and options to manage updates efficiently.

Instructions

Generates update commands for Starwind UI components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageManagerNoPackage manager to use (npm, yarn, pnpm)
componentYesComponent name to update
additionalComponentsNoAdditional components to update
optionsNoAdditional options for updating (e.g., '--all' to update all components, '--yes' to skip confirmation prompts)

Implementation Reference

  • The handler function that implements the core logic of the 'update_component' tool. It processes input arguments to generate tailored update commands for Starwind UI components using different package managers, provides examples, options, and instructions.
    handler: async (args: UpdateComponentArgs) => {
      const packageManager = args.packageManager || "npx";
      const component = args.component;
      const additionalComponents = args.additionalComponents || [];
    
      // Combine all components
      const components = [component, ...additionalComponents];
    
      // Build the update command based on the package manager
      let baseCommand: string;
    
      switch (packageManager) {
        case "npm":
          baseCommand = "npx starwind@latest update";
          break;
        case "yarn":
          baseCommand = "yarn dlx starwind@latest update";
          break;
        case "pnpm":
          baseCommand = "pnpm dlx starwind@latest update";
          break;
        default:
          baseCommand = "npx starwind@latest update";
      }
    
      // Common update options
      const commonOptions = [
        "--all", // Update all components
        "--yes", // Skip confirmation prompts
      ];
    
      // Example components
      const popularComponents = [
        "accordion",
        "button",
        "dialog",
        "dropdown",
        "card",
        "alert",
        "select",
      ];
    
      return {
        packageManager,
        baseCommand,
        components,
        example: `${baseCommand} ${components.join(" ")}`,
        availableOptions: commonOptions,
        popularComponents,
        recommendations: {
          single: `${baseCommand} ${component} --yes`,
          multiple: components.length > 1 ? `${baseCommand} ${components.join(" ")} --yes` : null,
          all: `${baseCommand} --all --yes`,
        },
        instructions:
          "Run one of these commands in your project directory to update Starwind UI components. You can combine multiple components in a single command.",
        note: "The update command will check for and apply updates to the specified components and will overwrite existing files. Use --yes to skip confirmation prompts.",
      };
    },
  • TypeScript interface UpdateComponentArgs and JSON inputSchema defining the expected inputs for the tool, including packageManager, component (required), additionalComponents, and options.
    export interface UpdateComponentArgs {
      /** Package manager to use (npm, yarn, pnpm) */
      packageManager?: "npm" | "yarn" | "pnpm";
      /** Component name to update */
      component: string;
      /** Additional components to update */
      additionalComponents?: string[];
      /** Additional options for updating */
      options?: string[];
    }
    
    /**
     * Update component tool definition
     */
    export const updateComponentTool = {
      name: "update_component",
      description: "Generates update commands for Starwind UI components",
      inputSchema: {
        type: "object",
        properties: {
          packageManager: {
            type: "string",
            description: "Package manager to use (npm, yarn, pnpm)",
            enum: ["npm", "yarn", "pnpm"],
          },
          component: {
            type: "string",
            description: "Component name to update",
          },
          additionalComponents: {
            type: "array",
            description: "Additional components to update",
            items: {
              type: "string",
            },
          },
          options: {
            type: "array",
            description:
              "Additional options for updating (e.g., '--all' to update all components, '--yes' to skip confirmation prompts)",
            items: {
              type: "string",
            },
          },
        },
        required: ["component"],
      },
  • Import of updateComponentTool and its registration into the tools Map, making it available to the MCP server.
    import { updateComponentTool } from "./update_component_tool.js";
    
    /**
     * Collection of available tools
     */
    const tools = new Map();
    
    // tools.set("list_tools", {
    // 	description: "Lists all available tools",
    // 	inputSchema: {
    // 		type: "object",
    // 		properties: {},
    // 		required: [],
    // 	},
    // 	handler: async () => {
    // 		return Array.from(tools.entries()).map(([name, tool]) => ({
    // 			name,
    // 			description: (tool as any).description,
    // 			inputSchema: (tool as any).inputSchema,
    // 		}));
    // 	},
    // });
    
    // Register init project tool
    tools.set(initProjectTool.name, initProjectTool);
    
    // Register install component tool
    tools.set(installComponentTool.name, installComponentTool);
    
    // Register update component tool
    tools.set(updateComponentTool.name, updateComponentTool);
  • 'update_component' listed in the enabled tools configuration.
    "update_component",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'generates update commands,' implying a read-only or advisory function, but doesn't clarify if it actually executes updates, requires specific permissions, or has side effects like modifying files. This leaves significant gaps for a tool that could involve system changes.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of a tool that generates commands for updating components, the description is insufficient. With no annotations and no output schema, it fails to explain behavioral aspects like whether commands are executed or just returned, error handling, or output format. This leaves the agent with incomplete context for safe and effective use.

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 input schema has 100% description coverage, so the schema already documents all parameters well. The description adds no additional meaning beyond the schema, such as explaining interactions between parameters or providing examples. This meets the baseline for high schema 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 action ('generates update commands') and the target resource ('Starwind UI components'), making the purpose understandable. However, it doesn't differentiate this tool from sibling tools like 'install_component' or 'get_package_manager', which might have overlapping domains.

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 'install_component' or 'get_package_manager', nor does it mention prerequisites or exclusions. It lacks context for decision-making in a multi-tool environment.

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/starwind-ui/starwind-ui-mcp'

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