Skip to main content
Glama
stephenlumban

NTV Scaffolding MCP Server

get_ntv_component_examples

Retrieve predefined usage examples and code snippets for specific Angular components to understand implementation patterns and accelerate development.

Instructions

Gets predefined usage examples and code snippets for a specific component

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name (e.g., 'Button', 'Input')
includeCodeNoInclude full code snippets in response. Default: true

Implementation Reference

  • The execute function implementing the tool logic: finds the component in COMPONENTS_DB, retrieves and formats its examples based on the includeCode parameter, and returns structured data.
    execute: async (args: Record<string, unknown>) => {
      const componentName = args.component as string;
      const includeCode = args.includeCode !== false;
    
      const component = COMPONENTS_DB.find(
        (c) => c.name.toLowerCase() === componentName.toLowerCase()
      );
    
      if (!component) {
        throw new Error(`Component '${componentName}' not found`);
      }
    
      const examples = component.examples || [];
      const formattedExamples = examples.map((example: any) => ({
        title: example.title,
        description: example.description,
        template: includeCode ? example.template : undefined,
        component: includeCode ? example.component : undefined,
        notes: example.notes,
      }));
    
      return {
        component: componentName,
        exampleCount: formattedExamples.length,
        examples: formattedExamples,
      };
    },
  • Input schema defining the parameters: component (required string) and optional includeCode (boolean).
    inputSchema: {
      type: "object",
      properties: {
        component: {
          type: "string",
          description: "Component name (e.g., 'Button', 'Input')",
        },
        includeCode: {
          type: "boolean",
          description: "Include full code snippets in response. Default: true",
        },
      },
      required: ["component"],
    },
  • The getComponentExamplesTool is registered in the componentTools array, imported on line 7, which is used by the MCP server to list and call tools.
    export const componentTools: MCPTool[] = [
      generateComponentTool,
      getComponentDocTool,
      listComponentsTool,
      generateComponentUsageTool,
      getComponentPropsToolDefinition,
      generateTemplateCodeTool,
      getComponentExamplesTool,
      getComponentUsagePatternTool,
    ];

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