Skip to main content
Glama
starwind-ui

Starwind UI MCP Server

by starwind-ui

install_component

Generate installation commands for Starwind UI components using npm, yarn, or pnpm package managers to add UI elements to your project.

Instructions

Generates installation commands for Starwind UI components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageManagerNoPackage manager to use (npm, yarn, pnpm)
componentYesComponent name to install
additionalComponentsNoAdditional components to install
optionsNoAdditional options for installation (e.g., '--all' to install all components)

Implementation Reference

  • The main handler function for the 'install_component' tool. It generates installation commands for Starwind UI components based on the provided arguments, supporting different package managers and returning structured command recommendations.
    handler: async (args: InstallComponentArgs) => {
      const packageManager = args.packageManager || "npx";
      const component = args.component;
      const additionalComponents = args.additionalComponents || [];
    
      // Combine all components
      const components = [component, ...additionalComponents];
    
      // Build the installation command based on the package manager
      let baseCommand: string;
    
      switch (packageManager) {
        case "npm":
          baseCommand = "npx starwind@latest add";
          break;
        case "yarn":
          baseCommand = "yarn dlx starwind@latest add";
          break;
        case "pnpm":
          baseCommand = "pnpm dlx starwind@latest add";
          break;
        default:
          baseCommand = "npx starwind@latest add";
      }
    
      // Common component options
      const commonOptions = [
        "--all", // Install all components
      ];
    
      // Example components
      const popularComponents = [
        "accordion",
        "button",
        "card",
        "breadcrumb",
        "dropdown",
        "select",
        "tabs",
      ];
    
      // Filtered list of requested components that are included in the popular list
      const requestedPopularComponents = components.filter((c) => popularComponents.includes(c));
    
      return {
        packageManager,
        baseCommand,
        components,
        // Example with requested component(s)
        example: `${baseCommand} ${components.join(" ")}`,
        availableOptions: commonOptions,
        popularComponents,
        recommendations: {
          single: `${baseCommand} ${component}`,
          multiple: components.length > 1 ? `${baseCommand} ${components.join(" ")}` : null,
          all: `${baseCommand} --all`,
        },
        instructions:
          "Run one of these commands in your project directory to install Starwind UI components. You can combine multiple components in a single command.",
        note: "Make sure you have initialized Starwind UI first with the init command.",
      };
    },
  • The input schema for the 'install_component' tool, defining the expected arguments including packageManager, component (required), additionalComponents, and options.
    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 install",
        },
        additionalComponents: {
          type: "array",
          description: "Additional components to install",
          items: {
            type: "string",
          },
        },
        options: {
          type: "array",
          description:
            "Additional options for installation (e.g., '--all' to install all components)",
          items: {
            type: "string",
          },
        },
      },
      required: ["component"],
    },
  • Registration of the installComponentTool into the central tools Map, making it available for the MCP server.
    // Register install component tool
    tools.set(installComponentTool.name, installComponentTool);
  • TypeScript interface defining the arguments for the install_component handler, matching the input schema.
    export interface InstallComponentArgs {
      /** Package manager to use (npm, yarn, pnpm) */
      packageManager?: "npm" | "yarn" | "pnpm";
      /** Component name to install */
      component: string;
      /** Additional components to install */
      additionalComponents?: string[];
      /** Additional options for installation */
      options?: string[];
    }
  • Import of the installComponentTool from its definition file.
    import { installComponentTool } from "./install_component_tool.js";
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' commands, implying it's a read-only operation that produces instructions rather than executing them, but doesn't clarify whether this requires network access, has side effects, or what format the output takes. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states the core purpose without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place. No structural issues or redundancy are present.

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 moderate complexity (4 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what the generated commands look like, whether they're executable scripts or documentation snippets, or how to handle the output. For a command-generation tool with behavioral uncertainty, more context is needed.

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 already documents all four parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. The baseline score of 3 reflects adequate coverage through the schema alone, with no value added by the description.

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 tool's purpose with a specific verb ('Generates') and resource ('installation commands for Starwind UI components'). It distinguishes this from potential siblings like 'update_component' by focusing on installation rather than updates. However, it doesn't explicitly differentiate from 'init_project' which might also involve installation commands.

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 'update_component' or 'init_project'. It doesn't mention prerequisites, use cases, or exclusions. The agent must infer usage from the tool name and parameters alone.

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