@iress-oss/ids-mcp-server 6.0.0-alpha.2 → 6.0.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +180 -6
  2. package/dist/componentHandlers.js +162 -2
  3. package/dist/componentHandlers.test.js +275 -0
  4. package/dist/iressHandlers.js +6 -0
  5. package/dist/iressHandlers.test.js +4 -0
  6. package/dist/searchHandlers.js +40 -59
  7. package/dist/searchHandlers.test.js +63 -96
  8. package/dist/stylingHandlers.integration.test.js +453 -0
  9. package/dist/stylingHandlers.js +161 -0
  10. package/dist/stylingHandlers.test.js +195 -0
  11. package/dist/tokenHandlers.js +323 -0
  12. package/dist/tokenHandlers.test.js +462 -0
  13. package/dist/toolHandler.js +7 -1
  14. package/dist/toolHandler.test.js +8 -4
  15. package/dist/tools.js +56 -5
  16. package/dist/utils.js +90 -4
  17. package/dist/utils.test.js +154 -1
  18. package/generated/docs/components_components-alert-docs.md +833 -288
  19. package/generated/docs/components_components-autocomplete-docs.md +3440 -1313
  20. package/generated/docs/components_components-autocomplete-recipes-docs.md +10 -1
  21. package/generated/docs/components_components-button-docs.md +899 -403
  22. package/generated/docs/components_components-buttongroup-docs.md +285 -235
  23. package/generated/docs/components_components-card-docs.md +4542 -784
  24. package/generated/docs/components_components-checkbox-docs.md +689 -291
  25. package/generated/docs/components_components-checkboxgroup-docs.md +394 -721
  26. package/generated/docs/components_components-checkboxgroup-recipes-docs.md +10 -74
  27. package/generated/docs/components_components-col-docs.md +88 -142
  28. package/generated/docs/components_components-container-docs.md +23 -12
  29. package/generated/docs/components_components-divider-docs.md +26 -11
  30. package/generated/docs/components_components-expander-docs.md +87 -69
  31. package/generated/docs/components_components-field-docs.md +1390 -706
  32. package/generated/docs/components_components-filter-docs.md +2498 -1184
  33. package/generated/docs/components_components-hide-docs.md +1018 -116
  34. package/generated/docs/components_components-icon-docs.md +1407 -403
  35. package/generated/docs/components_components-image-docs.md +684 -8
  36. package/generated/docs/components_components-inline-docs.md +230 -526
  37. package/generated/docs/components_components-input-docs.md +1558 -426
  38. package/generated/docs/components_components-input-recipes-docs.md +804 -56
  39. package/generated/docs/components_components-inputcurrency-docs.md +1222 -191
  40. package/generated/docs/components_components-inputcurrency-recipes-docs.md +1023 -22
  41. package/generated/docs/components_components-introduction-docs.md +12 -19
  42. package/generated/docs/components_components-label-docs.md +151 -32
  43. package/generated/docs/components_components-link-docs.md +113 -63
  44. package/generated/docs/components_components-menu-docs.md +1094 -385
  45. package/generated/docs/components_components-menu-menuitem-docs.md +889 -335
  46. package/generated/docs/components_components-modal-docs.md +1302 -324
  47. package/generated/docs/components_components-panel-docs.md +54 -68
  48. package/generated/docs/components_components-pill-docs.md +147 -0
  49. package/generated/docs/components_components-placeholder-docs.md +14 -36
  50. package/generated/docs/components_components-popover-docs.md +846 -308
  51. package/generated/docs/components_components-popover-recipes-docs.md +876 -76
  52. package/generated/docs/components_components-progress-docs.md +132 -18
  53. package/generated/docs/components_components-provider-docs.md +27 -11
  54. package/generated/docs/components_components-radio-docs.md +42 -468
  55. package/generated/docs/components_components-radiogroup-docs.md +432 -690
  56. package/generated/docs/components_components-readonly-docs.md +255 -70
  57. package/generated/docs/components_components-row-docs.md +276 -664
  58. package/generated/docs/components_components-select-docs.md +6612 -635
  59. package/generated/docs/components_components-skeleton-docs.md +107 -122
  60. package/generated/docs/components_components-skeleton-recipes-docs.md +344 -10
  61. package/generated/docs/components_components-skiplink-docs.md +60 -37
  62. package/generated/docs/components_components-slideout-docs.md +525 -298
  63. package/generated/docs/components_components-slider-docs.md +504 -318
  64. package/generated/docs/components_components-spinner-docs.md +258 -7
  65. package/generated/docs/components_components-stack-docs.md +244 -243
  66. package/generated/docs/components_components-styled-docs.md +2173 -0
  67. package/generated/docs/components_components-table-docs.md +1198 -928
  68. package/generated/docs/components_components-tabset-docs.md +227 -133
  69. package/generated/docs/components_components-tabset-tab-docs.md +98 -90
  70. package/generated/docs/components_components-tag-docs.md +440 -107
  71. package/generated/docs/components_components-text-docs.md +209 -119
  72. package/generated/docs/components_components-toaster-docs.md +141 -42
  73. package/generated/docs/components_components-toggle-docs.md +132 -77
  74. package/generated/docs/components_components-tooltip-docs.md +57 -41
  75. package/generated/docs/components_components-validationmessage-docs.md +136 -83
  76. package/generated/docs/components_foundations-accessibility-docs.md +1 -1
  77. package/generated/docs/components_foundations-iconography-docs.md +793 -0
  78. package/generated/docs/components_foundations-introduction-docs.md +7 -8
  79. package/generated/docs/components_foundations-responsive-layout-docs.md +533 -399
  80. package/generated/docs/components_foundations-z-index-stacking-docs.md +59 -99
  81. package/generated/docs/components_introduction-docs.md +1 -1
  82. package/generated/docs/components_patterns-form-docs.md +34187 -1062
  83. package/generated/docs/components_patterns-form-recipes-docs.md +1630 -123
  84. package/generated/docs/components_patterns-loading-docs.md +1737 -217
  85. package/generated/docs/components_patterns-shadow-docs.md +44 -90
  86. package/generated/docs/components_sandbox-docs.md +4 -0
  87. package/generated/docs/components_styling-props-accessibility-docs.md +137 -0
  88. package/generated/docs/components_styling-props-colour-docs.md +201 -14
  89. package/generated/docs/components_styling-props-layout-docs.md +1029 -0
  90. package/generated/docs/components_styling-props-radius-docs.md +10 -10
  91. package/generated/docs/components_styling-props-reference-docs.md +237 -62
  92. package/generated/docs/components_styling-props-sizing-docs.md +26 -110
  93. package/generated/docs/components_styling-props-spacing-docs.md +1374 -231
  94. package/generated/docs/components_styling-props-typography-docs.md +159 -7
  95. package/generated/docs/guidelines.md +1382 -441
  96. package/generated/docs/tokens_colour-docs.md +763 -148
  97. package/generated/docs/tokens_introduction-docs.md +119 -89
  98. package/generated/docs/tokens_radius-docs.md +16 -8
  99. package/generated/docs/tokens_sandbox-docs.md +4 -0
  100. package/generated/docs/tokens_spacing-docs.md +10 -40
  101. package/generated/docs/tokens_typography-docs.md +40 -58
  102. package/package.json +15 -11
  103. package/generated/docs/components_components-badge-docs.md +0 -312
  104. package/generated/docs/components_components-richselect-docs.md +0 -6101
  105. package/generated/docs/components_styling-props-elevation-docs.md +0 -69
  106. package/generated/docs/components_styling-props-screen-readers-docs.md +0 -66
  107. package/generated/docs/tokens_elevation-docs.md +0 -39
