Skip to main content
Glama
stephenlumban

NTV Scaffolding MCP Server

get_ntv_component_usage_pattern

Retrieve Angular standalone component usage patterns for specific NTV components to implement correct component integration in your Angular applications.

Instructions

Gets the proper Angular standalone component usage pattern for a specific NTV component

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name (e.g., 'Button', 'Input', 'Card')

Implementation Reference

  • The async execute function that handles the tool's logic: retrieves the component from COMPONENTS_DB, generates import statements, usage examples for standalone components and NgModules, template usage, key points, property types, and events.
      execute: async (args: Record<string, unknown>) => {
        const componentName = args.component as string;
        const component = COMPONENTS_DB.find(
          (c) => c.name.toLowerCase() === componentName.toLowerCase()
        );
    
        if (!component) {
          throw new Error(`Component '${componentName}' not found`);
        }
    
        const importStatement = `import { ${component.name} } from '@ntv-scaffolding/component-pantry';`;
        
        const standaloneUsage = `@Component({
      selector: 'app-example',
      standalone: true,
      imports: [${component.name}],  // ← Import the component
      template: \`
        <${component.selector}
          [config]="{ /* config options */ }">
          Content here
        </${component.selector}>
      \`
    })
    export class ExampleComponent {}`;
    
        const ngModuleUsage = `// If using NgModule (older pattern):
    import { NgModule } from '@angular/core';
    import { ${component.name} } from '@ntv-scaffolding/component-pantry';
    
    @NgModule({
      imports: [${component.name}],  // ← Import the component
    })
    export class MyModule {}`;
    
        const templateUsage = `<!-- In template, use the selector: -->
    <${component.selector}
      [config]="{ /* configuration */ }">
      Your content
    </${component.selector}>`;
    
        return {
          component: componentName,
          selector: component.selector,
          importStatement,
          standalonePattern: standaloneUsage,
          ngModulePattern: ngModuleUsage,
          templateUsage,
          keyPoints: [
            "✅ This is an Angular Standalone Component (not a Web Component)",
            "✅ Must be imported in your component's imports array",
            "✅ Use the selector as an HTML element in templates",
            "✅ Pass configuration via [config] property binding",
            "✅ For standalone components: add to component imports",
            "✅ For NgModule: add to module imports",
            "✅ Requires @angular/core and other Angular dependencies"
          ],
          propertyTypes: component.props.map(p => ({
            name: p.name,
            type: p.type,
            default: p.default,
          })),
          events: component.events || [],
        };
      },
  • Defines the input schema requiring a 'component' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        component: {
          type: "string",
          description: "Component name (e.g., 'Button', 'Input', 'Card')",
        },
      },
      required: ["component"],
    },
  • The getComponentUsagePatternTool is imported and registered in the componentTools array, which lists all MCP tools.
    export const componentTools: MCPTool[] = [
      generateComponentTool,
      getComponentDocTool,
      listComponentsTool,
      generateComponentUsageTool,
      getComponentPropsToolDefinition,
      generateTemplateCodeTool,
      getComponentExamplesTool,
      getComponentUsagePatternTool,
    ];
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 states a read operation ('Gets'), which suggests it's non-destructive, but doesn't clarify aspects like authentication needs, rate limits, error handling, or the format of the returned usage pattern (e.g., text, code snippet). This leaves significant gaps for safe and effective tool invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids redundancy and wastes no words, though it could benefit from slightly more detail to improve completeness without sacrificing brevity.

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 (a read operation with one parameter) and lack of annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, usage context, and output format, which are needed for a more complete understanding, especially without structured fields to fill 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 'component' parameter well-documented as 'Component name (e.g., 'Button', 'Input', 'Card')'. The description adds no additional meaning beyond this, such as clarifying valid component names or constraints, so it meets the baseline for high schema coverage without compensating value.

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 ('Gets') and the resource ('proper Angular standalone component usage pattern for a specific NTV component'), making the purpose understandable. It distinguishes from siblings like 'get_ntv_component_doc' or 'get_ntv_component_examples' by focusing on usage patterns, but could be more specific about what a 'usage pattern' entails (e.g., code structure, best practices).

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?

No explicit guidance is provided on when to use this tool versus alternatives like 'get_ntv_component_examples' or 'generate_ntv_component_usage'. The description implies usage for a 'specific NTV component', but lacks context on prerequisites, scenarios, or exclusions, leaving the agent to infer 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