@egain/egain-mcp-server 1.0.20 → 1.0.22

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 (181) hide show
  1. package/bin/mcp-server.js +294 -114
  2. package/bin/mcp-server.js.map +40 -34
  3. package/esm/src/funcs/queryAnswers.d.ts +7 -3
  4. package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
  5. package/esm/src/funcs/queryAnswers.js +9 -7
  6. package/esm/src/funcs/queryAnswers.js.map +1 -1
  7. package/esm/src/funcs/queryRetrieve.d.ts +2 -2
  8. package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
  9. package/esm/src/funcs/queryRetrieve.js +4 -10
  10. package/esm/src/funcs/queryRetrieve.js.map +1 -1
  11. package/esm/src/funcs/querySearch.d.ts +3 -3
  12. package/esm/src/funcs/querySearch.d.ts.map +1 -1
  13. package/esm/src/funcs/querySearch.js +9 -3
  14. package/esm/src/funcs/querySearch.js.map +1 -1
  15. package/esm/src/hooks/server-routing-hook.js +2 -2
  16. package/esm/src/hooks/server-routing-hook.js.map +1 -1
  17. package/esm/src/lib/config.d.ts +2 -2
  18. package/esm/src/lib/config.js +2 -2
  19. package/esm/src/mcp-server/mcp-server.js +1 -1
  20. package/esm/src/mcp-server/server.js +4 -4
  21. package/esm/src/mcp-server/server.js.map +1 -1
  22. package/esm/src/mcp-server/tools/queryAnswers.d.ts +1 -1
  23. package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
  24. package/esm/src/mcp-server/tools/queryAnswers.js +7 -3
  25. package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
  26. package/esm/src/mcp-server/tools/queryRetrieve.d.ts +1 -1
  27. package/esm/src/mcp-server/tools/queryRetrieve.js +2 -2
  28. package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
  29. package/esm/src/mcp-server/tools/querySearch.js +1 -1
  30. package/esm/src/models/additionalsnippets.d.ts +2 -1
  31. package/esm/src/models/additionalsnippets.d.ts.map +1 -1
  32. package/esm/src/models/additionalsnippets.js +2 -1
  33. package/esm/src/models/additionalsnippets.js.map +1 -1
  34. package/esm/src/models/aisearchop.d.ts +8 -4
  35. package/esm/src/models/aisearchop.d.ts.map +1 -1
  36. package/esm/src/models/aisearchop.js +16 -6
  37. package/esm/src/models/aisearchop.js.map +1 -1
  38. package/esm/src/models/aisearchresponse.d.ts +16 -0
  39. package/esm/src/models/aisearchresponse.d.ts.map +1 -0
  40. package/esm/src/models/aisearchresponse.js +14 -0
  41. package/esm/src/models/aisearchresponse.js.map +1 -0
  42. package/esm/src/models/aispaginationinfo.d.ts +10 -0
  43. package/esm/src/models/aispaginationinfo.d.ts.map +1 -0
  44. package/esm/src/models/aispaginationinfo.js +12 -0
  45. package/esm/src/models/aispaginationinfo.js.map +1 -0
  46. package/esm/src/models/aitopicbreadcrumb.d.ts +10 -0
  47. package/esm/src/models/aitopicbreadcrumb.d.ts.map +1 -0
  48. package/esm/src/models/aitopicbreadcrumb.js +9 -0
  49. package/esm/src/models/aitopicbreadcrumb.js.map +1 -0
  50. package/esm/src/models/aitopicsummary.d.ts +10 -0
  51. package/esm/src/models/aitopicsummary.d.ts.map +1 -0
  52. package/esm/src/models/aitopicsummary.js +9 -0
  53. package/esm/src/models/aitopicsummary.js.map +1 -0
  54. package/esm/src/models/answersrequest.d.ts +22 -11
  55. package/esm/src/models/answersrequest.d.ts.map +1 -1
  56. package/esm/src/models/answersrequest.js +22 -10
  57. package/esm/src/models/answersrequest.js.map +1 -1
  58. package/esm/src/models/answersresponse.d.ts +3 -2
  59. package/esm/src/models/answersresponse.d.ts.map +1 -1
  60. package/esm/src/models/answersresponse.js +2 -1
  61. package/esm/src/models/answersresponse.js.map +1 -1
  62. package/esm/src/models/article.d.ts +1 -1
  63. package/esm/src/models/article.d.ts.map +1 -1
  64. package/esm/src/models/articleaisearchresult.d.ts +58 -0
  65. package/esm/src/models/articleaisearchresult.d.ts.map +1 -0
  66. package/esm/src/models/articleaisearchresult.js +63 -0
  67. package/esm/src/models/articleaisearchresult.js.map +1 -0
  68. package/esm/src/models/articletype.d.ts +1 -1
  69. package/esm/src/models/articletype.d.ts.map +1 -1
  70. package/esm/src/models/articletype.js +1 -0
  71. package/esm/src/models/articletype.js.map +1 -1
  72. package/esm/src/models/createsuggestion.d.ts +1 -1
  73. package/esm/src/models/createsuggestion.d.ts.map +1 -1
  74. package/esm/src/models/createsuggestion.js +13 -1
  75. package/esm/src/models/createsuggestion.js.map +1 -1
  76. package/esm/src/models/getbestanswerop.d.ts +24 -0
  77. package/esm/src/models/getbestanswerop.d.ts.map +1 -0
  78. package/esm/src/models/getbestanswerop.js +30 -0
  79. package/esm/src/models/getbestanswerop.js.map +1 -0
  80. package/esm/src/models/languagecodeparameter.d.ts +1 -1
  81. package/esm/src/models/languagecodeparameter.d.ts.map +1 -1
  82. package/esm/src/models/languagecodeparameter.js +11 -0
  83. package/esm/src/models/languagecodeparameter.js.map +1 -1
  84. package/esm/src/models/languagequeryparameter.d.ts +1 -1
  85. package/esm/src/models/languagequeryparameter.d.ts.map +1 -1
  86. package/esm/src/models/languagequeryparameter.js +11 -0
  87. package/esm/src/models/languagequeryparameter.js.map +1 -1
  88. package/esm/src/models/mandatorylanguagequeryparameter.d.ts +1 -1
  89. package/esm/src/models/mandatorylanguagequeryparameter.d.ts.map +1 -1
  90. package/esm/src/models/mandatorylanguagequeryparameter.js +12 -0
  91. package/esm/src/models/mandatorylanguagequeryparameter.js.map +1 -1
  92. package/esm/src/models/referenceresponse.d.ts +2 -2
  93. package/esm/src/models/referenceresponse.d.ts.map +1 -1
  94. package/esm/src/models/referenceresponse.js +2 -2
  95. package/esm/src/models/referenceresponse.js.map +1 -1
  96. package/esm/src/models/requiredlanguagecode.d.ts +7 -0
  97. package/esm/src/models/requiredlanguagecode.d.ts.map +1 -0
  98. package/esm/src/models/requiredlanguagecode.js +41 -0
  99. package/esm/src/models/requiredlanguagecode.js.map +1 -0
  100. package/esm/src/models/retrievechunksop.d.ts +24 -0
  101. package/esm/src/models/retrievechunksop.d.ts.map +1 -0
  102. package/esm/src/models/retrievechunksop.js +30 -0
  103. package/esm/src/models/retrievechunksop.js.map +1 -0
  104. package/esm/src/models/retrieverequest.d.ts +1 -0
  105. package/esm/src/models/retrieverequest.d.ts.map +1 -1
  106. package/esm/src/models/retrieverequest.js +1 -0
  107. package/esm/src/models/retrieverequest.js.map +1 -1
  108. package/esm/src/models/retrieveresponse.d.ts +2 -1
  109. package/esm/src/models/retrieveresponse.d.ts.map +1 -1
  110. package/esm/src/models/retrieveresponse.js +2 -1
  111. package/esm/src/models/retrieveresponse.js.map +1 -1
  112. package/esm/src/models/schemastags.d.ts +7 -0
  113. package/esm/src/models/schemastags.d.ts.map +1 -0
  114. package/esm/src/models/schemastags.js +9 -0
  115. package/esm/src/models/schemastags.js.map +1 -0
  116. package/esm/src/models/searchresult.d.ts +6 -4
  117. package/esm/src/models/searchresult.d.ts.map +1 -1
  118. package/esm/src/models/searchresult.js +7 -5
  119. package/esm/src/models/searchresult.js.map +1 -1
  120. package/esm/src/models/tags.d.ts +2 -2
  121. package/esm/src/models/tags.d.ts.map +1 -1
  122. package/esm/src/models/tags.js +2 -2
  123. package/esm/src/models/tags.js.map +1 -1
  124. package/esm/src/models/topicsummary.d.ts +2 -0
  125. package/esm/src/models/topicsummary.d.ts.map +1 -1
  126. package/esm/src/models/topicsummary.js +2 -0
  127. package/esm/src/models/topicsummary.js.map +1 -1
  128. package/esm/src/models/wserrorcommon.d.ts +1 -1
  129. package/esm/src/models/wserrorcommon.d.ts.map +1 -1
  130. package/esm/src/models/wserrorcommon.js +1 -1
  131. package/esm/src/models/wserrorcommon.js.map +1 -1
  132. package/manifest.json +12 -12
  133. package/package.json +1 -1
  134. package/src/funcs/queryAnswers.ts +20 -18
  135. package/src/funcs/queryRetrieve.ts +15 -21
  136. package/src/funcs/querySearch.ts +16 -9
  137. package/src/hooks/auth-pages/browser-error.html +282 -0
  138. package/src/hooks/auth-pages/config-page.html +490 -0
  139. package/src/hooks/img/accesstoken-tooltip.png +0 -0
  140. package/src/hooks/img/apidomain-tooltip.png +0 -0
  141. package/src/hooks/img/authurl-tooltip.png +0 -0
  142. package/src/hooks/img/clientid-tooltip.png +0 -0
  143. package/src/hooks/img/clientsecret-tooltip.png +0 -0
  144. package/src/hooks/img/env-tooltip.png +0 -0
  145. package/src/hooks/img/redirect-tooltip.png +0 -0
  146. package/src/hooks/img/scopeprefix-tooltip.png +0 -0
  147. package/src/hooks/server-routing-hook.ts +2 -2
  148. package/src/lib/config.ts +2 -2
  149. package/src/mcp-server/mcp-server.ts +1 -1
  150. package/src/mcp-server/server.ts +4 -4
  151. package/src/mcp-server/tools/queryAnswers.ts +7 -3
  152. package/src/mcp-server/tools/queryRetrieve.ts +2 -2
  153. package/src/mcp-server/tools/querySearch.ts +1 -1
  154. package/src/models/additionalsnippets.ts +4 -2
  155. package/src/models/aisearchop.ts +33 -9
  156. package/src/models/aisearchresponse.ts +42 -0
  157. package/src/models/aispaginationinfo.ts +24 -0
  158. package/src/models/aitopicbreadcrumb.ts +21 -0
  159. package/src/models/aitopicsummary.ts +24 -0
  160. package/src/models/answersrequest.ts +42 -23
  161. package/src/models/answersresponse.ts +5 -3
  162. package/src/models/article.ts +1 -1
  163. package/src/models/{articlesearchresult.ts → articleaisearchresult.ts} +39 -37
  164. package/src/models/articletype.ts +1 -0
  165. package/src/models/createsuggestion.ts +13 -1
  166. package/src/models/{postportalidanswersop.ts → getbestanswerop.ts} +19 -12
  167. package/src/models/languagecodeparameter.ts +11 -0
  168. package/src/models/languagequeryparameter.ts +11 -0
  169. package/src/models/mandatorylanguagequeryparameter.ts +12 -0
  170. package/src/models/referenceresponse.ts +5 -5
  171. package/src/models/requiredlanguagecode.ts +48 -0
  172. package/src/models/{postportalidretrieveop.ts → retrievechunksop.ts} +19 -15
  173. package/src/models/retrieverequest.ts +2 -0
  174. package/src/models/retrieveresponse.ts +4 -2
  175. package/src/models/schemastags.ts +19 -0
  176. package/src/models/searchresult.ts +13 -9
  177. package/src/models/tag.ts +12 -0
  178. package/src/models/tags.ts +3 -6
  179. package/src/models/topicsummary.ts +3 -0
  180. package/src/models/wserrorcommon.ts +2 -2
  181. package/src/models/searchresponse.ts +0 -34
