Skip to main content
Glama
stephenlumban

NTV Scaffolding MCP Server

generate_ntv_component_usage

Generate complete component usage code with TypeScript class and template for NTV Scaffolding Angular components, providing basic, advanced, or full-form examples.

Instructions

Generates complete component usage code with TypeScript component class and template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name (e.g., 'Button', 'Input')
usageTypeNoType of usage example: basic, advanced, or full-form
componentNameNoCustom component name for the example (default: ExampleComponent)

Implementation Reference

  • The main execute handler that processes input arguments, retrieves the specified component from COMPONENTS_DB, determines the usage type, generates the appropriate usage example code, and returns it.
    execute: async (args: Record<string, unknown>) => {
      const componentName = args.component as string;
      const usageType = (args.usageType as string) || "basic";
      const customComponentName = (args.componentName as string) || "ExampleComponent";
    
      const component = COMPONENTS_DB.find(
        (c) => c.name.toLowerCase() === componentName.toLowerCase()
      );
    
      if (!component) {
        throw new Error(`Component '${componentName}' not found`);
      }
    
      const usageExamples = generateUsageExample(component, usageType, customComponentName);
    
      return usageExamples;
    },
  • Input schema defining the tool's parameters: component (required string), optional usageType (enum: basic/advanced/full-form), and optional componentName.
    inputSchema: {
      type: "object",
      properties: {
        component: {
          type: "string",
          description: "Component name (e.g., 'Button', 'Input')",
        },
        usageType: {
          type: "string",
          enum: ["basic", "advanced", "full-form"],
          description: "Type of usage example: basic, advanced, or full-form",
        },
        componentName: {
          type: "string",
          description: "Custom component name for the example (default: ExampleComponent)",
        },
      },
      required: ["component"],
    },
  • The tool is registered (as generateComponentUsageTool) in the exported componentTools array used by the main MCP server.
    export const componentTools: MCPTool[] = [
      generateComponentTool,
      getComponentDocTool,
      listComponentsTool,
      generateComponentUsageTool,
      getComponentPropsToolDefinition,
      generateTemplateCodeTool,
      getComponentExamplesTool,
      getComponentUsagePatternTool,
    ];
  • Core helper function that dispatches to specific usage generators (basic, advanced, full-form) based on the usageType.
    function generateUsageExample(
      component: Component,
      usageType: string,
      customComponentName: string
    ): Record<string, unknown> {
      const basePath = `app/${customComponentName.toLowerCase()}`;
    
      if (usageType === "basic") {
        return generateBasicUsage(component, customComponentName);
      } else if (usageType === "advanced") {
        return generateAdvancedUsage(component, customComponentName);
      } else if (usageType === "full-form") {
        return generateFullFormUsage(component, customComponentName);
      }
    
      return { error: "Unknown usage type" };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool 'Generates' code, implying a write operation, but doesn't cover critical aspects like whether this creates files or returns code snippets, if it requires specific permissions, or any side effects. The description is minimal and lacks behavioral context beyond the basic action.

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 front-loads the core action and output details without any fluff. Every word earns its place, making it highly concise and well-structured for quick understanding.

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 has 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the generated output looks like (e.g., code format, structure), any prerequisites, or how it integrates with sibling tools. For a code generation tool with multiple parameters, more context is needed to guide 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?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no parameter-specific information beyond what's in the schema, such as clarifying relationships between 'component' and 'componentName' or elaborating on 'usageType' enum values. Baseline 3 is appropriate when 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 verb ('Generates') and resource ('complete component usage code') with specific output details ('TypeScript component class and template'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'generate_ntv_component_file' or 'generate_ntv_template_code', which likely generate different artifacts.

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. With siblings like 'get_ntv_component_usage_pattern' and 'get_ntv_component_examples', there's no indication of how this generation tool differs from retrieval tools, leaving the agent to guess based on tool names 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/stephenlumban/component-mcp'

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