package/README.md CHANGED
@@ -4,12 +4,12 @@ A Model Context Protocol (MCP) server specifically designed for the **Iress Desi
4
4
 
5
5
  ## Features
6
6
 
7
- - **Component Discovery**: Find IDS components by name or functionality
7
+ - **Component Discovery**: Find IDS components and patterns by name or functionality
8
8
  - **Props & API Reference**: Get detailed component prop information and usage examples
9
9
  - **Usage Examples**: Real-world React code examples and implementation patterns
10
10
  - **Design Tokens**: Access to IDS design tokens (colors, spacing, typography)
11
11
  - **Smart Search**: Search across all IDS documentation with context-aware results
12
- - **Categorized Resources**: Organized by Components, Foundations, and Resources
12
+ - **Categorized Resources**: Organized by Components, Patterns, Foundations, and Resources
13
13
  - **Engineer-Focused**: Tools designed specifically for UI development workflows
14
14
 
15
15
  ## Installation
@@ -54,18 +54,187 @@ For other MCP clients or manual configuration, use this server configuration:
54
54
 
55
55
  ## Available Tools
56
56
 
57
- 1. **find_component**: Find IDS components by name or functionality - perfect for component discovery
57
+ ### Component Discovery & Implementation
58
+
59
+ 1. **find_component**: Find IDS components and patterns by name or functionality - supports both components and patterns (e.g., IressForm, IressButton)
58
60
  2. **get_component_props**: Get detailed prop information and API reference for specific components