@@ -2,8 +2,10 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  import * as z from "zod";
5
+ import { Link$zodSchema } from "./link.js";
5
6
  export const TopicSummary$zodSchema = z.object({
6
7
  id: z.string().optional(),
8
+ link: Link$zodSchema.optional(),
7
9
  name: z.string().optional(),
8
10
  }).describe("This schema contains the topic ID and name of the topics. This is used by TopicBreadcrumb.");
9
11
  //# sourceMappingURL=topicsummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"topicsummary.js","sourceRoot":"","sources":["../../../src/models/topicsummary.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAUzB,MAAM,CAAC,MAAM,sBAAsB,GAI/B,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC,QAAQ,CACT,4FAA4F,CAC7F,CAAC"}
1
+ {"version":3,"file":"topicsummary.js","sourceRoot":"","sources":["../../../src/models/topicsummary.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAQ,cAAc,EAAE,MAAM,WAAW,CAAC;AAWjD,MAAM,CAAC,MAAM,sBAAsB,GAI/B,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC,QAAQ,CACT,4FAA4F,CAC7F,CAAC"}
@@ -5,7 +5,7 @@ export type Detail = {
5
5
  };
6
6
  export declare const Detail$zodSchema: z.ZodType<Detail, z.ZodTypeDef, unknown>;
7
7
  /**
8
- * Error Schema
8
+ * Bad Request
9
9
  */
10
10
  export type WSErrorCommon = {
11
11
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"wserrorcommon.d.ts","sourceRoot":"","sources":["../../../src/models/wserrorcommon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAIlE,CAAC;AAEL;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,aAAa,EACb,CAAC,CAAC,UAAU,EACZ,OAAO,CAMkB,CAAC"}
1
+ {"version":3,"file":"wserrorcommon.d.ts","sourceRoot":"","sources":["../../../src/models/wserrorcommon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAIlE,CAAC;AAEL;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,aAAa,EACb,CAAC,CAAC,UAAU,EACZ,OAAO,CAMiB,CAAC"}
@@ -12,5 +12,5 @@ export const WSErrorCommon$zodSchema = z.object({
12
12
  details: z.array(z.lazy(() => Detail$zodSchema)).optional(),
13
13
  developerMessage: z.string(),
14
14
  userMessage: z.string().optional(),
15
- }).describe("Error Schema");
15
+ }).describe("Bad Request");
16
16
  //# sourceMappingURL=wserrorcommon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wserrorcommon.js","sourceRoot":"","sources":["../../../src/models/wserrorcommon.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,MAAM,CAAC,MAAM,gBAAgB,GAA6C,CAAC;KACxE,MAAM,CAAC;IACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAYL,MAAM,CAAC,MAAM,uBAAuB,GAIhC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"wserrorcommon.js","sourceRoot":"","sources":["../../../src/models/wserrorcommon.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,MAAM,CAAC,MAAM,gBAAgB,GAA6C,CAAC;KACxE,MAAM,CAAC;IACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAYL,MAAM,CAAC,MAAM,uBAAuB,GAIhC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"}
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dxt_version": "0.1",
3
3
  "name": "@egain/egain-mcp-server",
4
- "version": "1.0.20",
4
+ "version": "1.0.22",
5
5
  "description": "",
6
6
  "long_description": "eGain Portal, Retrieve, Search, Answers APIs: Enterprise knowledge APIs for managing portals, searching content, retrieving AI-powered answers, and accessing content chunks for custom integrations.",
7
7
  "author": {
@@ -26,6 +26,14 @@
26
26
  },
27
27
  "display_name": "@egain/egain Mcp Server",
28
28
  "tools": [
29
+ {
30
+ "name": "query-retrieve",
31
+ "description": "Retrieve Chunks\n\nRetrieve Chunks\n\n## Prerequisites\n- **Requires a valid portal ID** (required parameter). If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe 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.\n\nIn addition to raw chunk retrieval, the API can return **Certified Answers** if it meets the 'Certified Answer' threshold score. Responses include relevance scores, metadata, and references to maintain transparency and flexibility.\n\nBy leveraging the Retrieve API, organizations can build tailored experiences while retaining confidence in the source material.\n"
32
+ },
33
+ {
34
+ "name": "query-answers",
35
+ "description": "Generate an Answer\n\nGet Answers\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe 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.\n\nThe 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.\n\n## Request Body Notes\n- **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.\n- **Required fields**: eventId and sessionId are required in the request body.\n"
36
+ },
29
37
  {
30
38
  "name": "get-article",
31
39
  "description": "Get Article by ID\n\nGet Article by ID\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n- Requires a valid article ID. Article ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"PROD-2996\")\n\n## Overview\nThe Get Article by ID API allows a user to retrieve a specific article using its ID. Additional article attributes and contextual views can be specified in the query parameters.\n\nThis API returns structured authoring attributes of Issue, Environment, Cause and Confidence Level when the following conditions are met:\n- The \"Allow Structured Authoring\" setting is enabled at the partition/department level\n- The \"Use Structured Authoring\" flag is set on the article type\n"
@@ -42,21 +50,13 @@
42
50
  "name": "get-portals",
43
51
  "description": "Get All Portals Accessible To User\n\nGet All Portals Accessible to User\n\n## Overview\nThe Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.\n- If no access tags are specified for a portal, any user can access the portal.\n- If access tags are specified for a portal, users with a user profile that allows access can access the portal. For users with multiple user profiles, the user profile that allows access does not need to be the active user profile.\n- Global users (partition) cannot be assigned user profiles; their access is limited to portals without access restrictions.\n- The only articles returned are associated to an Article type when the parameter “Include in browse on portals” is set to \"Yes\".\n- When the \\`shortUrlTemplate\\` query parameter is provided, the API filters accessible portals according to the specified language and template name. A portal short URL specific to the \\`shortUrlTemplate\\` value is returned in the response when available. If there is no short URL for a language, the portal object returns an empty \\`shortURL\\` field.\n\n## Pagination behavior (CRITICAL for AI assistants)\n\n**IMPORTANT**: This endpoint is paginated. When searching for a portal by name or listing portals, you MUST automatically fetch ALL pages before concluding that a portal doesn't exist.\n\n### Automatic pagination is REQUIRED when:\n- User asks to find a portal by name (e.g., \"business portal\", \"Master portal\")\n- User requests to list or see all portals\n- You need to resolve a natural portal name to its ID\n\n### How to detect more pages exist:\nThe response includes \\`paginationInfo\\` with:\n- \\`count\\`: Total number of items across all pages\n- \\`pagenum\\`: Current page number\n- \\`pagesize\\`: Items per page (default: 25)\n\n**Check for more pages if ANY of these are true:**\n1. The number of portals returned equals \\`pagesize\\` (e.g., exactly 25 portals returned)\n2. \\`paginationInfo.count > (pagenum * pagesize)\\` - there are more items beyond this page\n3. The response includes a \\`link\\` array with a \\`next\\` relation\n\n### Required pagination workflow:\n1. Start with \\`$pagenum=1\\` and \\`$pagesize=25\\` (default)\n2. After receiving the response, check \\`paginationInfo\\`\n3. **If more pages exist** (using the checks above), automatically call this endpoint again with \\`$pagenum=2\\`, then \\`$pagenum=3\\`, etc.\n4. Continue incrementing \\`$pagenum\\` until:\n - A page returns fewer portals than \\`pagesize\\` (indicating the last page)\n - A page returns zero portals\n - \\`pagenum * pagesize >= paginationInfo.count\\` (if count represents total items)\n5. Merge all portals from all pages by unique portal ID\n6. Only then search through the complete merged list or report results to the user\n\n### Example scenario:\nIf you search for \"business portal\" and the first page returns 25 portals but none match:\n- DO NOT immediately tell the user the portal doesn't exist\n- Check \\`paginationInfo.count\\` - if it's > 25, automatically fetch page 2\n- Continue fetching until all pages are retrieved\n- Search the complete merged list before concluding the portal doesn't exist\n\nThis ensures reliable portal name-to-ID resolution and prevents false \"not found\" errors.\n"
44
52
  },
45
- {
46
- "name": "make-suggestion",
47
- "description": "Make a Suggestion\n\nMake a Suggestion\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe Make a Suggestion API allows users to create an Article Suggestion from within a knowledge portal. This enables users to submit feedback, request new articles, or suggest improvements to existing content.\n\nUsers can submit suggestions with details about what they're looking for, which helps content creators understand user needs and improve the knowledge base.\n"
48
- },
49
- {
50
- "name": "query-answers",
51
- "description": "Get the best answer for a user query\n\nGet Answers\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe 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.\n\nThe 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.\n"
52
- },
53
53
  {
54
54
  "name": "query-search",
55
- "description": "Get the best search results for a user query\n\nThe 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.**\n"
55
+ "description": "Hybrid Search\n\nThe 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.**\n"
56
56
  },
57
57
  {
58
- "name": "query-retrieve",
59
- "description": "Retrieve Chunks\n\nRetrieve Chunks\n\n## Prerequisites\n- **Requires a valid portal ID** (required parameter). If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe 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.\n\nIn addition to raw chunk retrieval, the API can return **Certified Answers** if it meets the 'Certified Answer' threshold score. Responses include relevance scores, metadata, and references to maintain transparency and flexibility.\n\nBy leveraging the Retrieve API, organizations can build tailored experiences while retaining confidence in the source material.\n"
58
+ "name": "make-suggestion",
59
+ "description": "Make a Suggestion\n\nMake a Suggestion\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe Make a Suggestion API allows users to create an Article Suggestion from within a knowledge portal. This enables users to submit feedback, request new articles, or suggest improvements to existing content.\n\nUsers can submit suggestions with details about what they're looking for, which helps content creators understand user needs and improve the knowledge base.\n"
60
60
  }
61
61
  ],
62
62
  "prompts": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egain/egain-mcp-server",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "author": "Emily Loh - eGain Corporation",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -20,16 +20,16 @@ import {
20
20
  } from "../models/errors/httpclienterrors.js";
