@egain/egain-mcp-server 1.0.26 → 1.0.27

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 (96) hide show
  1. package/README.md +18 -43
  2. package/bin/mcp-server.js +335 -89
  3. package/bin/mcp-server.js.map +24 -25
  4. package/esm/src/funcs/getAnnouncements.d.ts +39 -1
  5. package/esm/src/funcs/getAnnouncements.d.ts.map +1 -1
  6. package/esm/src/funcs/getAnnouncements.js +39 -1
  7. package/esm/src/funcs/getAnnouncements.js.map +1 -1
  8. package/esm/src/funcs/getArticle.d.ts +42 -0
  9. package/esm/src/funcs/getArticle.d.ts.map +1 -1
  10. package/esm/src/funcs/getArticle.js +42 -0
  11. package/esm/src/funcs/getArticle.js.map +1 -1
  12. package/esm/src/funcs/getPopularArticles.d.ts +37 -0
  13. package/esm/src/funcs/getPopularArticles.d.ts.map +1 -1
  14. package/esm/src/funcs/getPopularArticles.js +37 -0
  15. package/esm/src/funcs/getPopularArticles.js.map +1 -1
  16. package/esm/src/funcs/getPortals.d.ts +26 -1
  17. package/esm/src/funcs/getPortals.d.ts.map +1 -1
  18. package/esm/src/funcs/getPortals.js +35 -10
  19. package/esm/src/funcs/getPortals.js.map +1 -1
  20. package/esm/src/funcs/makeSuggestion.d.ts +42 -0
  21. package/esm/src/funcs/makeSuggestion.d.ts.map +1 -1
  22. package/esm/src/funcs/makeSuggestion.js +42 -0
  23. package/esm/src/funcs/makeSuggestion.js.map +1 -1
  24. package/esm/src/funcs/queryAnswers.d.ts +41 -5
  25. package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
  26. package/esm/src/funcs/queryAnswers.js +41 -5
  27. package/esm/src/funcs/queryAnswers.js.map +1 -1
  28. package/esm/src/funcs/queryRetrieve.d.ts +41 -1
  29. package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
  30. package/esm/src/funcs/queryRetrieve.js +41 -1
  31. package/esm/src/funcs/queryRetrieve.js.map +1 -1
  32. package/esm/src/funcs/querySearch.d.ts +48 -1
  33. package/esm/src/funcs/querySearch.d.ts.map +1 -1
  34. package/esm/src/funcs/querySearch.js +48 -1
  35. package/esm/src/funcs/querySearch.js.map +1 -1
  36. package/esm/src/lib/config.d.ts +2 -2
  37. package/esm/src/lib/config.js +2 -2
  38. package/esm/src/mcp-server/mcp-server.js +1 -1
  39. package/esm/src/mcp-server/server.js +1 -1
  40. package/esm/src/mcp-server/tools/getAnnouncements.d.ts.map +1 -1
  41. package/esm/src/mcp-server/tools/getAnnouncements.js +39 -1
  42. package/esm/src/mcp-server/tools/getAnnouncements.js.map +1 -1
  43. package/esm/src/mcp-server/tools/getArticle.d.ts.map +1 -1
  44. package/esm/src/mcp-server/tools/getArticle.js +42 -0
  45. package/esm/src/mcp-server/tools/getArticle.js.map +1 -1
  46. package/esm/src/mcp-server/tools/getPopularArticles.d.ts.map +1 -1
  47. package/esm/src/mcp-server/tools/getPopularArticles.js +37 -0
  48. package/esm/src/mcp-server/tools/getPopularArticles.js.map +1 -1
  49. package/esm/src/mcp-server/tools/getPortals.d.ts +1 -1
  50. package/esm/src/mcp-server/tools/getPortals.d.ts.map +1 -1
  51. package/esm/src/mcp-server/tools/getPortals.js +26 -1
  52. package/esm/src/mcp-server/tools/getPortals.js.map +1 -1
  53. package/esm/src/mcp-server/tools/makeSuggestion.d.ts.map +1 -1
  54. package/esm/src/mcp-server/tools/makeSuggestion.js +42 -0
  55. package/esm/src/mcp-server/tools/makeSuggestion.js.map +1 -1
  56. package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
  57. package/esm/src/mcp-server/tools/queryAnswers.js +41 -5
  58. package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
  59. package/esm/src/mcp-server/tools/queryRetrieve.d.ts.map +1 -1
  60. package/esm/src/mcp-server/tools/queryRetrieve.js +41 -1
  61. package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
  62. package/esm/src/mcp-server/tools/querySearch.d.ts.map +1 -1
  63. package/esm/src/mcp-server/tools/querySearch.js +48 -1
  64. package/esm/src/mcp-server/tools/querySearch.js.map +1 -1
  65. package/esm/src/models/articletype.d.ts +1 -6
  66. package/esm/src/models/articletype.d.ts.map +1 -1
  67. package/esm/src/models/articletype.js +1 -15
  68. package/esm/src/models/articletype.js.map +1 -1
  69. package/esm/src/models/getmyportalsop.d.ts +2 -2
  70. package/esm/src/models/getmyportalsop.d.ts.map +1 -1
  71. package/esm/src/models/getmyportalsop.js +2 -2
  72. package/esm/src/models/getmyportalsop.js.map +1 -1
  73. package/manifest.json +10 -10
  74. package/package.json +1 -1
  75. package/src/funcs/getAnnouncements.ts +39 -1
  76. package/src/funcs/getArticle.ts +42 -0
  77. package/src/funcs/getPopularArticles.ts +37 -0
  78. package/src/funcs/getPortals.ts +37 -12
  79. package/src/funcs/makeSuggestion.ts +42 -0
  80. package/src/funcs/queryAnswers.ts +41 -5
  81. package/src/funcs/queryRetrieve.ts +41 -1
  82. package/src/funcs/querySearch.ts +48 -1
  83. package/src/lib/config.ts +2 -2
  84. package/src/mcp-server/mcp-server.ts +1 -1
  85. package/src/mcp-server/server.ts +1 -1
  86. package/src/mcp-server/tools/getAnnouncements.ts +39 -1
  87. package/src/mcp-server/tools/getArticle.ts +42 -0
  88. package/src/mcp-server/tools/getPopularArticles.ts +37 -0
  89. package/src/mcp-server/tools/getPortals.ts +26 -1
  90. package/src/mcp-server/tools/makeSuggestion.ts +42 -0
  91. package/src/mcp-server/tools/queryAnswers.ts +41 -5
  92. package/src/mcp-server/tools/queryRetrieve.ts +41 -1
  93. package/src/mcp-server/tools/querySearch.ts +48 -1
  94. package/src/models/articletype.ts +2 -19
  95. package/src/models/getmyportalsop.ts +5 -5
  96. package/src/models/mandatorylanguagequeryparameter.ts +0 -59