59
61
  3. **get_usage_examples**: Get real-world React code examples and implementation patterns
60
- 4. **search_ids_docs**: Search across all IDS documentation with context-aware results
61
- 5. **list_components**: List all available components organized by category
62
- 6. **get_design_tokens**: Access IDS design tokens (colors, spacing, typography, etc.)
62
+ 4. **get_iress_component_info**: Get comprehensive information about Iress components mentioned by their full name (e.g., IressButton, IressInput)
63
+ 5. **analyze_component_mentions**: Analyze text to find all Iress component mentions and provide information about each one
64
+
65
+ ### Design Tokens & Styling
66
+
67
+ 6. **get_design_tokens**: Access IDS design tokens (colors, spacing, typography, etc.) with token definitions and values
68
+ 7. **get_design_tokens_usage**: Get token usage examples, best practices, and anti-patterns with āœ… DO / āŒ DON'T examples
69
+ - Shows when to use tokens vs hardcoded values
70
+ - Demonstrates proper styling prop usage
71
+ - Includes accessibility guidelines for colors
72
+ - Covers spacing scale and directional props
73
+ - Explains IressText vs textStyle prop for typography
74
+ 8. **get_styling_props_reference**: Get comprehensive reference for IDS styling props including spacing, colors, typography, visual effects, and sizing
75
+ - Shows available props by category (spacing, colors, typography, visual, sizing, utility)
76
+ - Includes usage examples and token values
77
+ - Explains when to use style props vs iressCss() vs CSS-in-JS
78
+ - Provides component-specific styling guidance
79
+
80
+ ### Documentation & Guidelines
81
+
82
+ 9. **search_ids_docs**: Search across all IDS documentation with context-aware results
83
+ 10. **list_components**: List all available components organized by category
84
+ 11. **get_design_guidelines**: Get IDS design guidelines covering core principles, visual standards, and accessibility requirements
85
+
86
+ ## Design Token Usage Quick Start
87
+
88
+ The IDS MCP Server provides comprehensive guidance on using design tokens correctly:
89
+
90
+ ### Using `get_design_tokens_usage`
91
+
92
+ ```typescript
93
+ // Get color token usage examples
94
+ get_design_tokens_usage({ category: 'colors' });
95
+ // Returns: Semantic color tokens, āœ… DO/āŒ DON'T examples, accessibility guidelines
96
+
97
+ // Get spacing token usage examples
98
+ get_design_tokens_usage({ category: 'spacing' });
99
+ // Returns: Spacing scale (xs, sm, md, lg, xl), directional props, responsive patterns
100
+
101
+ // Get typography usage examples
102
+ get_design_tokens_usage({ category: 'typography' });
103
+ // Returns: IressText component usage, textStyle prop examples
104
+
105
+ // Get best practices and anti-patterns
106
+ get_design_tokens_usage({ category: 'best-practices' });
107
+ // Returns: When to use styling props vs iressCss() vs custom CSS, common mistakes
108
+
109
+ // Get all usage guidance
110
+ get_design_tokens_usage({ category: 'all' });
111
+ // Returns: Complete guide with all categories
112
+ ```
113
+
114
+ ### Best Practices for AI Code Generation
115
+
116
+ When generating code with the IDS component library:
117
+
118
+ 1. **Always use design tokens** instead of hardcoded values:
119
+ - āœ… `<IressPanel p="md" bg="colour.primary.fill">`
120
+ - āŒ `<IressPanel style={{ padding: '16px', backgroundColor: '#13213F' }}>`
121
+
122
+ 2. **Prefer styling props** over inline styles or custom CSS:
123
+ - āœ… `<IressPanel p="lg" color="colour.primary.text">`
124
+ - āŒ `<div className="custom-padding" style={{ color: '#000' }}>`
125
+
126
+ 3. **Use IressText** for text content (preferred over textStyle prop):
127
+ - āœ… `<IressText element="h1">Heading</IressText>`
128
+ - āŒ `<h1 style={{ fontSize: '24px' }}>Heading</h1>`
129
+
130
+ 4. **Pair bg and color props** for accessibility:
131
+ - āœ… `<IressPanel bg="colour.primary.fill" color="colour.primary.onFill">`
132
+ - āŒ `<IressPanel bg="colour.primary.fill">` (missing color)
133
+
134
+ 5. **For CSS-in-JS, use cssVars from @iress-oss/ids-tokens**:
135
+ - āœ… `background: ${cssVars.colour.primary.fill}; padding: ${cssVars.spacing[400]};`
136
+ - āŒ `background: '#13213F'; padding: '16px';`
137
+
138
+ Use `get_design_tokens_usage` to see practical examples and anti-patterns for each category.
139
+
140
+ ## Styling Props Quick Start
141
+
142
+ The IDS MCP Server provides comprehensive reference for using styling props across all components:
143
+
144
+ ### Using `get_styling_props_reference`
145
+
146
+ ```typescript
147
+ // Get all styling props documentation
148
+ get_styling_props_reference({ category: 'all' });
149
+ // Returns: Complete reference + styling approach decision guide
150
+
151
+ // Get spacing props (padding, margin, textAlign, stretch)
152
+ get_styling_props_reference({ category: 'spacing' });
153
+ // Returns: p, px, py, m, mx, my + token values
154
+
155
+ // Get color props
156
+ get_styling_props_reference({ category: 'colors' });
157
+ // Returns: bg, color props with semantic color tokens
158
+
159
+ // Get typography props
160
+ get_styling_props_reference({ category: 'typography' });
161
+ // Returns: textStyle prop usage
162
+
163
+ // Get visual props (elevation, radius)
164
+ get_styling_props_reference({ category: 'visual' });
165
+ // Returns: layerStyle, borderRadius, focusable props
166
+
167
+ // Get sizing props
168
+ get_styling_props_reference({ category: 'sizing' });
169
+ // Returns: width, maxWidth props
170
+
171
+ // Get utility props (screen readers, scrollable, responsive)
172
+ get_styling_props_reference({ category: 'utility' });
173
+ // Returns: hideFrom, hideBelow, srOnly, scrollable, noGutter props
174
+
175
+ // Get component-specific styling info
176
+ get_styling_props_reference({ component: 'IressButton' });
177
+ // Returns: Which styling props IressButton supports
178
+ ```
179
+
180
+ ### When to Use Different Styling Approaches
181
+
182
+ The `get_styling_props_reference` tool includes comprehensive best practices from the IDS documentation (see the "Best Practices" section in the reference docs):
183
+
184
+ 1. **Style Props (Recommended)**: Use on IDS components for type-safe, theme-compatible inline styles
185
+ - `<IressButton p="md" bg="colour.primary.fill">`
186
+
187
+ 2. **iressCss() Function**: Use on non-IDS elements to apply styling props anywhere
188
+ - `<div className={iressCss({ p: 'xs', bg: 'neutral.alt' })}>`
189
+
190
+ 3. **IressStyled Component**: Use when you need styled wrapper without creating a component
191
+ - `<IressStyled p="md" bg="alt"><YourContent /></IressStyled>`
192
+
193
+ 4. **CSS-in-JS with cssVars**: Use with CSS-in-JS libraries (styled-components, emotion, etc.)
194
+ - `background: ${cssVars.colour.primary.fill};`
195
+
196
+ 5. **Custom CSS**: Use for complex styling, animations, pseudo-selectors
197
+ - When styling props aren't sufficient
198
+
199
+ Use `get_styling_props_reference({ category: 'all' })` to see the complete reference including detailed best practices, decision guide with flowchart, common anti-patterns, and when to use each approach.
200
+
201
+ ### CSS-in-JS Usage
202
+
203
+ When using CSS-in-JS libraries (styled-components, emotion, vanilla-extract, etc.), always use the `cssVars` object from `@iress-oss/ids-tokens`:
204
+
205
+ ```typescript
206
+ import { cssVars } from '@iress-oss/ids-tokens';
207
+ import styled from 'styled-components';
208
+
209
+ // āœ… CORRECT - Using cssVars in CSS-in-JS
210
+ const StyledComponent = styled.div`
211
+ padding: ${cssVars.spacing[400]}; /* md - 16px */
212
+ background-color: ${cssVars.colour.primary.fill};
213
+ color: ${cssVars.colour.primary.onFill};
214
+ font-family: ${cssVars.typography.fontFamily.body};
215
+ `;
216
+
217
+ // āŒ INCORRECT - Hardcoded values
218
+ const BadComponent = styled.div`
219
+ padding: 16px;
220
+ background-color: #13213f;
221
+ `;
222
+ ```
223
+
224
+ **Available cssVars categories:**
225
+
226
+ - `cssVars.colour.*` - All color tokens (primary, neutral, system)
227
+ - `cssVars.spacing[*]` - Spacing scale (100, 200, 400, 600, 1200, etc.)
228
+ - `cssVars.typography.*` - Font families, sizes, weights, line heights
229
+ - `cssVars.radius[*]` - Border radius tokens
230
+ - `cssVars.elevation.*` - Shadow and elevation tokens
63
231
 