21
21
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
22
  import {
23
- PostPortalIDAnswersRequest,
24
- PostPortalIDAnswersRequest$zodSchema,
25
- PostPortalIDAnswersResponse,
26
- PostPortalIDAnswersResponse$zodSchema,
27
- } from "../models/postportalidanswersop.js";
23
+ GetBestAnswerRequest,
24
+ GetBestAnswerRequest$zodSchema,
25
+ GetBestAnswerResponse,
26
+ GetBestAnswerResponse$zodSchema,
27
+ } from "../models/getbestanswerop.js";
28
28
  import { APICall, APIPromise } from "../types/async.js";
29
29
  import { Result } from "../types/fp.js";
30
30
 
31
31
  /**
32
- * Get the best answer for a user query
32
+ * Generate an Answer
33
33
  *
34
34
  * @remarks
35
35
  * Get Answers
@@ -42,14 +42,18 @@ import { Result } from "../types/fp.js";
42
42
  * 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.
43
43
  *
44
44
  * 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.
45
+ *
46
+ * ## Request Body Notes
47
+ * - **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.
48
+ * - **Required fields**: eventId and sessionId are required in the request body.
45
49
  */
46
50
  export function queryAnswers(
47
51
  client$: EgainMcpCore,
48
- request: PostPortalIDAnswersRequest,
52
+ request: GetBestAnswerRequest,
49
53
  options?: RequestOptions,
50
54
  ): APIPromise<
