File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,23 @@ const paramCompletion = async (filters: FilterPatternFlyFilters) => {
1717 const schemas = new Set < string > ( ) ;
1818
1919 for ( const entry of byEntry ) {
20- names . add ( entry . name ) ;
21- categories . add ( entry . category ) ;
22- sections . add ( entry . section ) ;
23- versions . add ( entry . version ) ;
20+ if ( typeof entry . name === 'string' ) {
21+ names . add ( entry . name ) ;
22+ }
23+
24+ if ( typeof entry . category === 'string' ) {
25+ categories . add ( entry . category ) ;
26+ }
27+
28+ if ( typeof entry . section === 'string' ) {
29+ sections . add ( entry . section ) ;
30+ }
31+
32+ if ( typeof entry . version === 'string' ) {
33+ versions . add ( entry . version ) ;
34+ }
2435
25- if ( entry . uriSchemas !== undefined ) {
36+ if ( entry . uriSchemas !== undefined && typeof entry . name === 'string' ) {
2637 schemas . add ( entry . name ) ;
2738 }
2839 }
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const CONFIG = {
4646 * @note We use "byVersionComponentNames" instead of "byVersion" because it's specific to components.
4747 * Docs resources don't necessarily contain all components.
4848 *
49- * @returns {Promise<PatterFlyListResourceResult > } The list of available resources.
49+ * @returns {Promise<PatternFlyListResourceResult > } The list of available resources.
5050 */
5151const listResources = async ( ) => {
5252 const { availableVersions, byVersionComponentNames } = await getPatternFlyMcpResources . memo ( ) ;
@@ -103,7 +103,7 @@ const uriCategoryComplete: ExtendedCompleteResourceTemplateCallback = async (cat
103103uriCategoryComplete . memo = memo ( uriCategoryComplete ) ;
104104
105105/**
106- * Name completion callback for the URI template.
106+ * Version completion callback for the URI template.
107107 *
108108 * @param version - The value to complete.
109109 * @param context - The completion context containing arguments for the URI template.
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const CONFIG = {
6666 *
6767 * @note It's important to keep lists focused and concise, avoid listing all resources.
6868 *
69- * @returns {Promise<PatterFlyListResourceResult > } The list of available resources.
69+ * @returns {Promise<PatternFlyListResourceResult > } The list of available resources.
7070 */
7171const listResources = async ( ) => {
7272 const { availableVersions, byVersion } = await getPatternFlyMcpResources . memo ( ) ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const CONFIG = {
4040/**
4141 * List resources callback for the URI template.
4242 *
43- * @returns {Promise<PatterFlyListResourceResult > } The list of available resources.
43+ * @returns {Promise<PatternFlyListResourceResult > } The list of available resources.
4444 */
4545const listResources = async ( ) => {
4646 const { availableSchemasVersions, byVersionComponentNames } = await getPatternFlyMcpResources . memo ( ) ;
You can’t perform that action at this time.
0 commit comments