64
232
  ## Available Resources
65
233
 
66
234
  All IDS component documentation files are exposed as categorized resources:
67
235
 
68
236
  - **Components**: Button, Input, Table, Modal, etc. (`components-*-docs.md`)
237
+ - **Patterns**: Form, HookForm, etc. (`patterns-*-docs.md`)
69
238
  - **Foundations**: Colors, Typography, Spacing, etc. (`foundations-*-docs.md`)
70
239
  - **Resources**: Changelog, Guidelines, etc. (`resources-*-docs.md`)
71
240
 
@@ -81,6 +250,11 @@ The server works with the IDS component library documentation in the `generated/
81
250
  - `components-modal-docs.md` - IressModal component
82
251
  - `components-*-recipes-docs.md` - Usage patterns and recipes
83
252
 
253
+ **Patterns** (Composite patterns and workflows):
254
+
255
+ - `patterns-form-docs.md` - IressForm pattern
256
+ - `patterns-hookform-docs.md` - IressHookForm pattern
257
+
84
258
  **Foundations** (Guidelines and tokens):
85
259
 
86
260
  - `foundations-colours-docs.md` - Color palette and usage
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { z } from 'zod';
5
5
  import * as path from 'path';
6
- import { getMarkdownFiles, mapIressComponentToFile, extractIressComponents, readFileContent, } from './utils.js';
6
+ import { getMarkdownFiles, mapIressComponentToFile, extractIressComponents, readFileContent, parseMultiComponentQuery, } from './utils.js';
7
7
  import { DOCS_DIR } from './config.js';
8
8
  function checkIressComponentMatch(query) {
9
9
  if (query.startsWith('Iress')) {
@@ -44,6 +44,10 @@ function calculateRelevanceScore(file, content, query, lines) {
44
44
  // Lower relevance for content matches
45
45
  const contentMatches = content.toLowerCase().split(queryLower).length - 1;
46
46
  relevanceScore += contentMatches * 2;
47
+ // Boost pattern-based files as they're often searched for
48
+ if (file.startsWith('patterns-')) {
49
+ relevanceScore += 25;
50
+ }
47
51
  return relevanceScore;
48
52
  }
49
53
  function createSearchResult(file, relevanceScore, lines) {
@@ -60,12 +64,154 @@ function createSearchResult(file, relevanceScore, lines) {
60
64
  description: `${componentName}: ${description}`,
61
65
  };
62
66
  }
67
+ /**
68
+ * Categorize file as component, pattern, or foundation
69
+ */
70
+ function categorizeFile(filename) {
71
+ // New naming convention with namespace prefix
72
+ if (filename.startsWith('components_patterns-'))
73
+ return 'pattern';
74
+ if (filename.startsWith('components_foundations-'))
75
+ return 'foundation';
76
+ if (filename.startsWith('components_components-'))
77
+ return 'component';
78
+ // Legacy naming convention (without namespace prefix)
79
+ if (filename.startsWith('patterns-'))
80
+ return 'pattern';
81
+ if (filename.startsWith('foundations-'))
82
+ return 'foundation';
83
+ return 'component';
84
+ }
85
+ /**
86
+ * Extract description from documentation content
87
+ */
88
+ function extractDescription(lines) {
89
+ // Look for first paragraph after title
90
+ const descriptionStart = lines.findIndex((line) => (line.startsWith('##') && !line.startsWith('###')) ||
91
+ (line.trim().length > 50 && !line.startsWith('#')));
92
+ if (descriptionStart === -1)
93
+ return '';
94
+ return lines[descriptionStart]
95
+ .replace(/^#+\s*/, '')
96
+ .trim()
97
+ .slice(0, 200);
98
+ }
99
+ /**
100
+ * Format individual component summary
101
+ */
102
+ function formatComponentSummary(result) {
103
+ const typeEmoji = {
104
+ component: '🧩',
105
+ pattern: 'šŸ“',
106
+ foundation: 'šŸ—ļø',
107
+ };
108
+ const emoji = result.type ? typeEmoji[result.type] : 'šŸ“¦';
109
+ const typeLabel = result.type
110
+ ? result.type.charAt(0).toUpperCase() + result.type.slice(1)
111
+ : 'Unknown';
112
+ let output = `${emoji} **${result.component}**\n`;
113
+ output += `Type: ${typeLabel}\n`;
114
+ if (result.file) {
115
+ output += `File: ${result.file}\n`;
116
+ }
117
+ output += `\n${result.description}\n`;
118
+ if (result.content) {
119
+ const contentPreview = result.content.slice(0, 500);
120
+ output += `\n\`\`\`\n${contentPreview}${result.content.length > 500 ? '...' : ''}\n\`\`\`\n`;
121
+ }
122
+ return output;
123
+ }
124
+ /**
125
+ * Format search results for multiple components
126
+ */
127
+ function formatMultiComponentResults(results) {
128
+ const foundResults = results.filter((r) => r.found);
129
+ const notFoundResults = results.filter((r) => !r.found);
130
+ let output = '';
131
+ // Header summary
132
+ if (foundResults.length > 0) {
133
+ output += `Found ${foundResults.length} component${foundResults.length !== 1 ? 's' : ''}:\n\n`;
134
+ }
135
+ // Found components
136
+ for (const result of foundResults) {
137
+ output += formatComponentSummary(result);
138
+ output += '\n---\n\n';
139
+ }
140
+ // Not found components
141
+ if (notFoundResults.length > 0) {
142
+ output += `\nāŒ Not found (${notFoundResults.length}):\n`;
143
+ for (const result of notFoundResults) {
144
+ output += `- ${result.component}\n`;
145
+ }
146
+ }
147
+ return output.trim();
148
+ }
149
+ /**
150
+ * Search for multiple components and return combined results
151
+ */
152
+ function handleMultiComponentSearch(componentNames, category) {
153
+ const results = [];
154
+ for (const componentName of componentNames) {
155
+ // Map component to documentation file
156
+ const file = mapIressComponentToFile(componentName);
157
+ if (file) {
158
+ // Read and extract content
159
+ const filePath = path.join(DOCS_DIR, file);
160
+ const content = readFileContent(filePath);
161
+ const lines = content.split('\n');
162
+ // Extract metadata
163
+ const description = extractDescription(lines);
164
+ const type = categorizeFile(file);
165
+ // Apply category filter if provided
166
+ // Note: category uses plural form ('components'), type uses singular ('component')
167
+ const categoryMatchesType = (category === 'components' && type === 'component') ||
168
+ (category === 'foundations' && type === 'foundation') ||
169
+ (category === 'resources' && type === 'pattern'); // Patterns aren't in resources typically
170
+ if (category && !categoryMatchesType) {
171
+ // Skip components that don't match the category filter
172
+ continue;
173
+ }
174
+ results.push({
175
+ component: componentName,
176
+ found: true,
177
+ file,
178
+ type,
179
+ description,
180
+ content: content.slice(0, 1000), // First 1000 chars
181
+ });
182
+ }
183
+ else {
184
+ // Only add not-found components if no category filter, or always add them
185
+ results.push({
186
+ component: componentName,
187
+ found: false,
188
+ file: null,
189
+ type: null,
190
+ description: 'Component not found in documentation',
191
+ });
192
+ }
193
+ }
194
+ return {
195
+ content: [
196
+ {
197
+ type: 'text',
198
+ text: formatMultiComponentResults(results),
199
+ },
200
+ ],
201
+ };
202
+ }
63
203
  export function handleFindComponent(args) {
64
204
  const schema = z.object({
65
205
  query: z.string(),
66
206
  category: z.enum(['components', 'foundations', 'resources']).optional(),
67
207
  });
68
208
  const { query, category } = schema.parse(args);
209
+ // ENHANCEMENT: Detect multiple components
210
+ const componentNames = parseMultiComponentQuery(query);
211
+ if (componentNames.length > 1) {
212
+ // Multi-component search
213
+ return handleMultiComponentSearch(componentNames, category);
214
+ }
69
215
  // Check if query is an Iress component name
70
216
  const iressMatch = checkIressComponentMatch(query);
71
217
  if (iressMatch) {
@@ -179,11 +325,25 @@ export function handleGetComponentProps(args) {
179
325
  const filePath = path.join(DOCS_DIR, componentFile);
180
326
  const content = readFileContent(filePath);
181
327
  const propSections = extractPropSections(content);
328
+ // Most IDS components support styling props - add helpful token usage guidance
329
+ // We include the hint for all components since even components without full styling props
330
+ // often accept margin/padding props, and the guidance is beneficial for AI code generation
331
+ const tokenUsageHint = '\n\n---\n\n**šŸ’” Token Usage Tip**\n\n' +
332
+ 'Most IDS components support styling props that accept design tokens. ' +
333
+ 'Always prefer tokens over hardcoded values for consistency and theming support.\n\n' +
334
+ '**Common styling props:**\n' +
335
+ '- Spacing: `p="md"`, `m="lg"`, `px="sm"`, `py="xl"`\n' +
336
+ '- Colors: `bg="colour.primary.fill"`, `color="colour.primary.text"`\n' +
337
+ '- Typography: `textStyle="typography.heading.4"`\n' +
338
+ '- Layout: `maxWidth`, `width`, `textAlign`\n\n' +
339
+ 'āœ… **DO**: Use design tokens for consistency and theming\n' +
340
+ 'āŒ **DON\'T**: Use `style={{ padding: "16px" }}` or hardcoded colors\n\n' +
341
+ '*Use `get_design_tokens_usage` tool for complete token usage guidelines and best practices.*';
182
342
  return {
183
343
  content: [
184
344
  {
185
345
  type: 'text',
186
- text: `**${component} Component Props & API**\n\n${formatPropsResponse(propSections, content, componentFile)}`,
346
+ text: `**${component} Component Props & API**\n\n${formatPropsResponse(propSections, content, componentFile)}${tokenUsageHint}`,
187
347
  },
188
348
  ],
189
349
  };