@@ -13,7 +13,6 @@ import type { ListPromptsRequestSchema, GetPromptRequestSchema } from "@modelcon
1313import { z } from 'zod' ;
1414import {
1515 designTokens ,
16- components ,
1716 documentation ,
1817 getComponentTokenDependencies ,
1918} from './optics-data.js' ;
@@ -45,6 +44,7 @@ import GetTokenTool from './tools/get-token-tool.js';
4544import GetTokenUsageStatsTool from './tools/get-token-usage-stats-tool.js' ;
4645import SearchTokensTool from './tools/search-tokens-tool.js' ;
4746import ListComponentsTool from './tools/list-components-tool.js'
47+ import GetComponentInfoTool from './tools/get-component-info-tool.js' ;
4848
4949/**
5050 * Create and configure the MCP server
@@ -186,7 +186,7 @@ prompts.forEach((prompt) => {
186186// get_token_usage_stats ✅
187187// search_tokens ✅
188188// list_components ✅
189- // get_component_info
189+ // get_component_info ✅
190190// get_component_tokens
191191// search_documentation
192192
@@ -195,6 +195,7 @@ const tools = [
195195 new GetTokenUsageStatsTool ( ) ,
196196 new SearchTokensTool ( ) ,
197197 new ListComponentsTool ( ) ,
198+ new GetComponentInfoTool ( ) ,
198199]
199200
200201tools . forEach ( ( tool ) => {
@@ -220,47 +221,6 @@ tools.forEach((tool) => {
220221 )
221222} )
222223
223- /**
224- * Tool: Get Component Info
225- */
226- server . registerTool (
227- 'get_component_info' ,
228- {
229- title : 'Get Component Info' ,
230- description : 'Get detailed information about a component including its design token dependencies' ,
231- inputSchema : {
232- componentName : z . string ( ) . describe ( 'The name of the component (e.g., "Button", "Card", "Input")' ) ,
233- } ,
234- } ,
235- async ( { componentName } ) => {
236- const component = components . find (
237- ( c ) => c . name . toLowerCase ( ) === componentName . toLowerCase ( )
238- ) ;
239-
240- if ( ! component ) {
241- return {
242- content : [
243- {
244- type : 'text' ,
245- text : `Component not found: ${ componentName } \n\nAvailable components: ${ components
246- . map ( ( c ) => c . name )
247- . join ( ', ' ) } `,
248- } ,
249- ] ,
250- } ;
251- }
252-
253- return {
254- content : [
255- {
256- type : 'text' ,
257- text : JSON . stringify ( component , null , 2 ) ,
258- } ,
259- ] ,
260- } ;
261- }
262- ) ;
263-
264224/**
265225 * Tool: Get Component Tokens
266226 */
0 commit comments