51
55
  Result<
52
- PostPortalIDAnswersResponse,
56
+ GetBestAnswerResponse,
53
57
  | APIError
54
58
  | SDKValidationError
55
59
  | UnexpectedClientError
@@ -68,12 +72,12 @@ export function queryAnswers(
68
72
 
69
73
  async function $do(
70
74
  client$: EgainMcpCore,
71
- request: PostPortalIDAnswersRequest,
75
+ request: GetBestAnswerRequest,
72
76
  options?: RequestOptions,
73
77
  ): Promise<
74
78
  [
75
79
  Result<
76
- PostPortalIDAnswersResponse,
80
+ GetBestAnswerResponse,
77
81
  | APIError
78
82
  | SDKValidationError
79
83
  | UnexpectedClientError
@@ -87,7 +91,7 @@ async function $do(
87
91
  > {
88
92
  const parsed$ = safeParse(
89
93
  request,
90
- (value$) => PostPortalIDAnswersRequest$zodSchema.parse(value$),
94
+ (value$) => GetBestAnswerRequest$zodSchema.parse(value$),
91
95
  "Input validation failed",
92
96
  );
93
97
  if (!parsed$.ok) {
@@ -123,7 +127,7 @@ async function $do(
123
127
  const context = {
124
128
  options: client$._options,
125
129
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
126
- operationID: "post_/{portalID}/answers",
130
+ operationID: "getBestAnswer",
127
131
  oAuth2Scopes: null,
128
132
  resolvedSecurity: requestSecurity,
129
133
  securitySource: client$._options.security,
@@ -171,7 +175,7 @@ async function $do(
171
175
  };
172
176
 
173
177
  const [result$] = await M.match<
174
- PostPortalIDAnswersResponse,
178
+ GetBestAnswerResponse,
175
179
  | APIError
176
180
  | SDKValidationError
177
181
  | UnexpectedClientError
@@ -180,11 +184,9 @@ async function $do(
180
184
  | RequestTimeoutError
181
185
  | ConnectionError
182
186
  >(
183
- M.json(200, PostPortalIDAnswersResponse$zodSchema, {
184
- key: "AnswersResponse",
185
- }),
186
- M.nil(400, PostPortalIDAnswersResponse$zodSchema),
187
- M.nil(500, PostPortalIDAnswersResponse$zodSchema),
187
+ M.json(200, GetBestAnswerResponse$zodSchema, { key: "AnswersResponse" }),
188
+ M.nil(400, GetBestAnswerResponse$zodSchema),
189
+ M.nil(500, GetBestAnswerResponse$zodSchema),
188
190
  )(response, req$, { extraFields: responseFields$ });
189
191
 
190
192
  return [result$, { status: "complete", request: req$, response }];
@@ -20,11 +20,11 @@ import {
20
20
  } from "../models/errors/httpclienterrors.js";
21
21
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
22
  import {
23
- PostPortalIDRetrieveRequest,
24
- PostPortalIDRetrieveRequest$zodSchema,
25
- PostPortalIDRetrieveResponse,
26
- PostPortalIDRetrieveResponse$zodSchema,
27
- } from "../models/postportalidretrieveop.js";
23
+ RetrieveChunksRequest,
24
+ RetrieveChunksRequest$zodSchema,
25
+ RetrieveChunksResponse,
26
+ RetrieveChunksResponse$zodSchema,
27
+ } from "../models/retrievechunksop.js";
28
28
  import { APICall, APIPromise } from "../types/async.js";
29
29
  import { Result } from "../types/fp.js";
30
30
 
@@ -47,11 +47,11 @@ import { Result } from "../types/fp.js";
47
47
  */
48
48
  export function queryRetrieve(
49
49
  client$: EgainMcpCore,
50
- request: PostPortalIDRetrieveRequest,
50
+ request: RetrieveChunksRequest,
51
51
  options?: RequestOptions,
52
52
  ): APIPromise<
53
53
  Result<
54
- PostPortalIDRetrieveResponse,
54
+ RetrieveChunksResponse,
55
55
  | APIError
56
56
  | SDKValidationError
57
57
  | UnexpectedClientError
@@ -70,12 +70,12 @@ export function queryRetrieve(
70
70
 
71
71
  async function $do(
72
72
  client$: EgainMcpCore,
73
- request: PostPortalIDRetrieveRequest,
73
+ request: RetrieveChunksRequest,
74
74
  options?: RequestOptions,
75
75
  ): Promise<
76
76
  [
77
77
  Result<
78
- PostPortalIDRetrieveResponse,
78
+ RetrieveChunksResponse,
79
79
  | APIError
80
80
  | SDKValidationError
81
81
  | UnexpectedClientError
@@ -89,7 +89,7 @@ async function $do(
89
89
  > {
90
90
  const parsed$ = safeParse(
91
91
  request,
92
- (value$) => PostPortalIDRetrieveRequest$zodSchema.parse(value$),
92
+ (value$) => RetrieveChunksRequest$zodSchema.parse(value$),
93
93
  "Input validation failed",
94
94
  );
95
95
  if (!parsed$.ok) {
@@ -125,7 +125,7 @@ async function $do(
125
125
  const context = {
126
126
  options: client$._options,
127
127
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
128
- operationID: "post_/{portalID}/retrieve",
128
+ operationID: "retrieveChunks",
129
129
  oAuth2Scopes: null,
130
130
  resolvedSecurity: requestSecurity,
131
131
  securitySource: client$._options.security,
@@ -173,7 +173,7 @@ async function $do(
173
173
  };
174
174
 
175
175
  const [result$] = await M.match<
176
- PostPortalIDRetrieveResponse,
176
+ RetrieveChunksResponse,
177
177
  | APIError
178
178
  | SDKValidationError
179
179
  | UnexpectedClientError
@@ -182,15 +182,9 @@ async function $do(
182
182
  | RequestTimeoutError
183
183
  | ConnectionError
184
184
  >(
185
- M.json(200, PostPortalIDRetrieveResponse$zodSchema, {
186
- key: "RetrieveResponse",
187
- }),
188
- M.json(400, PostPortalIDRetrieveResponse$zodSchema, {
189
- key: "WSErrorCommon",
190
- }),
191
- M.json(500, PostPortalIDRetrieveResponse$zodSchema, {
192
- key: "WSErrorCommon",
193
- }),
185
+ M.json(200, RetrieveChunksResponse$zodSchema, { key: "RetrieveResponse" }),
186
+ M.nil(400, RetrieveChunksResponse$zodSchema),
187
+ M.nil(500, RetrieveChunksResponse$zodSchema),
194
188
  )(response, req$, { extraFields: responseFields$ });
195
189
 
196
190
  return [result$, { status: "complete", request: req$, response }];
@@ -13,8 +13,8 @@ import { pathToFunc } from "../lib/url.js";
13
13
  import {
14
14
  AiSearchRequest,
15
15
  AiSearchRequest$zodSchema,
16
- AiSearchResponse,
17
- AiSearchResponse$zodSchema,
16
+ AiSearchResponseResponse,
17
+ AiSearchResponseResponse$zodSchema,
18
18
  } from "../models/aisearchop.js";
19
19
  import { APIError } from "../models/errors/apierror.js";
20
20
  import {
@@ -29,7 +29,7 @@ import { APICall, APIPromise } from "../types/async.js";
29
29
  import { Result } from "../types/fp.js";
30
30
 
31
31
  /**
32
- * Get the best search results for a user query
32
+ * Hybrid Search
33
33
  *
34
34
  * @remarks
35
35
  * 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.**
@@ -40,7 +40,7 @@ export function querySearch(
40
40
  options?: RequestOptions,
41
41
  ): APIPromise<
42
42
  Result<
43
- AiSearchResponse,
43
+ AiSearchResponseResponse,
44
44
  | APIError
45
45
  | SDKValidationError
46
46
  | UnexpectedClientError
@@ -64,7 +64,7 @@ async function $do(
64
64
  ): Promise<
65
65
  [
66
66
  Result<
67
- AiSearchResponse,
67
+ AiSearchResponseResponse,
68
68
  | APIError
69
69
  | SDKValidationError
70
70
  | UnexpectedClientError
@@ -101,6 +101,8 @@ async function $do(
101
101
  "$filter[topicIds]": payload$.dollarFilterTopicIds,
102
102
  "$filter[userProfileID]": payload$.dollarFilterUserProfileID,
103
103
  "$lang": payload$.Dollar_lang,
104
+ "$pagenum": payload$.Dollar_pagenum,
105
+ "$pagesize": payload$.Dollar_pagesize,
104
106
  "articleCustomAdditionalAttributes":
105
107
  payload$.articleCustomAdditionalAttributes,
106
108
  "q": payload$.q,
@@ -163,7 +165,7 @@ async function $do(
163
165
  };
164
166
 
165
167
  const [result$] = await M.match<
166
- AiSearchResponse,
168
+ AiSearchResponseResponse,
167
169
  | APIError
168
170
  | SDKValidationError
169
171
  | UnexpectedClientError
@@ -172,9 +174,14 @@ async function $do(
172
174
  | RequestTimeoutError
173
175
  | ConnectionError
174
176
  >(
175
- M.json(200, AiSearchResponse$zodSchema, { key: "SearchResponse" }),
176
- M.nil(400, AiSearchResponse$zodSchema),
177
- M.nil(500, AiSearchResponse$zodSchema),
177
+ M.json(200, AiSearchResponseResponse$zodSchema, {
178
+ key: "AISearchResponse",
179
+ }),
180
+ M.nil(204, AiSearchResponseResponse$zodSchema),
181
+ M.json([400, 401, 403, 404, 406], AiSearchResponseResponse$zodSchema, {
182
+ key: "WSErrorCommon",
183
+ }),
184
+ M.json(500, AiSearchResponseResponse$zodSchema, { key: "WSErrorCommon" }),
178
185
  )(response, req$, { extraFields: responseFields$ });
179
186
 
180
187
  return [result$, { status: "complete", request: req$, response }];