Skip to main content
Glama
getComponentProps.ts1.5 kB
import { MCPTool } from "./index.js"; import { COMPONENTS_DB } from "../data/components.js"; export const getComponentPropsToolDefinition: MCPTool = { name: "get_ntv_component_props", description: "Get detailed information about a component's input properties and configuration options", inputSchema: { type: "object", properties: { component: { type: "string", description: "Component name (e.g., 'Button', 'Input')", }, propName: { type: "string", description: "Optional: Get details for a specific property", }, }, required: ["component"], }, execute: async (args: Record<string, unknown>) => { const componentName = args.component as string; const propName = args.propName as string | undefined; const component = COMPONENTS_DB.find( (c) => c.name.toLowerCase() === componentName.toLowerCase() ); if (!component) { throw new Error(`Component '${componentName}' not found`); } if (propName) { const prop = component.props.find( (p) => p.name.toLowerCase() === propName.toLowerCase() ); if (!prop) { throw new Error( `Property '${propName}' not found on component '${componentName}'` ); } return { component: componentName, property: prop }; } return { component: componentName, properties: component.props, configInterface: component.configInterface || null, }; }, };

Implementation Reference

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