Skip to main content
Glama

get_dependencies

Retrieve npm dependencies for Reacticx components to plan installations and manage project requirements.

Instructions

Get the required npm dependencies for one or more Reacticx components. Useful for planning installations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentsYesArray of component slugs to check dependencies for

Implementation Reference

  • Main handler implementation for get_dependencies tool. Takes an array of component slugs, looks up each component using getComponentBySlug, collects all dependencies into a Set to avoid duplicates, and returns formatted output with per-component dependencies and a combined npm install command.
    server.tool(
      "get_dependencies",
      "Get the required npm dependencies for one or more Reacticx components. Useful for planning installations.",
      {
        components: z
          .array(z.string())
          .describe(
            "Array of component slugs to check dependencies for"
          ),
      },
      async ({ components }) => {
        const allDeps = new Set<string>();
        const notFound: string[] = [];
        const found: { name: string; slug: string; deps: string[] }[] = [];
    
        for (const slug of components) {
          const info = getComponentBySlug(slug.toLowerCase().trim());
          if (info) {
            found.push({
              name: info.name,
              slug: info.slug,
              deps: info.dependencies,
            });
            info.dependencies.forEach((d) => allDeps.add(d));
          } else {
            notFound.push(slug);
          }
        }
    
        let output = `# Dependencies for ${found.length} component(s)\n\n`;
    
        if (found.length > 0) {
          for (const comp of found) {
            output += `- **${comp.name}** (\`${comp.slug}\`): ${comp.deps.length > 0 ? comp.deps.join(", ") : "no extra dependencies"}\n`;
          }
    
          output += `\n## Combined Install Command\n\n`;
          if (allDeps.size > 0) {
            output += `\`\`\`bash\nnpm install ${[...allDeps].join(" ")}\n\`\`\`\n`;
          } else {
            output += `No additional dependencies required.\n`;
          }
    
          output += `\n## Add Components\n\n\`\`\`bash\n${found.map((c) => `bunx --bun reacticx add ${c.slug}`).join("\n")}\n\`\`\`\n`;
        }
    
        if (notFound.length > 0) {
          output += `\n## Not Found\n\n${notFound.map((s) => `- "${s}"`).join("\n")}\n`;
        }
    
        return {
          content: [{ type: "text" as const, text: output }],
        };
      }
    );
  • Input schema definition using zod for the get_dependencies tool. Validates that the input is an array of strings representing component slugs.
    components: z
      .array(z.string())
      .describe(
        "Array of component slugs to check dependencies for"
      ),
  • src/index.ts:215-224 (registration)
    Tool registration with the MCP server. Registers the get_dependencies tool with its name, description, and input schema.
    server.tool(
      "get_dependencies",
      "Get the required npm dependencies for one or more Reacticx components. Useful for planning installations.",
      {
        components: z
          .array(z.string())
          .describe(
            "Array of component slugs to check dependencies for"
          ),
      },
  • Helper function getComponentBySlug used by the get_dependencies handler to look up component information from the registry by slug.
    export function getComponentBySlug(
      slug: string
    ): ComponentInfo | undefined {
      return COMPONENT_REGISTRY.find(
        (c) => c.slug.toLowerCase() === slug.toLowerCase()
      );
    }
  • ComponentInfo interface definition that includes the dependencies array used by the get_dependencies tool to retrieve component dependency information.
    export interface ComponentInfo {
      name: string;
      slug: string;
      category: string;
      description: string;
      dependencies: string[];
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool 'gets' dependencies, implying a read-only operation, but doesn't specify whether it requires authentication, has rate limits, returns structured data, or handles errors. For a tool with no annotation coverage, this is a significant gap in transparency about its behavior and constraints.

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 appropriately sized and front-loaded, consisting of two concise sentences: the first states the core purpose, and the second provides usage context. Every sentence earns its place without redundancy or fluff, making it efficient and easy for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 (single parameter, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and basic usage but lacks details on behavioral traits (e.g., authentication needs) and output format, which are important for a dependency-checking tool. This results in a minimal viable description with clear gaps.

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, with the 'components' parameter fully documented in the schema as 'Array of component slugs to check dependencies for.' The description adds no additional parameter semantics beyond this, such as examples of slugs or format details. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema does the heavy lifting.

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: 'Get the required npm dependencies for one or more Reacticx components.' It specifies the verb ('Get'), resource ('npm dependencies'), and scope ('Reacticx components'), distinguishing it from sibling tools like 'list_components' or 'get_component_docs'. However, it doesn't explicitly differentiate from all siblings (e.g., 'search_components' might also involve dependencies), so it falls short of a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance with 'Useful for planning installations,' suggesting it should be used when preparing to install dependencies. However, it lacks explicit when-to-use vs. when-not-to-use instructions or named alternatives among sibling tools (e.g., no mention of when to use 'list_components' instead). This leaves gaps in guiding the agent on optimal tool selection.

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/igorfelipeduca/reacticx-mcp'

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