@@ -11,7 +11,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1111import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js' ;
1212import type { ListPromptsRequestSchema , GetPromptRequestSchema } from "@modelcontextprotocol/sdk/types"
1313import { z } from 'zod' ;
14- import { designTokens , documentation } from './optics-data.js' ;
14+ import { designTokens } from './optics-data.js' ;
1515import { generateTheme } from './tools/theme-generator.js' ;
1616import { validateTokenUsage , formatValidationReport } from './tools/validate.js' ;
1717import { replaceHardCodedValues , formatReplacementSuggestions } from './tools/replace.js' ;
@@ -42,6 +42,7 @@ import SearchTokensTool from './tools/search-tokens-tool.js';
4242import ListComponentsTool from './tools/list-components-tool.js'
4343import GetComponentInfoTool from './tools/get-component-info-tool.js' ;
4444import GetComponentTokensTool from './tools/get-component-tokens-tool.js' ;
45+ import SearchDocumentationTool from './tools/search-documentation-tool.js' ;
4546
4647/**
4748 * Create and configure the MCP server
@@ -179,21 +180,14 @@ prompts.forEach((prompt) => {
179180 * Tools
180181 */
181182
182- // get_token ✅
183- // get_token_usage_stats ✅
184- // search_tokens ✅
185- // list_components ✅
186- // get_component_info ✅
187- // get_component_tokens ✅
188- // search_documentation
189-
190183const tools = [
191184 new GetTokenTool ( ) ,
192185 new GetTokenUsageStatsTool ( ) ,
193186 new SearchTokensTool ( ) ,
194187 new ListComponentsTool ( ) ,
195188 new GetComponentInfoTool ( ) ,
196189 new GetComponentTokensTool ( ) ,
190+ new SearchDocumentationTool ( )
197191]
198192
199193tools . forEach ( ( tool ) => {
@@ -219,37 +213,6 @@ tools.forEach((tool) => {
219213 )
220214} )
221215
222- /**
223- * Tool: Search Documentation
224- */
225- server . registerTool (
226- 'search_documentation' ,
227- {
228- title : 'Search Documentation' ,
229- description : 'Search through Optics documentation' ,
230- inputSchema : {
231- query : z . string ( ) . describe ( 'Search query for documentation content' ) ,
232- } ,
233- } ,
234- async ( { query } ) => {
235- const results = documentation . filter (
236- ( doc ) =>
237- doc . title . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ||
238- doc . content . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ||
239- doc . section . toLowerCase ( ) . includes ( query . toLowerCase ( ) )
240- ) ;
241-
242- return {
243- content : [
244- {
245- type : 'text' ,
246- text : JSON . stringify ( results , null , 2 ) ,
247- } ,
248- ] ,
249- } ;
250- }
251- ) ;
252-
253216/**
254217 * Tool: Generate Theme
255218 */
0 commit comments