package/README.md CHANGED
@@ -31,18 +31,19 @@ Learn more about the tools and usage of the MCP in the [eGain MCP guide](https:/
31
31
  - eGain platform version **21.22 or newer**
32
32
  - AI Services enabled for the tenant and target portal
33
33
  - Knowledge portal and article content available
34
- - Supported browser: Chrome, Edge, or Brave
35
- - A client application configured in your eGain tenant
34
+ - **Supported browser:** Chrome, Edge, or Brave
35
+ - **Client application** configured in your eGain tenant (some environments have a pre-configured **APIs Trial** app)
36
+ - Delegated API permissions in your client app: `knowledge.portalmgr.manage`, `knowledge.portalmgr.read`, `core.aiservices.read`
36
37
 
37
- > ℹ️ MCP access always mirrors the authenticated users permissions (portal and article visibility).
38
+ > ℹ️ MCP access always mirrors the authenticated user's permissions (portal and article visibility).
38
39
 
39
40
  ## Installation
40
41
 
41
42
  https://github.com/user-attachments/assets/2cecc8ff-6a90-4c26-92e1-6720f9124297
42
43
 
43
- ### Step 1: Configure your MCP client (Cursor, Claude Desktop, Windsurf, VS Code, etc.) with the following:
44
+ ### Configure your MCP client
44
45
 
45
- **Note:** Replace `"..."` with your API domain (instructions in **Step 2**).
46
+ Add this to your MCP client settings (Cursor, Claude Desktop, etc.), replacing `...` with your eGain API domain:
46
47
 
47
48
  ```json
48
49
  {
@@ -60,54 +61,28 @@ https://github.com/user-attachments/assets/2cecc8ff-6a90-4c26-92e1-6720f9124297
60
61
  }
61
62
  ```
62
63
 
63
- ### Step 2: Find your API domain using the eGain Administrator Console
64
- 1. Sign in as a Partition Admin → go to `Partition` → `Integration` → `Client Application`.
65
- 2. Click `Metadata`. The value `API Domain` is detailed in the window.
64
+ <details>
65
+ <summary><strong>How do I find my API domain?</strong></summary>
66
66
 
67
- Please contact your eGain PA if you do not have access to these admin-only details.
67
+ 1. Sign in to the eGain Administrator Console as a Partition Admin
68
+ 2. Go to `Partition` → `Integration` → `Client Application` → `Metadata`
69
+ 3. Copy the `API Domain` value
68
70
 
69
- That's it! The MCP server will be automatically downloaded and run when needed.
71
+ Contact your eGain PA if you do not have access to these admin-only details.
72
+ </details>
70
73
 
71
- If you're having trouble configuring your MCP client, see these detailed guides:
72
- - Claude quick-start and example queries: [Claude Guide](./help/claude-example.md)
73
- - Cursor quick-start and example queries: [Cursor Guide](./help/cursor-example.md)
74
+ The MCP server will be automatically downloaded and run when needed. For client-specific setup, see the [Claude Guide](./help/claude-example.md) or [Cursor Guide](./help/cursor-example.md).
74
75
 
75
- ### Step 3: Make a query and authenticate
76
+ ### Authenticate
76
77
 
77
- Once you've set up the server on your client, **run your first eGain MCP query** and a browser window will popup for authentication.
78
+ https://github.com/user-attachments/assets/8df17bfa-141c-4f00-9412-5d3f6131574f
78
79
 
79
- **Requirements for authentication:**
80
- - A client application configured in your eGain tenant (some environments may have a pre-configured **APIs Trial** client app)
81
- - A supported browser (Chrome, Edge, or Brave — Safari is not supported)
82
- - Delegated API permissions in your client app:
83
- - `knowledge.portalmgr.manage`
84
- - `knowledge.portalmgr.read`
85
- - `core.aiservices.read`
80
+ On your first MCP query, a browser window will open for authentication.
86
81
 
87
- You'll need to enter your authentication configuration values in the browser form. For a tutorial, see the [Authentication Deep Dive](./help/authentication.md). If you need to create a client application, see the [API Authentication Guide](https://apidev.egain.com/developer-portal/get-started/authentication_guide/) — **be sure to select SPA (Single Page Application) as the platform type**. Please contact your eGain PA if you do not have access to client application settings.
82
+ Enter your authentication configuration values in the browser form. For details, see the [Authentication Deep Dive](./help/authentication.md). If you need to create a client application, see the [API Authentication Guide](https://apidev.egain.com/developer-portal/get-started/authentication_guide/) — **select SPA (Single Page Application) as the platform type**.
88
83
 
89
84
  <!-- No Installation [installation] -->
90
85
 
91
- ## 🆘 Having Issues?
92
-
93
- Start here — most problems are covered in the FAQ:
94
-
95
- - **[FAQ & Troubleshooting](./help/faq.md)**
96
- - Authentication issues → [Authentication FAQ](./help/faq.md#authentication-issues)
97
- - Configuration issues → [Configuration FAQ](./help/faq.md#configuration-issues)
98
- - MCP tool issues → [Tool FAQ](./help/faq.md#mcp-tool-issues)
99
-
100
- ### Token issues (expired or stuck)
101
-
102
- If authentication fails after it previously worked, delete cached token files and retry:
103
-
104
- ```bash
105
- # Search your home directory for both token files
106
- find ~ -name ".bearer_token*" 2>/dev/null
107
- # Remove both token files
108
- rm /path/to/.bearer_token*
109
- ```
110
-
111
86
  ## Debugging
112
87
 
113
88
  Use the MCP Inspector for interactive testing:
package/bin/mcp-server.js CHANGED
@@ -4046,9 +4046,9 @@ var init_config = __esm(() => {
4046
4046
  SDK_METADATA = {
4047
4047
  language: "typescript",
4048
4048
  openapiDocVersion: "1.0.0",
4049
- sdkVersion: "1.0.24",
4049
+ sdkVersion: "1.0.25",
4050
4050
  genVersion: "2.723.8",
4051
- userAgent: "speakeasy-sdk/mcp-typescript 1.0.24 2.723.8 1.0.0 @egain/egain-mcp-server"
4051
+ userAgent: "speakeasy-sdk/mcp-typescript 1.0.25 2.723.8 1.0.0 @egain/egain-mcp-server"
4052
4052
  };
4053
4053
  });
4054
4054
 
@@ -44798,24 +44798,13 @@ var init_acceptlanguage = __esm(() => {
44798
44798
  });
44799
44799
 
44800
44800
  // src/models/articletype.ts
44801
- var TypeName$zodSchema, ArticleType$zodSchema;
44801
+ var ArticleType$zodSchema;
44802
44802
  var init_articletype = __esm(() => {
44803
44803
  init_zod();
44804
- TypeName$zodSchema = enumType([
44805
- "General",
44806
- "Guided Help",
44807
- "Data Link",
44808
- "PDF Content",
44809
- "Topic Home",
44810
- "Suggestion",
44811
- "Virtual Assistant Action",
44812
- "Rich Message",
44813
- "Library Content"
44814
- ]).describe("Indicates the article category name.");
44815
44804
  ArticleType$zodSchema = objectType({
44816
44805
  articleCategoryId: numberType().int().optional(),
44817
44806
  articleTypeId: stringType().optional(),
44818
- typeName: TypeName$zodSchema.optional(),
44807
+ typeName: stringType().optional(),
44819
44808
  useStructuredAuthoring: booleanType().optional()
44820
44809
  }).describe("The type of the Article and its attributes.");
44821
44810
  });
@@ -45400,9 +45389,47 @@ var init_getAnnouncements2 = __esm(() => {
45400
45389
 
45401
45390
  Get Announcements
45402
45391
 
45392
+ ## How to Use This Tool
45393
+
45394
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
45395
+
45396
+ **Parameter Format**:
45397
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999"}}\`
45398
+ - Required parameter: \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45399
+ - Optional parameters:
45400
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
45401
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
45402
+ - \`dollarFilterTags\` (string) - Comma-separated list of Tag/Tag Group IDs
45403
+ - \`workflowMilestone\` (string) - Workflow milestone filter ("authoring", "staging", "publish")
45404
+ - \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
45405
+ - \`Dollar_pagesize\` (number, default: 10) - Number of results per page
45406
+
45407
+ **Example**: To get announcements from portal "PZ-9999", call with:
45408
+ \`\`\`json
45409
+ {"request": {"portalID": "PZ-9999"}}
45410
+ \`\`\`
45411
+
45412
+ **Example with optional parameters**:
45413
+ \`\`\`json
45414
+ {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
45415
+ \`\`\`
45416
+
45417
+ ## Displaying Results (MCP-Specific)
45418
+ **CRITICAL**: When this tool returns data successfully, you MUST display the announcement articles to the user in your response. Do not silently process the data - always show the user what was returned.
45419
+
45420
+ **What to display:**
45421
+ - Display all announcement articles with their names and IDs
45422
+ - Show the article content (\`content\` or \`contentText\`) for each announcement
45423
+ - Display metadata such as \`createdDate\`, \`modifiedDate\`, \`articleSummary\`
45424
+ - Show \`attachments\` if present
45425
+ - Include \`paginationInfo\` if pagination is used
45426
+ - Format announcements in a clear list format
45427
+
45428
+ **Example**: "Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]..."
45429
+
45403
45430
  ## Prerequisites
45404
45431
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
45405
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
45432
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
45406
45433
 
45407
45434
  ## Overview
45408
45435
  The Get Announcements API allows a user to retrieve all announcement articles for a specific portal. Announcements are special articles that are prominently displayed to users and typically contain important updates, news, or notifications.
@@ -45831,6 +45858,48 @@ var init_getArticle2 = __esm(() => {
45831
45858
 
45832
45859
  Get Article by ID
45833
45860
 
45861
+ ## How to Use This Tool
45862
+
45863
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
45864
+
45865
+ **Parameter Format**:
45866
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}\`
45867
+ - Required parameters:
45868
+ - \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45869
+ - \`articleID\` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PROD-2996")
45870
+ - Optional parameters:
45871
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
45872
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
45873
+ - \`articleAdditionalAttributes\` (array) - Additional article attributes to return
45874
+ - \`Dollar_customAdditionalAttributes\` (string) - Custom additional attributes
45875
+ - \`accessSource\` (string, default: "article_view") - How the article was accessed
45876
+ - \`publishViewId\` (string) - Publish view ID
45877
+ - \`workflowMilestone\` (string) - Workflow milestone filter
45878
+
45879
+ **Example**: To get article "PROD-2996" from portal "PZ-9999", call with:
45880
+ \`\`\`json
45881
+ {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}
45882
+ \`\`\`
45883
+
45884
+ **Example with optional parameters**:
45885
+ \`\`\`json
45886
+ {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996", "Dollar_lang": "en-US", "accessSource": "article_view"}}
45887
+ \`\`\`
45888
+
45889
+ ## Displaying Results (MCP-Specific)
45890
+ **CRITICAL**: When this tool returns data successfully, you MUST display the article content to the user in your response. Do not silently process the data - always show the user what was returned.
45891
+
45892
+ **What to display:**
45893
+ - Display the article \`name\` as the title
45894
+ - Show the article \`content\` or \`contentText\` (the full article body)
45895
+ - Display article metadata: \`id\`, \`articleType\`, \`createdDate\`, \`modifiedDate\`
45896
+ - Show \`attachments\` if present
45897
+ - Display \`topicBreadcrumb\` to show where the article is categorized
45898
+ - Include any other relevant metadata like \`articleSummary\`, \`description\`, \`articleKeywords\`
45899
+ - Format the article content in a readable way for the user
45900
+
45901
+ **Example**: "Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]..."
45902
+
45834
45903
  ## Prerequisites
45835
45904
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
45836
45905
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -45998,6 +46067,43 @@ var init_getPopularArticles2 = __esm(() => {
45998
46067
 
45999
46068
  Get Popular Articles
46000
46069
 
46070
+ ## How to Use This Tool
46071
+
46072
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
46073
+
46074
+ **Parameter Format**:
46075
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999"}}\`
46076
+ - Required parameter: \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
46077
+ - Optional parameters:
46078
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
46079
+ - \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
46080
+ - \`Dollar_pagesize\` (number, default: 10) - Number of results per page
46081
+ - \`dollarFilterTopicId\` (string) - Filter by topic ID
46082
+ - \`dollarFilterTags\` (string) - Comma-separated list of Tag/Tag Group IDs
46083
+
46084
+ **Example**: To get popular articles from portal "PZ-9999", call with:
46085
+ \`\`\`json
46086
+ {"request": {"portalID": "PZ-9999"}}
46087
+ \`\`\`
46088
+
46089
+ **Example with optional parameters**:
46090
+ \`\`\`json
46091
+ {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
46092
+ \`\`\`
46093
+
46094
+ ## Displaying Results (MCP-Specific)
46095
+ **CRITICAL**: When this tool returns data successfully, you MUST display the popular articles to the user in your response. Do not silently process the data - always show the user what was returned.
46096
+
46097
+ **What to display:**
46098
+ - Display all popular articles with their names and IDs
46099
+ - Show article summaries or descriptions when available
46100
+ - Display metadata such as \`articleType\`, \`createdDate\`, \`modifiedDate\`
46101
+ - Show \`imageURL\` if available (mention thumbnail availability)
46102
+ - Include \`paginationInfo\` if pagination is used
46103
+ - Format articles in a numbered or bulleted list
46104
+
46105
+ **Example**: "Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]..."
46106
+
46001
46107
  ## Prerequisites
46002
46108
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
46003
46109
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -46077,56 +46183,6 @@ var init_allaccessibleportals = __esm(() => {
46077
46183
  }).describe("Success");
46078
46184
  });
46079
46185
 
46080
- // src/models/mandatorylanguagequeryparameter.ts
46081
- var MandatoryLanguageQueryParameter$zodSchema;
46082
- var init_mandatorylanguagequeryparameter = __esm(() => {
46083
- init_zod();
46084
- MandatoryLanguageQueryParameter$zodSchema = enumType([
46085
- "en-US",
46086
- "fr-FR",
46087
- "en-GB",
46088
- "es-ES",
46089
- "it-IT",
46090
- "nl-NL",
46091
- "da-DA",
46092
- "sv-SE",
46093
- "pt-PT",
46094
- "fi-FI",
46095
- "no-NB",
46096
- "no-NN",
46097
- "ja-JA",
46098
- "de-DE",
46099
- "pt-BR",
46100
- "zh-CN",
46101
- "zh-TW",
46102
- "ko-KO",
46103
- "ru-RU",
46104
- "el-EL",
46105
- "tr-TR",
46106
- "pl-PL",
46107
- "cs-CS",
46108
- "sk-SK",
46109
- "hu-HU",
46110
- "sr-SR",
46111
- "ar-SA",
46112
- "hr-HR",
46113
- "ro-RO",
46114
- "th-TH",
46115
- "de-AT",
46116
- "vi-VN",
46117
- "id-ID",
46118
- "ms-MY",
46119
- "fil-PH",
46120
- "fr-CA",
46121
- "hi-IN",
46122
- "uk-UA",
46123
- "bg-BG",
46124
- "sl-SI",
46125
- "sr-RS",
46126
- "xx-XX"
46127
- ]).describe("The language used for fetching the details of a resource. Resources available in different languages may differ from each other. **Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.");
46128
- });
46129
-
46130
46186
  // src/models/order.ts
46131
46187
  var Order$zodSchema;
46132
46188
  var init_order = __esm(() => {
@@ -46154,12 +46210,12 @@ var init_getmyportalsop = __esm(() => {
46154
46210
  init_zod();
46155
46211
  init_acceptlanguage();
46156
46212
  init_allaccessibleportals();
46157
- init_mandatorylanguagequeryparameter();
46213
+ init_languagequeryparameter();
46158
46214
  init_order();
46159
46215
  init_sortidnamedepartment();
46160
46216
  init_wserrorcommon();
46161
46217
  GetMyPortalsRequest$zodSchema = objectType({
46162
- Dollar_lang: MandatoryLanguageQueryParameter$zodSchema,
46218
+ Dollar_lang: LanguageQueryParameter$zodSchema.default("en-US"),
46163
46219
  Dollar_order: Order$zodSchema.optional(),
46164
46220
  Dollar_pagenum: numberType().int().default(1).describe("Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize."),
46165
46221
  Dollar_pagesize: numberType().int().default(25).describe("Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.<br>Valid range of 5-75<br>_Default value_: 25"),
@@ -46183,7 +46239,7 @@ function getPortals(client$, request, options) {
46183
46239
  return new APIPromise($do4(client$, request, options));
46184
46240
  }
46185
46241
  async function $do4(client$, request, options) {
46186
- const parsed$ = safeParse(request, (value$) => GetMyPortalsRequest$zodSchema.parse(value$), "Input validation failed");
46242
+ const parsed$ = safeParse(request, (value$) => GetMyPortalsRequest$zodSchema.optional().parse(value$), "Input validation failed");
46187
46243
  if (!parsed$.ok) {
46188
46244
  return [parsed$, { status: "invalid" }];
46189
46245
  }
@@ -46191,18 +46247,18 @@ async function $do4(client$, request, options) {
46191
46247
  const body$ = null;
46192
46248
  const path$ = pathToFunc("/myportals")();
46193
46249
  const query$ = encodeFormQuery({
46194
- $lang: payload$.Dollar_lang,
46195
- $order: payload$.Dollar_order,
46196
- $pagenum: payload$.Dollar_pagenum,
46197
- $pagesize: payload$.Dollar_pagesize,
46198
- $sort: payload$.Dollar_sort,
46199
- department: payload$.department,
46200
- filterText: payload$.filterText,
46201
- shortUrlTemplate: payload$.shortUrlTemplate
46250
+ $lang: payload$?.Dollar_lang,
46251
+ $order: payload$?.Dollar_order,
46252
+ $pagenum: payload$?.Dollar_pagenum,
46253
+ $pagesize: payload$?.Dollar_pagesize,
46254
+ $sort: payload$?.Dollar_sort,
46255
+ department: payload$?.department,
46256
+ filterText: payload$?.filterText,
46257
+ shortUrlTemplate: payload$?.shortUrlTemplate
46202
46258
  });
46203
46259
  const headers$ = new Headers(compactMap({
46204
46260
  Accept: "application/json",
46205
- "Accept-Language": encodeSimple("Accept-Language", payload$.acceptLanguage, { explode: false, charEncoding: "none" })
46261
+ "Accept-Language": encodeSimple("Accept-Language", payload$?.acceptLanguage, { explode: false, charEncoding: "none" })
46206
46262
  }));
46207
46263
  const securityInput = await extractSecurity(client$._options.security);
46208
46264
  const requestSecurity = resolveGlobalSecurity(securityInput);
@@ -46275,7 +46331,7 @@ var init_getPortals2 = __esm(() => {
46275
46331
  init_getmyportalsop();
46276
46332
  init_tools();
46277
46333
  args4 = {
46278
- request: GetMyPortalsRequest$zodSchema
46334
+ request: GetMyPortalsRequest$zodSchema.optional()
46279
46335
  };
46280
46336
  tool$getPortals = {
46281
46337
  name: "get-portals",
@@ -46283,6 +46339,15 @@ var init_getPortals2 = __esm(() => {
46283
46339
 
46284
46340
  Get All Portals Accessible to User
46285
46341
 
46342
+ ## How to Use This Tool
46343
+
46344
+ **Parameter Format**: This tool requires a \`request\` parameter containing the request object.
46345
+ - **CRITICAL**: All parameters in this tool are optional. You may pass an empty request object: \`{"request": {}}\`
46346
+ - If you want to specify a language, pass: \`{"request": {"Dollar_lang": "en-US"}}\`
46347
+ - The \`Dollar_lang\` parameter is **optional** - if omitted, the API defaults to "en-US"
46348
+ - **Example with empty request** (recommended if you don't need to specify language): \`{"request": {}}\`
46349
+ - **Example with language**: \`{"request": {"Dollar_lang": "en-US"}}\`
46350
+
46286
46351
  ## Overview
46287
46352
  The Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.
46288
46353
  - If no access tags are specified for a portal, any user can access the portal.
@@ -46330,6 +46395,22 @@ If you search for "business portal" and the first page returns 25 portals but no
46330
46395
  - Search the complete merged list before concluding the portal doesn't exist
46331
46396
 
46332
46397
  This ensures reliable portal name-to-ID resolution and prevents false "not found" errors.
46398
+
46399
+ ## Displaying Results (MCP-Specific)
46400
+ **CRITICAL**: When this tool returns data successfully, you MUST display the portal information to the user in your response. Do not silently process the data - always show the user what was returned.
46401
+
46402
+ **What to display:**
46403
+ - Display all portals with their names and IDs
46404
+ - Show portal \`id\` (the portal ID needed for other API calls)
46405
+ - Display portal \`name\` (the human-readable portal name)
46406
+ - Show \`departmentName\` if available
46407
+ - Include \`shortURL\` if available
46408
+ - Display \`paginationInfo\` to show total count and current page
46409
+ - Format portals in a clear list format (e.g., "Portal Name (ID: PORTAL-123)")
46410
+
46411
+ **Example**: "Here are the available portals: 1) Business Portal (ID: PORTAL-123), 2) Customer Portal (ID: PORTAL-456)..."
46412
+
46413
+ **Important**: Always display portal IDs clearly, as users will need these IDs to call other tools.
46333
46414
  `,
46334
46415
  annotations: {
46335
46416
  destructiveHint: false,
@@ -46538,6 +46619,48 @@ var init_makeSuggestion2 = __esm(() => {
46538
46619
 
46539
46620
  Make a Suggestion
46540
46621
 
46622
+ ## How to Use This Tool
46623
+
46624
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
46625
+
46626
+ **Parameter Format**:
46627
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "CreateSuggestion": {...}}}\`
46628
+ - Required parameters:
46629
+ - \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
46630
+ - \`CreateSuggestion\` (object) - The suggestion object with:
46631
+ - \`name\` (string, **required**) - Name/title of the suggestion
46632
+ - \`content\` (string, **required**) - Content/description of the suggestion
46633
+ - \`language\` (object, **required**) - Language object with \`code\` property (e.g., {"code": "en-US"})
46634
+ - Optional parameters:
46635
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
46636
+ - \`CreateSuggestion\` additional optional fields:
46637
+ - \`description\` (string) - Additional description
46638
+ - \`feedbackArticle\` (object) - Article ID object if providing feedback on existing article: \`{"id": "PROD-2996"}\`
46639
+ - \`attachments\` (object) - Attachments object
46640
+ - \`customAttributes\` (array) - Custom attributes array
46641
+
46642
+ **Example**: To create a suggestion in portal "PZ-9999", call with:
46643
+ \`\`\`json
46644
+ {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "New Article Request", "content": "Please add information about loan rates", "language": {"code": "en-US"}}}}
46645
+ \`\`\`
46646
+
46647
+ **Example with feedback on existing article**:
46648
+ \`\`\`json
46649
+ {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "Article Feedback", "content": "This article needs updating", "language": {"code": "en-US"}, "feedbackArticle": {"id": "PROD-2996"}}}}
46650
+ \`\`\`
46651
+
46652
+ ## Displaying Results (MCP-Specific)
46653
+ **CRITICAL**: When this tool returns data successfully, you MUST display the suggestion creation result to the user in your response. Do not silently process the data - always show the user what was returned.
46654
+
46655
+ **What to display:**
46656
+ - Confirm that the suggestion was successfully created
46657
+ - Display the suggestion \`id\` if returned in the response
46658
+ - Show the suggestion \`name\` and \`content\` that was submitted
46659
+ - If an error occurs, display the error message clearly
46660
+ - Provide confirmation message to the user
46661
+
46662
+ **Example**: "Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]..."
46663
+
46541
46664
  ## Prerequisites
46542
46665
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
46543
46666
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -46885,18 +47008,54 @@ var init_queryAnswers2 = __esm(() => {
46885
47008
 
46886
47009
  Get Answers
46887
47010
 
47011
+ ## How to Use This Tool
47012
+
47013
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
47014
+
47015
+ **Parameter Format**:
47016
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}\`
47017
+ - Required parameters:
47018
+ - \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
47019
+ - \`q\` (string) - The search query string
47020
+ - \`Dollar_lang\` (string) - Language code (e.g., "en-US")
47021
+ - Optional parameters:
47022
+ - \`dollarFilterUserProfileID\` (string) - User profile ID filter
47023
+ - \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
47024
+ - \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
47025
+ - \`AnswersRequest\` (object) - Request body parameters:
47026
+ - \`eventId\` (string, **required**) - Event ID
47027
+ - \`sessionId\` (string, **required**) - Session ID
47028
+ - \`channel\` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.
47029
+ - \`context\` (object) - Additional context (companyContext, pageContext, userContext)
47030
+
47031
+ **Example**: To get answers for query "loan information" from portal "PZ-9999", call with:
47032
+ \`\`\`json
47033
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "AnswersRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
47034
+ \`\`\`
47035
+
47036
+ **Note**: The \`channel\` field in \`AnswersRequest\` is optional and recommended to omit unless specifically needed. The API works reliably without it.
47037
+
47038
+ ## Displaying Results (MCP-Specific)
47039
+ **CRITICAL**: When this tool returns data successfully, you MUST display the results to the user in your response. Do not silently process the data - always show the user what was returned.
47040
+
47041
+ **What to display:**
47042
+ - Display the \`answer.answerValue\` text prominently as the main answer to the user's query
47043
+ - Indicate the answer type (\`answerType\`: "certified" or "generative")
47044
+ - If \`relevanceScore\` is present, you may mention the confidence level
47045
+ - List all \`references\` (article IDs and names) that were used to generate the answer
47046
+ - Display \`searchResults\` showing related articles with their names, IDs, snippets, and relevance scores
47047
+ - Format the answer in a clear, readable way - this is the primary response the user is seeking
47048
+
47049
+ **Example**: "Based on the knowledge base, here's the answer: [answerValue]. This answer was generated using information from: [list references]. Related articles: [list search results]..."
47050
+
46888
47051
  ## Prerequisites
46889
47052
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
46890
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
47053
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
46891
47054
 
46892
47055
  ## Overview
46893
47056
  The Answers API enables users to get the best answer for a user query. This API can return certified answers or generative answers along with search results, providing users with comprehensive responses to their questions.
46894
47057
 
46895
47058
  The API leverages AI capabilities to provide intelligent answers based on the knowledge base content, making it easier for users to find the information they need quickly and accurately.
46896
-
46897
- ## Request Body Notes
46898
- - **channel field**: Optional. **Recommended to omit** unless specifically needed. The API works reliably without it. If you receive a 400 Bad Request error when including channel, retry the request without the channel field.
46899
- - **Required fields**: eventId and sessionId are required in the request body.
46900
47059
  `,
46901
47060
  annotations: {
46902
47061
  destructiveHint: false,
@@ -47107,9 +47266,49 @@ var init_queryRetrieve2 = __esm(() => {
47107
47266
 
47108
47267
  Retrieve Chunks
47109
47268
 
47269
+ ## How to Use This Tool
47270
+
47271
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
47272
+
47273
+ **Parameter Format**:
47274
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}\`
47275
+ - Required parameters:
47276
+ - \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
47277
+ - \`q\` (string) - The search query string
47278
+ - \`Dollar_lang\` (string) - Language code (e.g., "en-US")
47279
+ - Optional parameters:
47280
+ - \`dollarFilterUserProfileID\` (string) - User profile ID filter
47281
+ - \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
47282
+ - \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
47283
+ - \`RetrieveRequest\` (object) - Additional request body parameters:
47284
+ - \`channel\` (object) - Channel information (optional, recommended to omit)
47285
+ - \`eventId\` (string) - Event ID
47286
+ - \`sessionId\` (string) - Session ID
47287
+
47288
+ **Example**: To retrieve chunks for query "loan information" from portal "PZ-9999", call with:
47289
+ \`\`\`json
47290
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}
47291
+ \`\`\`
47292
+
47293
+ **Example with RetrieveRequest body**:
47294
+ \`\`\`json
47295
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "RetrieveRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
47296
+ \`\`\`
47297
+
47298
+ ## Displaying Results (MCP-Specific)
47299
+ **CRITICAL**: When this tool returns data successfully, you MUST display the results to the user in your response. Do not silently process the data - always show the user what was returned.
47300
+
47301
+ **What to display:**
47302
+ - If a certified answer is returned (\`answer\` object), display the \`answerValue\` text and list the \`references\` (article IDs and names)
47303
+ - Display all \`searchResults\` with their article names, IDs, snippets, and relevance scores (\`normalizedScore\`)
47304
+ - Show article metadata such as \`docType\`, \`source\`, and \`topicBreadcrumb\` when available
47305
+ - Format the results in a user-friendly way (e.g., numbered list, formatted text)
47306
+
47307
+ **Example**: "I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]..."
47308
+
47110
47309
  ## Prerequisites
47111
47310
  - **Requires a valid portal ID** (required parameter). If you don't have the portal ID, first call 'get-portals' to get available portals.
47112
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
47311
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
47113
47312
 
47114
47313
  ## Overview
47115
47314
  The Retrieve API enables enterprises to directly access relevant content chunks from their organizational knowledge sources. It is designed for scenarios where developers want granular control over retrieved information, such as powering custom search, analytics, or retrieval-augmented generation (RAG) pipelines.
@@ -47446,7 +47645,54 @@ var init_querySearch2 = __esm(() => {
47446
47645
  name: "query-search",
47447
47646
  description: `Hybrid Search
47448
47647
 
47449
- The Search API is a hybrid search service that combines semantic understanding with keyword precision to deliver fast, contextual, and relevant results from your enterprise knowledge base. It enables secure, role-aware access to articles, FAQs, and documentation across customer, agent, and employee interfaces. Each query returns a ranked list of results with snippets, metadata, and relevance scores. <br>**This endpoint is only available for Self Service environments.**
47648
+ Hybrid Search
47649
+
47650
+ ## How to Use This Tool
47651
+
47652
+ **CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
47653
+
47654
+ **Parameter Format**:
47655
+ - Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information"}}\`
47656
+ - Required parameters:
47657
+ - \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
47658
+ - \`q\` (string) - The search query string (must be URL-escaped)
47659
+ - Optional parameters:
47660
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
47661
+ - \`dollarFilterUserProfileID\` (string) - User profile ID filter
47662
+ - \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
47663
+ - \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
47664
+ - \`articleCustomAdditionalAttributes\` (string) - Comma-separated custom attribute names
47665
+ - \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
47666
+ - \`Dollar_pagesize\` (number, default: 20) - Number of results per page
47667
+
47668
+ **Example**: To search for "loan information" in portal "PZ-9999", call with:
47669
+ \`\`\`json
47670
+ {"request": {"portalID": "PZ-9999", "q": "loan information"}}
47671
+ \`\`\`
47672
+
47673
+ **Example with optional parameters**:
47674
+ \`\`\`json
47675
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "Dollar_pagesize": 25}}
47676
+ \`\`\`
47677
+
47678
+ **Note**: This endpoint is only available for Self Service environments.
47679
+
47680
+ ## Displaying Results (MCP-Specific)
47681
+ **CRITICAL**: When this tool returns data successfully, you MUST display the search results to the user in your response. Do not silently process the data - always show the user what was returned.
47682
+
47683
+ **What to display:**
47684
+ - Display all search results with article names and IDs
47685
+ - Show article \`snippet\` or \`keywordSnippet\` (the relevant text excerpt)
47686
+ - Display \`normalizedScore\` or \`relevanceScore\` to indicate relevance
47687
+ - Show \`docType\`, \`source\`, and \`topicBreadcrumb\` metadata
47688
+ - Display \`contextualSummary\` if available
47689
+ - Include \`paginationInfo\` if pagination is used
47690
+ - Format results in a numbered list with clear relevance indicators
47691
+
47692
+ **Example**: "I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)..."
47693
+
47694
+ ## Overview
47695
+ The Search API is a hybrid search service that combines semantic understanding with keyword precision to deliver fast, contextual, and relevant results from your enterprise knowledge base. It enables secure, role-aware access to articles, FAQs, and documentation across customer, agent, and employee interfaces. Each query returns a ranked list of results with snippets, metadata, and relevance scores.
47450
47696
  `,
47451
47697
  annotations: {
47452
47698
  destructiveHint: false,
@@ -47473,7 +47719,7 @@ The Search API is a hybrid search service that combines semantic understanding w
47473
47719
  function createMCPServer(deps) {
47474
47720
  const server = new McpServer({
47475
47721
  name: "EgainMcp",
47476
- version: "1.0.24"
47722
+ version: "1.0.25"
47477
47723
  });
47478
47724
  const getClient = deps.getSDK || (() => new EgainMcpCore({
47479
47725
  security: deps.security,
@@ -48720,7 +48966,7 @@ var routes = ln({
48720
48966
  var app = _e(routes, {
48721
48967
  name: "mcp",
48722
48968
  versionInfo: {
48723
- currentVersion: "1.0.24"
48969
+ currentVersion: "1.0.25"
48724
48970
  }
48725
48971
  });
48726
48972
  Yt(app, process3.argv.slice(2), buildContext(process3));
@@ -48728,5 +48974,5 @@ export {
48728
48974
  app
48729
48975
  };
48730
48976
 
48731
- //# debugId=BD1B9CC5744D3D7D64756E2164756E21
48977
+ //# debugId=96750509ECBCF97D64756E2164756E21
48732
48978
  //# sourceMappingURL=mcp-server.js.map