@egain/egain-mcp-server 1.0.26 → 1.1.0

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 (574) hide show
  1. package/README.md +20 -43
  2. package/bin/mcp-server.js +39534 -29516
  3. package/bin/mcp-server.js.map +298 -185
  4. package/esm/src/cloudflare-worker/cloudflare-worker.d.ts.map +1 -1
  5. package/esm/src/cloudflare-worker/cloudflare-worker.js +20 -9
  6. package/esm/src/cloudflare-worker/cloudflare-worker.js.map +1 -1
  7. package/esm/src/funcs/aiSearch.d.ts +63 -0
  8. package/esm/src/funcs/aiSearch.d.ts.map +1 -0
  9. package/esm/src/funcs/aiSearch.js +151 -0
  10. package/esm/src/funcs/aiSearch.js.map +1 -0
  11. package/esm/src/funcs/getAnnouncementArticles.d.ts +61 -0
  12. package/esm/src/funcs/getAnnouncementArticles.d.ts.map +1 -0
  13. package/esm/src/funcs/getAnnouncementArticles.js +152 -0
  14. package/esm/src/funcs/getAnnouncementArticles.js.map +1 -0
  15. package/esm/src/funcs/getAnnouncements.d.ts +39 -1
  16. package/esm/src/funcs/getAnnouncements.d.ts.map +1 -1
  17. package/esm/src/funcs/getAnnouncements.js +39 -1
  18. package/esm/src/funcs/getAnnouncements.js.map +1 -1
  19. package/esm/src/funcs/getArticle.d.ts +42 -0
  20. package/esm/src/funcs/getArticle.d.ts.map +1 -1
  21. package/esm/src/funcs/getArticle.js +42 -0
  22. package/esm/src/funcs/getArticle.js.map +1 -1
  23. package/esm/src/funcs/getArticleById.d.ts +70 -0
  24. package/esm/src/funcs/getArticleById.d.ts.map +1 -0
  25. package/esm/src/funcs/getArticleById.js +163 -0
  26. package/esm/src/funcs/getArticleById.js.map +1 -0
  27. package/esm/src/funcs/getBestAnswer.d.ts +66 -0
  28. package/esm/src/funcs/getBestAnswer.d.ts.map +1 -0
  29. package/esm/src/funcs/getBestAnswer.js +148 -0
  30. package/esm/src/funcs/getBestAnswer.js.map +1 -0
  31. package/esm/src/funcs/getMyPortals.d.ts +97 -0
  32. package/esm/src/funcs/getMyPortals.d.ts.map +1 -0
  33. package/esm/src/funcs/getMyPortals.js +180 -0
  34. package/esm/src/funcs/getMyPortals.js.map +1 -0
  35. package/esm/src/funcs/getPopularArticles.d.ts +39 -0
  36. package/esm/src/funcs/getPopularArticles.d.ts.map +1 -1
  37. package/esm/src/funcs/getPopularArticles.js +47 -3
  38. package/esm/src/funcs/getPopularArticles.js.map +1 -1
  39. package/esm/src/funcs/getPortals.d.ts +26 -1
  40. package/esm/src/funcs/getPortals.d.ts.map +1 -1
  41. package/esm/src/funcs/getPortals.js +35 -10
  42. package/esm/src/funcs/getPortals.js.map +1 -1
  43. package/esm/src/funcs/makeSuggestion.d.ts +46 -2
  44. package/esm/src/funcs/makeSuggestion.d.ts.map +1 -1
  45. package/esm/src/funcs/makeSuggestion.js +51 -3
  46. package/esm/src/funcs/makeSuggestion.js.map +1 -1
  47. package/esm/src/funcs/queryAnswers.d.ts +41 -5
  48. package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
  49. package/esm/src/funcs/queryAnswers.js +41 -5
  50. package/esm/src/funcs/queryAnswers.js.map +1 -1
  51. package/esm/src/funcs/queryRetrieve.d.ts +41 -1
  52. package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
  53. package/esm/src/funcs/queryRetrieve.js +41 -1
  54. package/esm/src/funcs/queryRetrieve.js.map +1 -1
  55. package/esm/src/funcs/querySearch.d.ts +48 -1
  56. package/esm/src/funcs/querySearch.d.ts.map +1 -1
  57. package/esm/src/funcs/querySearch.js +48 -1
  58. package/esm/src/funcs/querySearch.js.map +1 -1
  59. package/esm/src/funcs/retrieveChunks.d.ts +41 -7
  60. package/esm/src/funcs/retrieveChunks.d.ts.map +1 -1
  61. package/esm/src/funcs/retrieveChunks.js +45 -19
  62. package/esm/src/funcs/retrieveChunks.js.map +1 -1
  63. package/esm/src/hooks/auth-hook.d.ts +1 -2
  64. package/esm/src/hooks/auth-hook.d.ts.map +1 -1
  65. package/esm/src/hooks/auth-hook.js +1 -65
  66. package/esm/src/hooks/auth-hook.js.map +1 -1
  67. package/esm/src/hooks/registration.d.ts.map +1 -1
  68. package/esm/src/hooks/registration.js +2 -16
  69. package/esm/src/hooks/registration.js.map +1 -1
  70. package/esm/src/landing-page.d.ts +5 -0
  71. package/esm/src/landing-page.d.ts.map +1 -0
  72. package/esm/src/landing-page.js +1070 -0
  73. package/esm/src/landing-page.js.map +1 -0
  74. package/esm/src/lib/base64.d.ts +2 -2
  75. package/esm/src/lib/base64.d.ts.map +1 -1
  76. package/esm/src/lib/base64.js +2 -2
  77. package/esm/src/lib/base64.js.map +1 -1
  78. package/esm/src/lib/config.d.ts +3 -3
  79. package/esm/src/lib/config.js +5 -5
  80. package/esm/src/lib/config.js.map +1 -1
  81. package/esm/src/lib/encodings.d.ts.map +1 -1
  82. package/esm/src/lib/encodings.js +10 -1
  83. package/esm/src/lib/encodings.js.map +1 -1
  84. package/esm/src/lib/matchers.d.ts.map +1 -1
  85. package/esm/src/lib/matchers.js +4 -1
  86. package/esm/src/lib/matchers.js.map +1 -1
  87. package/esm/src/lib/schemas.d.ts +4 -4
  88. package/esm/src/lib/schemas.d.ts.map +1 -1
  89. package/esm/src/lib/schemas.js +2 -2
  90. package/esm/src/lib/schemas.js.map +1 -1
  91. package/esm/src/lib/sdks.js +2 -2
  92. package/esm/src/lib/sdks.js.map +1 -1
  93. package/esm/src/lib/security.d.ts.map +1 -1
  94. package/esm/src/lib/security.js +18 -0
  95. package/esm/src/lib/security.js.map +1 -1
  96. package/esm/src/mcp-server/cli/start/command.d.ts.map +1 -1
  97. package/esm/src/mcp-server/cli/start/command.js +30 -0
  98. package/esm/src/mcp-server/cli/start/command.js.map +1 -1
  99. package/esm/src/mcp-server/cli/start/impl.d.ts +2 -7
  100. package/esm/src/mcp-server/cli/start/impl.d.ts.map +1 -1
  101. package/esm/src/mcp-server/cli/start/impl.js +98 -22
  102. package/esm/src/mcp-server/cli/start/impl.js.map +1 -1
  103. package/esm/src/mcp-server/extensions.d.ts +4 -4
  104. package/esm/src/mcp-server/extensions.d.ts.map +1 -1
  105. package/esm/src/mcp-server/flags.d.ts +17 -0
  106. package/esm/src/mcp-server/flags.d.ts.map +1 -0
  107. package/esm/src/mcp-server/flags.js +5 -0
  108. package/esm/src/mcp-server/flags.js.map +1 -0
  109. package/esm/src/mcp-server/mcp-server.js +1 -1
  110. package/esm/src/mcp-server/mcp-server.js.map +1 -1
  111. package/esm/src/mcp-server/prompts.d.ts +4 -7
  112. package/esm/src/mcp-server/prompts.d.ts.map +1 -1
  113. package/esm/src/mcp-server/prompts.js.map +1 -1
  114. package/esm/src/mcp-server/server.d.ts +8 -1
  115. package/esm/src/mcp-server/server.d.ts.map +1 -1
  116. package/esm/src/mcp-server/server.js +19 -16
  117. package/esm/src/mcp-server/server.js.map +1 -1
  118. package/esm/src/mcp-server/tools/aiSearch.d.ts +7 -0
  119. package/esm/src/mcp-server/tools/aiSearch.d.ts.map +1 -0
  120. package/esm/src/mcp-server/tools/aiSearch.js +83 -0
  121. package/esm/src/mcp-server/tools/aiSearch.js.map +1 -0
  122. package/esm/src/mcp-server/tools/getAnnouncementArticles.d.ts +7 -0
  123. package/esm/src/mcp-server/tools/getAnnouncementArticles.d.ts.map +1 -0
  124. package/esm/src/mcp-server/tools/getAnnouncementArticles.js +81 -0
  125. package/esm/src/mcp-server/tools/getAnnouncementArticles.js.map +1 -0
  126. package/esm/src/mcp-server/tools/getAnnouncements.d.ts.map +1 -1
  127. package/esm/src/mcp-server/tools/getAnnouncements.js +39 -1
  128. package/esm/src/mcp-server/tools/getAnnouncements.js.map +1 -1
  129. package/esm/src/mcp-server/tools/getArticle.d.ts.map +1 -1
  130. package/esm/src/mcp-server/tools/getArticle.js +42 -0
  131. package/esm/src/mcp-server/tools/getArticle.js.map +1 -1
  132. package/esm/src/mcp-server/tools/getArticleById.d.ts +7 -0
  133. package/esm/src/mcp-server/tools/getArticleById.d.ts.map +1 -0
  134. package/esm/src/mcp-server/tools/getArticleById.js +90 -0
  135. package/esm/src/mcp-server/tools/getArticleById.js.map +1 -0
  136. package/esm/src/mcp-server/tools/getBestAnswer.d.ts +7 -0
  137. package/esm/src/mcp-server/tools/getBestAnswer.d.ts.map +1 -0
  138. package/esm/src/mcp-server/tools/getBestAnswer.js +85 -0
  139. package/esm/src/mcp-server/tools/getBestAnswer.js.map +1 -0
  140. package/esm/src/mcp-server/tools/getMyPortals.d.ts +7 -0
  141. package/esm/src/mcp-server/tools/getMyPortals.d.ts.map +1 -0
  142. package/esm/src/mcp-server/tools/getMyPortals.js +117 -0
  143. package/esm/src/mcp-server/tools/getMyPortals.js.map +1 -0
  144. package/esm/src/mcp-server/tools/getPopularArticles.d.ts +1 -1
  145. package/esm/src/mcp-server/tools/getPopularArticles.d.ts.map +1 -1
  146. package/esm/src/mcp-server/tools/getPopularArticles.js +40 -0
  147. package/esm/src/mcp-server/tools/getPopularArticles.js.map +1 -1
  148. package/esm/src/mcp-server/tools/getPortals.d.ts +1 -1
  149. package/esm/src/mcp-server/tools/getPortals.d.ts.map +1 -1
  150. package/esm/src/mcp-server/tools/getPortals.js +26 -1
  151. package/esm/src/mcp-server/tools/getPortals.js.map +1 -1
  152. package/esm/src/mcp-server/tools/makeSuggestion.d.ts +1 -1
  153. package/esm/src/mcp-server/tools/makeSuggestion.d.ts.map +1 -1
  154. package/esm/src/mcp-server/tools/makeSuggestion.js +44 -0
  155. package/esm/src/mcp-server/tools/makeSuggestion.js.map +1 -1
  156. package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
  157. package/esm/src/mcp-server/tools/queryAnswers.js +41 -5
  158. package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
  159. package/esm/src/mcp-server/tools/queryRetrieve.d.ts.map +1 -1
  160. package/esm/src/mcp-server/tools/queryRetrieve.js +41 -1
  161. package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
  162. package/esm/src/mcp-server/tools/querySearch.d.ts.map +1 -1
  163. package/esm/src/mcp-server/tools/querySearch.js +48 -1
  164. package/esm/src/mcp-server/tools/querySearch.js.map +1 -1
  165. package/esm/src/mcp-server/tools/retrieveChunks.d.ts +1 -1
  166. package/esm/src/mcp-server/tools/retrieveChunks.d.ts.map +1 -1
  167. package/esm/src/mcp-server/tools/retrieveChunks.js +41 -7
  168. package/esm/src/mcp-server/tools/retrieveChunks.js.map +1 -1
  169. package/esm/src/mcp-server/tools.d.ts +14 -4
  170. package/esm/src/mcp-server/tools.d.ts.map +1 -1
  171. package/esm/src/mcp-server/tools.js +203 -5
  172. package/esm/src/mcp-server/tools.js.map +1 -1
  173. package/esm/src/models/acceptlanguage.d.ts +36 -5
  174. package/esm/src/models/acceptlanguage.d.ts.map +1 -1
  175. package/esm/src/models/acceptlanguage.js +18 -4
  176. package/esm/src/models/acceptlanguage.js.map +1 -1
  177. package/esm/src/models/accessibleportal.d.ts +1 -1
  178. package/esm/src/models/accessibleportal.d.ts.map +1 -1
  179. package/esm/src/models/accessibleportal.js.map +1 -1
  180. package/esm/src/models/additionalsnippets.d.ts +18 -3
  181. package/esm/src/models/additionalsnippets.d.ts.map +1 -1
  182. package/esm/src/models/additionalsnippets.js +8 -1
  183. package/esm/src/models/additionalsnippets.js.map +1 -1
  184. package/esm/src/models/aisearchop.d.ts +4 -10
  185. package/esm/src/models/aisearchop.d.ts.map +1 -1
  186. package/esm/src/models/aisearchop.js +9 -20
  187. package/esm/src/models/aisearchop.js.map +1 -1
  188. package/esm/src/models/aisearchresponse.d.ts +2 -2
  189. package/esm/src/models/aisearchresponse.d.ts.map +1 -1
  190. package/esm/src/models/aisearchresponse.js.map +1 -1
  191. package/esm/src/models/aispaginationinfo.d.ts +1 -1
  192. package/esm/src/models/aispaginationinfo.d.ts.map +1 -1
  193. package/esm/src/models/aispaginationinfo.js +5 -4
  194. package/esm/src/models/aispaginationinfo.js.map +1 -1
  195. package/esm/src/models/aitopicbreadcrumb.d.ts +1 -1
  196. package/esm/src/models/aitopicbreadcrumb.d.ts.map +1 -1
  197. package/esm/src/models/aitopicbreadcrumb.js +2 -1
  198. package/esm/src/models/aitopicbreadcrumb.js.map +1 -1
  199. package/esm/src/models/aitopicsummary.d.ts +1 -1
  200. package/esm/src/models/aitopicsummary.d.ts.map +1 -1
  201. package/esm/src/models/aitopicsummary.js.map +1 -1
  202. package/esm/src/models/allaccessibleportals.d.ts +1 -1
  203. package/esm/src/models/allaccessibleportals.d.ts.map +1 -1
  204. package/esm/src/models/allaccessibleportals.js +2 -1
  205. package/esm/src/models/allaccessibleportals.js.map +1 -1
  206. package/esm/src/models/answersrequest.d.ts +16 -25
  207. package/esm/src/models/answersrequest.d.ts.map +1 -1
  208. package/esm/src/models/answersrequest.js +11 -25
  209. package/esm/src/models/answersrequest.js.map +1 -1
  210. package/esm/src/models/answersresponse.d.ts +28 -7
  211. package/esm/src/models/answersresponse.d.ts.map +1 -1
  212. package/esm/src/models/answersresponse.js +8 -0
  213. package/esm/src/models/answersresponse.js.map +1 -1
  214. package/esm/src/models/article.d.ts +2 -2
  215. package/esm/src/models/article.d.ts.map +1 -1
  216. package/esm/src/models/article.js +3 -4
  217. package/esm/src/models/article.js.map +1 -1
  218. package/esm/src/models/articleadditionalattributes.d.ts +36 -2
  219. package/esm/src/models/articleadditionalattributes.d.ts.map +1 -1
  220. package/esm/src/models/articleadditionalattributes.js +17 -0
  221. package/esm/src/models/articleadditionalattributes.js.map +1 -1
  222. package/esm/src/models/articleaisearchresult.d.ts +48 -9
  223. package/esm/src/models/articleaisearchresult.d.ts.map +1 -1
  224. package/esm/src/models/articleaisearchresult.js +17 -1
  225. package/esm/src/models/articleaisearchresult.js.map +1 -1
  226. package/esm/src/models/articleattachment.d.ts +14 -3
  227. package/esm/src/models/articleattachment.d.ts.map +1 -1
  228. package/esm/src/models/articleattachment.js +7 -2
  229. package/esm/src/models/articleattachment.js.map +1 -1
  230. package/esm/src/models/articleresult.d.ts +1 -1
  231. package/esm/src/models/articleresult.d.ts.map +1 -1
  232. package/esm/src/models/articleresult.js +1 -1
  233. package/esm/src/models/articleresult.js.map +1 -1
  234. package/esm/src/models/articleresultadditionalattributes.d.ts +34 -2
  235. package/esm/src/models/articleresultadditionalattributes.d.ts.map +1 -1
  236. package/esm/src/models/articleresultadditionalattributes.js +16 -0
  237. package/esm/src/models/articleresultadditionalattributes.js.map +1 -1
  238. package/esm/src/models/articleresults.d.ts +1 -1
  239. package/esm/src/models/articleresults.d.ts.map +1 -1
  240. package/esm/src/models/articleresults.js.map +1 -1
  241. package/esm/src/models/articletype.d.ts +2 -7
  242. package/esm/src/models/articletype.d.ts.map +1 -1
  243. package/esm/src/models/articletype.js +2 -16
  244. package/esm/src/models/articletype.js.map +1 -1
  245. package/esm/src/models/attachmentforcreatesuggestion.d.ts +1 -1
  246. package/esm/src/models/attachmentforcreatesuggestion.d.ts.map +1 -1
  247. package/esm/src/models/attachmentforcreatesuggestion.js.map +1 -1
  248. package/esm/src/models/bookmarkstatus.d.ts +1 -1
  249. package/esm/src/models/bookmarkstatus.d.ts.map +1 -1
  250. package/esm/src/models/bookmarkstatus.js +1 -1
  251. package/esm/src/models/bookmarkstatus.js.map +1 -1
  252. package/esm/src/models/complianceforarticle.d.ts +3 -3
  253. package/esm/src/models/complianceforarticle.d.ts.map +1 -1
  254. package/esm/src/models/complianceforarticle.js +8 -5
  255. package/esm/src/models/complianceforarticle.js.map +1 -1
  256. package/esm/src/models/createdby.d.ts +1 -1
  257. package/esm/src/models/createdby.d.ts.map +1 -1
  258. package/esm/src/models/createdby.js.map +1 -1
  259. package/esm/src/models/createsuggestion.d.ts +69 -6
  260. package/esm/src/models/createsuggestion.d.ts.map +1 -1
  261. package/esm/src/models/createsuggestion.js +31 -2
  262. package/esm/src/models/createsuggestion.js.map +1 -1
  263. package/esm/src/models/customattribute.d.ts +18 -3
  264. package/esm/src/models/customattribute.d.ts.map +1 -1
  265. package/esm/src/models/customattribute.js +6 -0
  266. package/esm/src/models/customattribute.js.map +1 -1
  267. package/esm/src/models/department.d.ts +1 -1
  268. package/esm/src/models/department.d.ts.map +1 -1
  269. package/esm/src/models/department.js.map +1 -1
  270. package/esm/src/models/edition.d.ts +2 -2
  271. package/esm/src/models/edition.d.ts.map +1 -1
  272. package/esm/src/models/edition.js +1 -2
  273. package/esm/src/models/edition.js.map +1 -1
  274. package/esm/src/models/errors/sdkvalidationerror.d.ts +1 -1
  275. package/esm/src/models/errors/sdkvalidationerror.d.ts.map +1 -1
  276. package/esm/src/models/errors/sdkvalidationerror.js +2 -49
  277. package/esm/src/models/errors/sdkvalidationerror.js.map +1 -1
  278. package/esm/src/models/folderbreadcrumb.d.ts +1 -1
  279. package/esm/src/models/folderbreadcrumb.d.ts.map +1 -1
  280. package/esm/src/models/folderbreadcrumb.js.map +1 -1
  281. package/esm/src/models/foldersummary.d.ts +1 -1
  282. package/esm/src/models/foldersummary.d.ts.map +1 -1
  283. package/esm/src/models/foldersummary.js +1 -1
  284. package/esm/src/models/foldersummary.js.map +1 -1
  285. package/esm/src/models/getannouncementarticlesop.d.ts +8 -9
  286. package/esm/src/models/getannouncementarticlesop.d.ts.map +1 -1
  287. package/esm/src/models/getannouncementarticlesop.js +12 -10
  288. package/esm/src/models/getannouncementarticlesop.js.map +1 -1
  289. package/esm/src/models/getarticlebyidop.d.ts +77 -11
  290. package/esm/src/models/getarticlebyidop.d.ts.map +1 -1
  291. package/esm/src/models/getarticlebyidop.js +31 -62
  292. package/esm/src/models/getarticlebyidop.js.map +1 -1
  293. package/esm/src/models/getbestanswerop.d.ts +1 -9
  294. package/esm/src/models/getbestanswerop.d.ts.map +1 -1
  295. package/esm/src/models/getbestanswerop.js +3 -16
  296. package/esm/src/models/getbestanswerop.js.map +1 -1
  297. package/esm/src/models/getmyportalsop.d.ts +4 -10
  298. package/esm/src/models/getmyportalsop.d.ts.map +1 -1
  299. package/esm/src/models/getmyportalsop.js +9 -10
  300. package/esm/src/models/getmyportalsop.js.map +1 -1
  301. package/esm/src/models/getpopulararticlesop.d.ts +8 -9
  302. package/esm/src/models/getpopulararticlesop.d.ts.map +1 -1
  303. package/esm/src/models/getpopulararticlesop.js +12 -10
  304. package/esm/src/models/getpopulararticlesop.js.map +1 -1
  305. package/esm/src/models/l10nstring.d.ts +1 -1
  306. package/esm/src/models/l10nstring.d.ts.map +1 -1
  307. package/esm/src/models/l10nstring.js.map +1 -1
  308. package/esm/src/models/languagecode.d.ts +69 -2
  309. package/esm/src/models/languagecode.d.ts.map +1 -1
  310. package/esm/src/models/languagecode.js +32 -0
  311. package/esm/src/models/languagecode.js.map +1 -1
  312. package/esm/src/models/languagecodeparameter.d.ts +90 -5
  313. package/esm/src/models/languagecodeparameter.d.ts.map +1 -1
  314. package/esm/src/models/languagecodeparameter.js +45 -4
  315. package/esm/src/models/languagecodeparameter.js.map +1 -1
  316. package/esm/src/models/languagequeryparameter.d.ts +90 -5
  317. package/esm/src/models/languagequeryparameter.d.ts.map +1 -1
  318. package/esm/src/models/languagequeryparameter.js +45 -4
  319. package/esm/src/models/languagequeryparameter.js.map +1 -1
  320. package/esm/src/models/link.d.ts +1 -1
  321. package/esm/src/models/link.d.ts.map +1 -1
  322. package/esm/src/models/link.js.map +1 -1
  323. package/esm/src/models/makesuggestionop.d.ts +4 -9
  324. package/esm/src/models/makesuggestionop.d.ts.map +1 -1
  325. package/esm/src/models/makesuggestionop.js +3 -7
  326. package/esm/src/models/makesuggestionop.js.map +1 -1
  327. package/esm/src/models/mandatorylanguagequeryparameter.d.ts +90 -5
  328. package/esm/src/models/mandatorylanguagequeryparameter.d.ts.map +1 -1
  329. package/esm/src/models/mandatorylanguagequeryparameter.js +45 -4
  330. package/esm/src/models/mandatorylanguagequeryparameter.js.map +1 -1
  331. package/esm/src/models/milestone.d.ts +1 -1
  332. package/esm/src/models/milestone.d.ts.map +1 -1
  333. package/esm/src/models/milestone.js.map +1 -1
  334. package/esm/src/models/milestonename.d.ts +1 -1
  335. package/esm/src/models/milestonename.d.ts.map +1 -1
  336. package/esm/src/models/milestonename.js.map +1 -1
  337. package/esm/src/models/modifiedby.d.ts +1 -1
  338. package/esm/src/models/modifiedby.d.ts.map +1 -1
  339. package/esm/src/models/modifiedby.js.map +1 -1
  340. package/esm/src/models/order.d.ts +10 -2
  341. package/esm/src/models/order.d.ts.map +1 -1
  342. package/esm/src/models/order.js +4 -0
  343. package/esm/src/models/order.js.map +1 -1
  344. package/esm/src/models/ownedby.d.ts +1 -1
  345. package/esm/src/models/ownedby.d.ts.map +1 -1
  346. package/esm/src/models/ownedby.js +1 -2
  347. package/esm/src/models/ownedby.js.map +1 -1
  348. package/esm/src/models/paginationinfo.d.ts +1 -1
  349. package/esm/src/models/paginationinfo.d.ts.map +1 -1
  350. package/esm/src/models/paginationinfo.js +3 -3
  351. package/esm/src/models/paginationinfo.js.map +1 -1
  352. package/esm/src/models/personalization.d.ts +4 -4
  353. package/esm/src/models/personalization.d.ts.map +1 -1
  354. package/esm/src/models/personalization.js +1 -2
  355. package/esm/src/models/personalization.js.map +1 -1
  356. package/esm/src/models/publishview.d.ts +2 -2
  357. package/esm/src/models/publishview.d.ts.map +1 -1
  358. package/esm/src/models/publishview.js.map +1 -1
  359. package/esm/src/models/referenceresponse.d.ts +30 -5
  360. package/esm/src/models/referenceresponse.d.ts.map +1 -1
  361. package/esm/src/models/referenceresponse.js +12 -1
  362. package/esm/src/models/referenceresponse.js.map +1 -1
  363. package/esm/src/models/requiredlanguagecode.d.ts +71 -2
  364. package/esm/src/models/requiredlanguagecode.d.ts.map +1 -1
  365. package/esm/src/models/requiredlanguagecode.js +33 -0
  366. package/esm/src/models/requiredlanguagecode.js.map +1 -1
  367. package/esm/src/models/retrievechunksop.d.ts +1 -9
  368. package/esm/src/models/retrievechunksop.d.ts.map +1 -1
  369. package/esm/src/models/retrievechunksop.js +1 -15
  370. package/esm/src/models/retrievechunksop.js.map +1 -1
  371. package/esm/src/models/retrieverequest.d.ts +15 -4
  372. package/esm/src/models/retrieverequest.d.ts.map +1 -1
  373. package/esm/src/models/retrieverequest.js +4 -0
  374. package/esm/src/models/retrieverequest.js.map +1 -1
  375. package/esm/src/models/retrieveresponse.d.ts +27 -8
  376. package/esm/src/models/retrieveresponse.d.ts.map +1 -1
  377. package/esm/src/models/retrieveresponse.js +8 -1
  378. package/esm/src/models/retrieveresponse.js.map +1 -1
  379. package/esm/src/models/schemaslink.d.ts +1 -1
  380. package/esm/src/models/schemaslink.d.ts.map +1 -1
  381. package/esm/src/models/schemaslink.js.map +1 -1
  382. package/esm/src/models/schemastags.d.ts +1 -1
  383. package/esm/src/models/schemastags.d.ts.map +1 -1
  384. package/esm/src/models/schemastags.js.map +1 -1
  385. package/esm/src/models/searchresult.d.ts +40 -5
  386. package/esm/src/models/searchresult.d.ts.map +1 -1
  387. package/esm/src/models/searchresult.js +19 -0
  388. package/esm/src/models/searchresult.js.map +1 -1
  389. package/esm/src/models/security.d.ts +5 -2
  390. package/esm/src/models/security.d.ts.map +1 -1
  391. package/esm/src/models/security.js +5 -3
  392. package/esm/src/models/security.js.map +1 -1
  393. package/esm/src/models/shorturl.d.ts +1 -1
  394. package/esm/src/models/shorturl.d.ts.map +1 -1
  395. package/esm/src/models/shorturl.js +1 -2
  396. package/esm/src/models/shorturl.js.map +1 -1
  397. package/esm/src/models/sortidnamedepartment.d.ts +12 -2
  398. package/esm/src/models/sortidnamedepartment.d.ts.map +1 -1
  399. package/esm/src/models/sortidnamedepartment.js +5 -0
  400. package/esm/src/models/sortidnamedepartment.js.map +1 -1
  401. package/esm/src/models/stage.d.ts +1 -1
  402. package/esm/src/models/stage.d.ts.map +1 -1
  403. package/esm/src/models/stage.js +1 -2
  404. package/esm/src/models/stage.js.map +1 -1
  405. package/esm/src/models/structuredauthoringfields.d.ts +1 -1
  406. package/esm/src/models/structuredauthoringfields.d.ts.map +1 -1
  407. package/esm/src/models/structuredauthoringfields.js.map +1 -1
  408. package/esm/src/models/tag.d.ts +1 -1
  409. package/esm/src/models/tag.d.ts.map +1 -1
  410. package/esm/src/models/tag.js.map +1 -1
  411. package/esm/src/models/tagcategory.d.ts +1 -1
  412. package/esm/src/models/tagcategory.d.ts.map +1 -1
  413. package/esm/src/models/tagcategory.js.map +1 -1
  414. package/esm/src/models/taggroup.d.ts +1 -1
  415. package/esm/src/models/taggroup.d.ts.map +1 -1
  416. package/esm/src/models/taggroup.js +1 -2
  417. package/esm/src/models/taggroup.js.map +1 -1
  418. package/esm/src/models/taggroups.d.ts +1 -1
  419. package/esm/src/models/taggroups.d.ts.map +1 -1
  420. package/esm/src/models/taggroups.js.map +1 -1
  421. package/esm/src/models/tags.d.ts +1 -1
  422. package/esm/src/models/tags.d.ts.map +1 -1
  423. package/esm/src/models/tags.js.map +1 -1
  424. package/esm/src/models/topicbreadcrumb.d.ts +1 -1
  425. package/esm/src/models/topicbreadcrumb.d.ts.map +1 -1
  426. package/esm/src/models/topicbreadcrumb.js.map +1 -1
  427. package/esm/src/models/topicsummary.d.ts +1 -1
  428. package/esm/src/models/topicsummary.d.ts.map +1 -1
  429. package/esm/src/models/topicsummary.js.map +1 -1
  430. package/esm/src/models/workflow.d.ts +1 -1
  431. package/esm/src/models/workflow.d.ts.map +1 -1
  432. package/esm/src/models/workflow.js +1 -2
  433. package/esm/src/models/workflow.js.map +1 -1
  434. package/esm/src/models/workflowmilestone.d.ts +12 -2
  435. package/esm/src/models/workflowmilestone.d.ts.map +1 -1
  436. package/esm/src/models/workflowmilestone.js +5 -0
  437. package/esm/src/models/workflowmilestone.js.map +1 -1
  438. package/esm/src/models/wserrorcommon.d.ts +2 -2
  439. package/esm/src/models/wserrorcommon.d.ts.map +1 -1
  440. package/esm/src/models/wserrorcommon.js +1 -2
  441. package/esm/src/models/wserrorcommon.js.map +1 -1
  442. package/esm/src/tool-names.d.ts +5 -0
  443. package/esm/src/tool-names.d.ts.map +1 -0
  444. package/esm/src/tool-names.js +36 -0
  445. package/esm/src/tool-names.js.map +1 -0
  446. package/esm/src/types/bigint.d.ts +6 -0
  447. package/esm/src/types/bigint.d.ts.map +1 -0
  448. package/esm/src/types/bigint.js +87 -0
  449. package/esm/src/types/bigint.js.map +1 -0
  450. package/esm/worker-configuration.d.ts +1 -0
  451. package/esm/worker-configuration.d.ts.map +1 -1
  452. package/manifest.json +78 -51
  453. package/package.json +11 -7
  454. package/src/cloudflare-worker/cloudflare-worker.ts +22 -9
  455. package/src/funcs/{querySearch.ts → aiSearch.ts} +49 -2
  456. package/src/funcs/{getAnnouncements.ts → getAnnouncementArticles.ts} +67 -10
  457. package/src/funcs/{getArticle.ts → getArticleById.ts} +58 -1
  458. package/src/funcs/{queryAnswers.ts → getBestAnswer.ts} +52 -14
  459. package/src/funcs/{getPortals.ts → getMyPortals.ts} +35 -2
  460. package/src/funcs/getPopularArticles.ts +68 -8
  461. package/src/funcs/makeSuggestion.ts +67 -9
  462. package/src/funcs/{queryRetrieve.ts → retrieveChunks.ts} +50 -15
  463. package/src/hooks/auth-hook.ts +3 -63
  464. package/src/hooks/registration.ts +3 -18
  465. package/src/landing-page.ts +1084 -0
  466. package/src/lib/base64.ts +2 -2
  467. package/src/lib/config.ts +5 -5
  468. package/src/lib/encodings.ts +12 -3
  469. package/src/lib/matchers.ts +5 -1
  470. package/src/lib/schemas.ts +10 -22
  471. package/src/lib/sdks.ts +2 -2
  472. package/src/lib/security.ts +21 -0
  473. package/src/mcp-server/cli/start/command.ts +31 -0
  474. package/src/mcp-server/cli/start/impl.ts +118 -31
  475. package/src/mcp-server/extensions.ts +6 -4
  476. package/src/mcp-server/flags.ts +21 -0
  477. package/src/mcp-server/mcp-server.ts +1 -1
  478. package/src/mcp-server/prompts.ts +9 -19
  479. package/src/mcp-server/server.ts +22 -16
  480. package/src/mcp-server/tools/aiSearch.ts +92 -0
  481. package/src/mcp-server/tools/getAnnouncementArticles.ts +90 -0
  482. package/src/mcp-server/tools/getArticleById.ts +99 -0
  483. package/src/mcp-server/tools/getBestAnswer.ts +94 -0
  484. package/src/mcp-server/tools/{getPortals.ts → getMyPortals.ts} +39 -5
  485. package/src/mcp-server/tools/getPopularArticles.ts +40 -0
  486. package/src/mcp-server/tools/makeSuggestion.ts +44 -0
  487. package/src/mcp-server/tools/retrieveChunks.ts +89 -0
  488. package/src/mcp-server/tools.ts +300 -46
  489. package/src/models/acceptlanguage.ts +21 -8
  490. package/src/models/accessibleportal.ts +9 -11
  491. package/src/models/additionalsnippets.ts +25 -18
  492. package/src/models/aisearchop.ts +14 -37
  493. package/src/models/aisearchresponse.ts +7 -13
  494. package/src/models/aispaginationinfo.ts +7 -10
  495. package/src/models/aitopicbreadcrumb.ts +4 -7
  496. package/src/models/aitopicsummary.ts +1 -5
  497. package/src/models/allaccessibleportals.ts +5 -8
  498. package/src/models/answersrequest.ts +22 -58
  499. package/src/models/answersresponse.ts +30 -24
  500. package/src/models/article.ts +39 -40
  501. package/src/models/articleadditionalattributes.ts +22 -4
  502. package/src/models/articleaisearchresult.ts +70 -52
  503. package/src/models/articleattachment.ts +18 -15
  504. package/src/models/articleresult.ts +2 -6
  505. package/src/models/articleresultadditionalattributes.ts +43 -0
  506. package/src/models/articleresults.ts +1 -5
  507. package/src/models/articletype.ts +4 -25
  508. package/src/models/attachmentforcreatesuggestion.ts +1 -3
  509. package/src/models/bookmarkstatus.ts +2 -6
  510. package/src/models/complianceforarticle.ts +13 -22
  511. package/src/models/createdby.ts +7 -8
  512. package/src/models/createsuggestion.ts +54 -31
  513. package/src/models/customattribute.ts +13 -7
  514. package/src/models/department.ts +1 -5
  515. package/src/models/edition.ts +8 -13
  516. package/src/models/errors/sdkvalidationerror.ts +2 -57
  517. package/src/models/folderbreadcrumb.ts +5 -7
  518. package/src/models/foldersummary.ts +2 -6
  519. package/src/models/getannouncementarticlesop.ts +34 -23
  520. package/src/models/getarticlebyidop.ts +91 -95
  521. package/src/models/getbestanswerop.ts +16 -48
  522. package/src/models/getmyportalsop.ts +29 -44
  523. package/src/models/getpopulararticlesop.ts +34 -23
  524. package/src/models/l10nstring.ts +1 -5
  525. package/src/models/languagecode.ts +38 -2
  526. package/src/models/languagecodeparameter.ts +48 -10
  527. package/src/models/languagequeryparameter.ts +48 -10
  528. package/src/models/link.ts +1 -1
  529. package/src/models/makesuggestionop.ts +20 -30
  530. package/src/models/mandatorylanguagequeryparameter.ts +50 -10
  531. package/src/models/milestone.ts +3 -4
  532. package/src/models/milestonename.ts +1 -5
  533. package/src/models/modifiedby.ts +1 -5
  534. package/src/models/order.ts +7 -2
  535. package/src/models/ownedby.ts +7 -8
  536. package/src/models/paginationinfo.ts +4 -8
  537. package/src/models/personalization.ts +6 -19
  538. package/src/models/publishview.ts +2 -8
  539. package/src/models/referenceresponse.ts +34 -20
  540. package/src/models/requiredlanguagecode.ts +39 -4
  541. package/src/models/retrievechunksop.ts +16 -48
  542. package/src/models/retrieverequest.ts +12 -10
  543. package/src/models/retrieveresponse.ts +34 -28
  544. package/src/models/schemaslink.ts +1 -5
  545. package/src/models/schemastags.ts +1 -5
  546. package/src/models/searchresult.ts +34 -8
  547. package/src/models/security.ts +14 -7
  548. package/src/models/shorturl.ts +6 -7
  549. package/src/models/sortidnamedepartment.ts +8 -4
  550. package/src/models/stage.ts +4 -5
  551. package/src/models/structuredauthoringfields.ts +1 -3
  552. package/src/models/tag.ts +1 -1
  553. package/src/models/tagcategory.ts +1 -5
  554. package/src/models/taggroup.ts +4 -5
  555. package/src/models/taggroups.ts +3 -4
  556. package/src/models/tags.ts +1 -1
  557. package/src/models/topicbreadcrumb.ts +1 -5
  558. package/src/models/topicsummary.ts +1 -5
  559. package/src/models/workflow.ts +3 -4
  560. package/src/models/workflowmilestone.ts +8 -2
  561. package/src/models/wserrorcommon.ts +5 -10
  562. package/src/tool-names.ts +35 -0
  563. package/src/types/bigint.ts +87 -0
  564. package/tsconfig.json +0 -1
  565. package/worker-configuration.d.ts +2 -2
  566. package/worker-configuration.ts +1 -0
  567. package/src/cloudflare-worker/landing-page.ts +0 -337
  568. package/src/hooks/portal-cache-hook.ts +0 -505
  569. package/src/hooks/portal-lookup-hook.ts +0 -429
  570. package/src/mcp-server/tools/getAnnouncements.ts +0 -53
  571. package/src/mcp-server/tools/getArticle.ts +0 -56
  572. package/src/mcp-server/tools/queryAnswers.ts +0 -57
  573. package/src/mcp-server/tools/queryRetrieve.ts +0 -55
  574. package/src/mcp-server/tools/querySearch.ts +0 -44
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
6
7
  import {
7
8
  ReferenceResponse,
8
9
  ReferenceResponse$zodSchema,
@@ -12,14 +13,20 @@ import { SearchResult, SearchResult$zodSchema } from "./searchresult.js";
12
13
  /**
13
14
  * Specifies that the answer produced was a certified answer.
14
15
  */
16
+ export const RetrieveResponseAnswerType = {
17
+ Certified: "certified",
18
+ } as const;
19
+ /**
20
+ * Specifies that the answer produced was a certified answer.
21
+ */
22
+ export type RetrieveResponseAnswerType = ClosedEnum<
23
+ typeof RetrieveResponseAnswerType
24
+ >;
25
+
15
26
  export const RetrieveResponseAnswerType$zodSchema = z.enum([
16
27
  "certified",
17
28
  ]).describe("Specifies that the answer produced was a certified answer.");
18
29
 
19
- export type RetrieveResponseAnswerType = z.infer<
20
- typeof RetrieveResponseAnswerType$zodSchema
21
- >;
22
-
23
30
  /**
24
31
  * If a certified answer is given. The answer object will be present. <br><br> This will be shown only if certified answers are configured and the certified answer meets the configured threshold.
25
32
  */
@@ -27,18 +34,16 @@ export type RetrieveResponseAnswer = {
27
34
  answerValue: string;
28
35
  references: Array<ReferenceResponse>;
29
36
  answerType: RetrieveResponseAnswerType;
30
- relevanceScore?: number | undefined;
37
+ relevanceScore: number;
31
38
  };
32
39
 
33
40
  export const RetrieveResponseAnswer$zodSchema: z.ZodType<
34
- RetrieveResponseAnswer,
35
- z.ZodTypeDef,
36
- unknown
41
+ RetrieveResponseAnswer
37
42
  > = z.object({
38
43
  answerType: RetrieveResponseAnswerType$zodSchema,
39
44
  answerValue: z.string(),
40
45
  references: z.array(ReferenceResponse$zodSchema),
41
- relevanceScore: z.number().optional(),
46
+ relevanceScore: z.number(),
42
47
  }).describe(
43
48
  "If a certified answer is given. The answer object will be present. <br><br> This will be shown only if certified answers are configured and the certified answer meets the configured threshold.",
44
49
  );
@@ -46,6 +51,15 @@ export const RetrieveResponseAnswer$zodSchema: z.ZodType<
46
51
  /**
47
52
  * The channel where the query originated, e.g., directly from the portal or via a custom integration.
48
53
  */
54
+ export const RetrieveResponseType = {
55
+ Portal: "portal",
56
+ Custom: "custom",
57
+ } as const;
58
+ /**
59
+ * The channel where the query originated, e.g., directly from the portal or via a custom integration.
60
+ */
61
+ export type RetrieveResponseType = ClosedEnum<typeof RetrieveResponseType>;
62
+
49
63
  export const RetrieveResponseType$zodSchema = z.enum([
50
64
  "portal",
51
65
  "custom",
@@ -53,19 +67,13 @@ export const RetrieveResponseType$zodSchema = z.enum([
53
67
  "The channel where the query originated, e.g., directly from the portal or via a custom integration.",
54
68
  );
55
69
 
56
- export type RetrieveResponseType = z.infer<
57
- typeof RetrieveResponseType$zodSchema
58
- >;
59
-
60
70
  export type RetrieveResponseChannel = {
61
71
  type: RetrieveResponseType;
62
72
  name?: string | undefined;
63
73
  };
64
74
 
65
75
  export const RetrieveResponseChannel$zodSchema: z.ZodType<
66
- RetrieveResponseChannel,
67
- z.ZodTypeDef,
68
- unknown
76
+ RetrieveResponseChannel
69
77
  > = z.object({
70
78
  name: z.string().optional(),
71
79
  type: RetrieveResponseType$zodSchema,
@@ -80,15 +88,13 @@ export type RetrieveResponse = {
80
88
  sessionId: string;
81
89
  };
82
90
 
83
- export const RetrieveResponse$zodSchema: z.ZodType<
84
- RetrieveResponse,
85
- z.ZodTypeDef,
86
- unknown
87
- > = z.object({
88
- answer: z.lazy(() => RetrieveResponseAnswer$zodSchema).optional(),
89
- channel: z.lazy(() => RetrieveResponseChannel$zodSchema).optional(),
90
- clientSessionId: z.string().optional(),
91
- eventId: z.string().optional(),
92
- searchResults: z.array(SearchResult$zodSchema),
93
- sessionId: z.string(),
94
- });
91
+ export const RetrieveResponse$zodSchema: z.ZodType<RetrieveResponse> = z.object(
92
+ {
93
+ answer: z.lazy(() => RetrieveResponseAnswer$zodSchema).optional(),
94
+ channel: z.lazy(() => RetrieveResponseChannel$zodSchema).optional(),
95
+ clientSessionId: z.string().optional(),
96
+ eventId: z.string().optional(),
97
+ searchResults: z.array(SearchResult$zodSchema),
98
+ sessionId: z.string(),
99
+ },
100
+ );
@@ -10,11 +10,7 @@ export type SchemasLink = {
10
10
  _default?: boolean | undefined;
11
11
  };
12
12
 
13
- export const SchemasLink$zodSchema: z.ZodType<
14
- SchemasLink,
15
- z.ZodTypeDef,
16
- unknown
17
- > = z.object({
13
+ export const SchemasLink$zodSchema: z.ZodType<SchemasLink> = z.object({
18
14
  _default: z.boolean().optional(),
19
15
  href: z.string().optional(),
20
16
  rel: z.string().optional(),
@@ -9,11 +9,7 @@ export type SchemasTags = {
9
9
  tags?: Array<string> | undefined;
10
10
  };
11
11
 
12
- export const SchemasTags$zodSchema: z.ZodType<
13
- SchemasTags,
14
- z.ZodTypeDef,
15
- unknown
16
- > = z.object({
12
+ export const SchemasTags$zodSchema: z.ZodType<SchemasTags> = z.object({
17
13
  id: z.string().optional(),
18
14
  tags: z.array(z.string()).optional(),
19
15
  });
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
6
7
  import {
7
8
  AITopicBreadcrumb,
8
9
  AITopicBreadcrumb$zodSchema,
@@ -11,6 +12,17 @@ import {
11
12
  /**
12
13
  * Format of the source document (HTML, DOCX, PPTX, or PDF).
13
14
  */
15
+ export const SearchResultDocType = {
16
+ Html: "HTML",
17
+ Docx: "DOCX",
18
+ Pdf: "PDF",
19
+ Pptx: "PPTX",
20
+ } as const;
21
+ /**
22
+ * Format of the source document (HTML, DOCX, PPTX, or PDF).
23
+ */
24
+ export type SearchResultDocType = ClosedEnum<typeof SearchResultDocType>;
25
+
14
26
  export const SearchResultDocType$zodSchema = z.enum([
15
27
  "HTML",
16
28
  "DOCX",
@@ -18,11 +30,18 @@ export const SearchResultDocType$zodSchema = z.enum([
18
30
  "PPTX",
19
31
  ]).describe("Format of the source document (HTML, DOCX, PPTX, or PDF).");
20
32
 
21
- export type SearchResultDocType = z.infer<typeof SearchResultDocType$zodSchema>;
22
-
23
33
  /**
24
34
  * The repository or system where the content originated (e.g., eGain Article, eGain Attachment).
25
35
  */
36
+ export const SearchResultSource = {
37
+ EGainArticle: "eGain Article",
38
+ EGainAttachment: "eGain Attachment",
39
+ } as const;
40
+ /**
41
+ * The repository or system where the content originated (e.g., eGain Article, eGain Attachment).
42
+ */
43
+ export type SearchResultSource = ClosedEnum<typeof SearchResultSource>;
44
+
26
45
  export const SearchResultSource$zodSchema = z.enum([
27
46
  "eGain Article",
28
47
  "eGain Attachment",
@@ -30,7 +49,16 @@ export const SearchResultSource$zodSchema = z.enum([
30
49
  "The repository or system where the content originated (e.g., eGain Article, eGain Attachment).",
31
50
  );
32
51
 
33
- export type SearchResultSource = z.infer<typeof SearchResultSource$zodSchema>;
52
+ export const SnippetType = {
53
+ Chunks: "chunks",
54
+ ArticleContent: "articleContent",
55
+ } as const;
56
+ export type SnippetType = ClosedEnum<typeof SnippetType>;
57
+
58
+ export const SnippetType$zodSchema = z.enum([
59
+ "chunks",
60
+ "articleContent",
61
+ ]);
34
62
 
35
63
  /**
36
64
  * Represents a single document or snippet returned by search, along with its metadata and relevance score.
@@ -43,16 +71,13 @@ export type SearchResult = {
43
71
  source: SearchResultSource;
44
72
  snippet: string;
45
73
  contextualSummary?: string | undefined;
74
+ snippetType?: SnippetType | undefined;
46
75
  relevanceScore?: number | undefined;
47
76
  normalizedScore?: number | undefined;
48
77
  topicBreadcrumb?: Array<AITopicBreadcrumb> | undefined;
49
78
  };
50
79
 
51
- export const SearchResult$zodSchema: z.ZodType<
52
- SearchResult,
53
- z.ZodTypeDef,
54
- unknown
55
- > = z.object({
80
+ export const SearchResult$zodSchema: z.ZodType<SearchResult> = z.object({
56
81
  contextualSummary: z.string().optional(),
57
82
  docName: z.string().optional(),
58
83
  docType: SearchResultDocType$zodSchema,
@@ -61,6 +86,7 @@ export const SearchResult$zodSchema: z.ZodType<
61
86
  normalizedScore: z.number().optional(),
62
87
  relevanceScore: z.number().optional(),
63
88
  snippet: z.string(),
89
+ snippetType: SnippetType$zodSchema.optional(),
64
90
  source: SearchResultSource$zodSchema,
65
91
  topicBreadcrumb: z.array(AITopicBreadcrumb$zodSchema).optional(),
66
92
  }).describe(
@@ -4,11 +4,18 @@
4
4
 
5
5
  import * as z from "zod";
6
6
 
7
- export type Security = { accessToken: string };
7
+ export type Security = {
8
+ oAuthUser?: string | undefined;
9
+ oAuthCustomer?: string | undefined;
10
+ oAuthAnonymousCustomer?: string | undefined;
11
+ accessToken?: string | undefined;
12
+ };
8
13
 
9
- export const Security$zodSchema: z.ZodType<Security, z.ZodTypeDef, unknown> = z
10
- .object({
11
- accessToken: z.string().describe(
12
- "JWT Bearer Token authentication for API access",
13
- ),
14
- });
14
+ export const Security$zodSchema: z.ZodType<Security> = z.object({
15
+ accessToken: z.string().describe(
16
+ "JWT Bearer Token authentication for API access",
17
+ ).optional(),
18
+ oAuthAnonymousCustomer: z.string().describe("API Key").optional(),
19
+ oAuthCustomer: z.string().describe("API Key").optional(),
20
+ oAuthUser: z.string().describe("API Key").optional(),
21
+ });
@@ -11,10 +11,9 @@ export type ShortURL = {
11
11
  isDefault?: boolean | undefined;
12
12
  };
13
13
 
14
- export const ShortURL$zodSchema: z.ZodType<ShortURL, z.ZodTypeDef, unknown> = z
15
- .object({
16
- id: z.string().optional(),
17
- isDefault: z.boolean().optional(),
18
- shortURLName: z.string().optional(),
19
- templateName: z.string().optional(),
20
- });
14
+ export const ShortURL$zodSchema: z.ZodType<ShortURL> = z.object({
15
+ id: z.string().optional(),
16
+ isDefault: z.boolean().optional(),
17
+ shortURLName: z.string().optional(),
18
+ templateName: z.string().optional(),
19
+ });
@@ -3,13 +3,17 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const SortIdNameDepartment = {
9
+ Id: "id",
10
+ Name: "name",
11
+ DepartmentName: "departmentName",
12
+ } as const;
13
+ export type SortIdNameDepartment = ClosedEnum<typeof SortIdNameDepartment>;
6
14
 
7
15
  export const SortIdNameDepartment$zodSchema = z.enum([
8
16
  "id",
9
17
  "name",
10
18
  "departmentName",
11
19
  ]);
12
-
13
- export type SortIdNameDepartment = z.infer<
14
- typeof SortIdNameDepartment$zodSchema
15
- >;
@@ -13,8 +13,7 @@ export type Stage = {
13
13
  milestone?: Milestone | undefined;
14
14
  };
15
15
 
16
- export const Stage$zodSchema: z.ZodType<Stage, z.ZodTypeDef, unknown> = z
17
- .object({
18
- milestone: Milestone$zodSchema.optional(),
19
- name: z.string().optional(),
20
- }).describe("A stage in the Article's workflow.");
16
+ export const Stage$zodSchema: z.ZodType<Stage> = z.object({
17
+ milestone: Milestone$zodSchema.optional(),
18
+ name: z.string().optional(),
19
+ }).describe("A stage in the Article's workflow.");
@@ -13,9 +13,7 @@ export type StructuredAuthoringFields = {
13
13
  };
14
14
 
15
15
  export const StructuredAuthoringFields$zodSchema: z.ZodType<
16
- StructuredAuthoringFields,
17
- z.ZodTypeDef,
18
- unknown
16
+ StructuredAuthoringFields
19
17
  > = z.object({
20
18
  cause: z.string().optional(),
21
19
  confidenceLevel: L10NString$zodSchema.optional(),
package/src/models/tag.ts CHANGED
@@ -6,7 +6,7 @@ import * as z from "zod";
6
6
 
7
7
  export type Tag = { name?: string | undefined; id?: string | undefined };
8
8
 
9
- export const Tag$zodSchema: z.ZodType<Tag, z.ZodTypeDef, unknown> = z.object({
9
+ export const Tag$zodSchema: z.ZodType<Tag> = z.object({
10
10
  id: z.string().optional(),
11
11
  name: z.string().optional(),
12
12
  });
@@ -16,11 +16,7 @@ export type TagCategory = {
16
16
  tagGroups?: TagGroups | undefined;
17
17
  };
18
18
 
19
- export const TagCategory$zodSchema: z.ZodType<
20
- TagCategory,
21
- z.ZodTypeDef,
22
- unknown
23
- > = z.object({
19
+ export const TagCategory$zodSchema: z.ZodType<TagCategory> = z.object({
24
20
  id: z.string().optional(),
25
21
  name: z.string().optional(),
26
22
  tagGroups: TagGroups$zodSchema.optional(),
@@ -6,8 +6,7 @@ import * as z from "zod";
6
6
 
7
7
  export type TagGroup = { name?: string | undefined; id?: string | undefined };
8
8
 
9
- export const TagGroup$zodSchema: z.ZodType<TagGroup, z.ZodTypeDef, unknown> = z
10
- .object({
11
- id: z.string().optional(),
12
- name: z.string().optional(),
13
- });
9
+ export const TagGroup$zodSchema: z.ZodType<TagGroup> = z.object({
10
+ id: z.string().optional(),
11
+ name: z.string().optional(),
12
+ });
@@ -7,7 +7,6 @@ import { TagGroup, TagGroup$zodSchema } from "./taggroup.js";
7
7
 
8
8
  export type TagGroups = { tagGroup?: Array<TagGroup> | undefined };
9
9
 
10
- export const TagGroups$zodSchema: z.ZodType<TagGroups, z.ZodTypeDef, unknown> =
11
- z.object({
12
- tagGroup: z.array(TagGroup$zodSchema).optional(),
13
- });
10
+ export const TagGroups$zodSchema: z.ZodType<TagGroups> = z.object({
11
+ tagGroup: z.array(TagGroup$zodSchema).optional(),
12
+ });
@@ -7,6 +7,6 @@ import { Tag, Tag$zodSchema } from "./tag.js";
7
7
 
8
8
  export type Tags = { tag?: Array<Tag> | undefined };
9
9
 
10
- export const Tags$zodSchema: z.ZodType<Tags, z.ZodTypeDef, unknown> = z.object({
10
+ export const Tags$zodSchema: z.ZodType<Tags> = z.object({
11
11
  tag: z.array(Tag$zodSchema).optional(),
12
12
  });
@@ -12,10 +12,6 @@ export type TopicBreadcrumb = {
12
12
  topicSummary?: Array<TopicSummary> | undefined;
13
13
  };
14
14
 
15
- export const TopicBreadcrumb$zodSchema: z.ZodType<
16
- TopicBreadcrumb,
17
- z.ZodTypeDef,
18
- unknown
19
- > = z.object({
15
+ export const TopicBreadcrumb$zodSchema: z.ZodType<TopicBreadcrumb> = z.object({
20
16
  topicSummary: z.array(TopicSummary$zodSchema).optional(),
21
17
  }).describe("This schema contains one or more TopicSummary instances.");
@@ -14,11 +14,7 @@ export type TopicSummary = {
14
14
  link?: Link | undefined;
15
15
  };
16
16
 
17
- export const TopicSummary$zodSchema: z.ZodType<
18
- TopicSummary,
19
- z.ZodTypeDef,
20
- unknown
21
- > = z.object({
17
+ export const TopicSummary$zodSchema: z.ZodType<TopicSummary> = z.object({
22
18
  id: z.string().optional(),
23
19
  link: Link$zodSchema.optional(),
24
20
  name: z.string().optional(),
@@ -10,7 +10,6 @@ import { Stage, Stage$zodSchema } from "./stage.js";
10
10
  */
11
11
  export type Workflow = { stages?: Array<Stage> | undefined };
12
12
 
13
- export const Workflow$zodSchema: z.ZodType<Workflow, z.ZodTypeDef, unknown> = z
14
- .object({
15
- stages: z.array(Stage$zodSchema).optional(),
16
- }).describe("The Article's workflow.");
13
+ export const Workflow$zodSchema: z.ZodType<Workflow> = z.object({
14
+ stages: z.array(Stage$zodSchema).optional(),
15
+ }).describe("The Article's workflow.");
@@ -3,11 +3,17 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const WorkflowMilestone = {
9
+ Authoring: "authoring",
10
+ Staging: "staging",
11
+ Publish: "publish",
12
+ } as const;
13
+ export type WorkflowMilestone = ClosedEnum<typeof WorkflowMilestone>;
6
14
 
7
15
  export const WorkflowMilestone$zodSchema = z.enum([
8
16
  "authoring",
9
17
  "staging",
10
18
  "publish",
11
19
  ]);
12
-
13
- export type WorkflowMilestone = z.infer<typeof WorkflowMilestone$zodSchema>;
@@ -6,11 +6,10 @@ import * as z from "zod";
6
6
 
7
7
  export type Detail = { key: string; value?: string | undefined };
8
8
 
9
- export const Detail$zodSchema: z.ZodType<Detail, z.ZodTypeDef, unknown> = z
10
- .object({
11
- key: z.string(),
12
- value: z.string().optional(),
13
- });
9
+ export const Detail$zodSchema: z.ZodType<Detail> = z.object({
10
+ key: z.string(),
11
+ value: z.string().optional(),
12
+ });
14
13
 
15
14
  /**
16
15
  * Bad Request
@@ -22,11 +21,7 @@ export type WSErrorCommon = {
22
21
  userMessage?: string | undefined;
23
22
  };
24
23
 
25
- export const WSErrorCommon$zodSchema: z.ZodType<
26
- WSErrorCommon,
27
- z.ZodTypeDef,
28
- unknown
29
- > = z.object({
24
+ export const WSErrorCommon$zodSchema: z.ZodType<WSErrorCommon> = z.object({
30
25
  code: z.string(),
31
26
  details: z.array(z.lazy(() => Detail$zodSchema)).optional(),
32
27
  developerMessage: z.string(),
@@ -0,0 +1,35 @@
1
+ // Auto-generated at build time
2
+ export const toolNames: Array<{ name: string; description: string }>= [
3
+ {
4
+ "name": "retrieve-chunks",
5
+ "description": "Retrieve Chunks\n\nRetrieve Chunks\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.\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.\nBy leveraging the Retrieve API, organizations can build tailored experiences while retaining confidence in the source material.\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., \"PROD-1004\")\n\n## How to Use This Tool\nAll inputs must be wrapped inside a request object. Provide a search query and language. Optional filters can be used to narrow results by tags, topics, or user profile.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}`\n- Required parameters:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `q` (string) - The search query string\n - `Dollar_lang` (string) - Language code (e.g., \"en-US\")\n- Optional parameters:\n - `dollarFilterUserProfileID` (string) - User profile ID filter\n - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by\n - `RetrieveRequest` (object) - Additional request body parameters:\n - `channel` (object) - Channel information (optional, recommended to omit)\n - `eventId` (string) - Event ID\n - `sessionId` (string) - Session ID\n\n**Example**: To retrieve chunks for query \"loan information\" from portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}\n```\n\n**Example with RetrieveRequest body**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"RetrieveRequest\": {\"eventId\": \"event-123\", \"sessionId\": \"session-456\"}}}\n```\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\nAlways display results. Show each article name, article ID, snippet, and relevance score. If a certified answer is returned, display it first and list its references.\n\n**Example**: \"I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]...\"\n"
6
+ },
7
+ {
8
+ "name": "get-best-answer",
9
+ "description": "Generate an Answer\n\nGet Answers\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}`\n- Required parameters:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `q` (string) - The search query string\n - `Dollar_lang` (string) - Language code (e.g., \"en-US\")\n- Optional parameters:\n - `dollarFilterUserProfileID` (string) - User profile ID filter\n - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by\n - `AnswersRequest` (object) - Request body parameters:\n - `eventId` (string, **required**) - Event ID\n - `sessionId` (string, **required**) - Session ID\n - `channel` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.\n - `context` (object) - Additional context (companyContext, pageContext, userContext)\n\n**Example**: To get answers for query \"loan information\" from portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"AnswersRequest\": {\"eventId\": \"event-123\", \"sessionId\": \"session-456\"}}}\n```\n\n**Note**: The `channel` field in `AnswersRequest` is optional and recommended to omit unless specifically needed. The API works reliably without it.\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display the `answer.answerValue` text prominently as the main answer to the user's query\n- Indicate the answer type (`answerType`: \"certified\" or \"generative\")\n- If `relevanceScore` is present, you may mention the confidence level\n- List all `references` (article IDs and names) that were used to generate the answer\n- Display `searchResults` showing related articles with their names, IDs, snippets, and relevance scores\n- Format the answer in a clear, readable way - this is the primary response the user is seeking\n\n**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]...\"\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., \"PROD-1004\")\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"
10
+ },
11
+ {
12
+ "name": "get-article-by-id",
13
+ "description": "Get Article by ID\n\nGet Article by ID\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\"}}`\n- Required parameters:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `articleID` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PROD-2996\")\n - `acceptLanguage` (string, default: \"en-US\") - Accept-Language header value\n- Optional parameters:\n - `Dollar_lang` (string, default: \"en-US\") - Language code\n - `articleAdditionalAttributes` (array) - Additional article attributes to return\n - `Dollar_customAdditionalAttributes` (string) - Custom additional attributes\n - `accessSource` (string, default: \"article_view\") - How the article was accessed\n - `publishViewId` (string) - Publish view ID\n - `workflowMilestone` (string) - Workflow milestone filter\n\n**Example**: To get article \"PROD-2996\" from portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\"}}\n```\n\n**Example with optional parameters**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\", \"Dollar_lang\": \"en-US\", \"accessSource\": \"article_view\"}}\n```\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display the article `name` as the title\n- Show the article `content` or `contentText` (the full article body)\n- Display article metadata: `id`, `articleType`, `createdDate`, `modifiedDate`\n- Show `attachments` if present\n- Display `topicBreadcrumb` to show where the article is categorized\n- Include any other relevant metadata like `articleSummary`, `description`, `articleKeywords`\n- Format the article content in a readable way for the user\n\n**Example**: \"Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]...\"\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"
14
+ },
15
+ {
16
+ "name": "get-announcement-articles",
17
+ "description": "Get Announcement Articles\n\nGet Announcements\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\"}}`\n- Required parameter:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `acceptLanguage` (string, default: \"en-US\") - Accept-Language header value\n- Optional parameters:\n - `Dollar_lang` (string, default: \"en-US\") - Language code\n - `Dollar_pagesize` (number, default: 10) - Number of results per page\n\n**Example**: To get announcements from portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\"}}\n```\n\n**Example with optional parameters**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 20}}\n```\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display all announcement articles with their names and IDs\n- Show the article content (`content` or `contentText`) for each announcement\n- Display metadata such as `createdDate`, `modifiedDate`, `articleSummary`\n- Show `attachments` if present\n- Include `paginationInfo` if pagination is used\n- Format announcements in a clear list format\n\n**Example**: \"Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]...\"\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., \"PROD-1004\")\n\n## Overview\nThe 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.\n\nThis API returns announcement articles with their full content, metadata, and any associated attachments or links.\n"
18
+ },
19
+ {
20
+ "name": "get-popular-articles",
21
+ "description": "Get Popular Articles\n\nGet Popular Articles\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\"}}`\n- Required parameter:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `acceptLanguage` (string, default: \"en-US\") - Accept-Language header value\n- Optional parameters:\n - `Dollar_lang` (string, default: \"en-US\") - Language code\n - `Dollar_pagenum` (number, default: 1) - Page number for pagination\n - `Dollar_pagesize` (number, default: 10) - Number of results per page\n - `dollarFilterTopicId` (string) - Filter by topic ID\n - `dollarFilterTags` (string) - Comma-separated list of Tag/Tag Group IDs\n\n**Example**: To get popular articles from portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\"}}\n```\n\n**Example with optional parameters**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 20}}\n```\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display all popular articles with their names and IDs\n- Show article summaries or descriptions when available\n- Display metadata such as `articleType`, `createdDate`, `modifiedDate`\n- Show `imageURL` if available (mention thumbnail availability)\n- Include `paginationInfo` if pagination is used\n- Format articles in a numbered or bulleted list\n\n**Example**: \"Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]...\"\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 Popular Articles API allows a user to retrieve the most popular articles from a specific portal. Popular articles are typically determined by user engagement metrics such as views, ratings, or usage frequency.\n\nThis API returns a list of popular articles with their metadata, allowing users to discover the most relevant and frequently accessed content within the portal.\n"
22
+ },
23
+ {
24
+ "name": "get-my-portals",
25
+ "description": "Get All Portals Accessible To User\n\nGet All Portals Accessible to User\n\n## Overview\nRetrieves the list of portals available to the authenticated user or application. Each portal contains a readable portal ID that is required by almost all other Portal Manager APIs.\n\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## Prerequisites\nAuthentication is required. No portal ID is needed for this call. This is typically the first API you should call before using any other tool.\n\n## How to Use This Tool\n- Call this endpoint to discover which portals you have access to. Use the returned portal IDs as inputs to Retrieve, Answers, Search, Article, and Suggestion APIs.\n\n## Parameter Requirements\nThis tool requires **both** a query language parameter **and** an HTTP language header. An empty request object is **invalid** and MUST NOT be used.\n\n### Required (both MUST be provided)\n- `Dollar_lang` (string, default: \"en-US\") - Language code\n- `Accept-Language` (string, default: \"en-US\") - Accept-Language header value\n\nBoth parameters **MUST** be present on every invocation. \nIf either parameter is missing, the request is invalid.\n\n#### Optional\n\n- `Dollar_pagenum` — Page number to retrieve (defaults to `1` if omitted)\n- `Dollar_pagesize` — Number of items per page (server default applied if omitted)\n\n**Example**: To get all portals accessible to the user, call with:\n```json\n{\"request\": {\"Dollar_lang\": \"en-US\", \"Accept-Language\": \"en-US\"}}\n```\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\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\n## Displaying Results (MCP-Specific)\nAlways display the list of portals returned. Show portal name, portal ID, and any descriptive metadata. If multiple portals exist, prompt the user to select one for subsequent calls.\n"
26
+ },
27
+ {
28
+ "name": "ai-search",
29
+ "description": "Hybrid Search\n\nHybrid Search\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\"}}`\n- Required parameters:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `q` (string) - The search query string (must be URL-escaped)\n- Optional parameters:\n - `Dollar_lang` (string, default: \"en-US\") - Language code\n - `dollarFilterUserProfileID` (string) - User profile ID filter\n - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by\n - `articleCustomAdditionalAttributes` (string) - Comma-separated custom attribute names\n - `Dollar_pagenum` (number, default: 1) - Page number for pagination\n - `Dollar_pagesize` (number, default: 20) - Number of results per page\n\n**Example**: To search for \"loan information\" in portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\"}}\n```\n\n**Example with optional parameters**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 25}}\n```\n\n**Note**: This endpoint is only available for Self Service environments.\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display all search results with article names and IDs\n- Show article `snippet` or `keywordSnippet` (the relevant text excerpt)\n- Display `normalizedScore` or `relevanceScore` to indicate relevance\n- Show `docType`, `source`, and `topicBreadcrumb` metadata\n- Display `contextualSummary` if available\n- Include `paginationInfo` if pagination is used\n- Format results in a numbered list with clear relevance indicators\n\n**Example**: \"I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)...\"\n\n## Overview\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.\n"
30
+ },
31
+ {
32
+ "name": "make-suggestion",
33
+ "description": "Make a Suggestion\n\nMake a Suggestion\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.\n\n**Parameter Format**: \n- Always wrap parameters in a `request` object: `{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {...}}}`\n- Required parameters:\n - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - `CreateSuggestion` (object) - The suggestion object with:\n - `name` (string, **required**) - Name/title of the suggestion\n - `content` (string, **required**) - Content/description of the suggestion\n - `language` (object, **required**) - Language object with `code` property (e.g., {\"code\": \"en-US\"})\n - `acceptLanguage` (string, default: \"en-US\") - Accept-Language header value\n\n- Optional parameters:\n - `CreateSuggestion` additional optional fields:\n - `description` (string) - Additional description\n - `feedbackArticle` (object) - Article ID object if providing feedback on existing article: `{\"id\": \"PROD-2996\"}`\n - `attachments` (object) - Attachments object\n - `customAttributes` (array) - Custom attributes array\n\n**Example**: To create a suggestion in portal \"PZ-9999\", call with:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {\"name\": \"New Article Request\", \"content\": \"Please add information about loan rates\", \"language\": {\"code\": \"en-US\"}}}}\n```\n\n**Example with feedback on existing article**:\n```json\n{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {\"name\": \"Article Feedback\", \"content\": \"This article needs updating\", \"language\": {\"code\": \"en-US\"}, \"feedbackArticle\": {\"id\": \"PROD-2996\"}}}}\n```\n\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Confirm that the suggestion was successfully created\n- Display the suggestion `id` if returned in the response\n- Show the suggestion `name` and `content` that was submitted\n- If an error occurs, display the error message clearly\n- Provide confirmation message to the user\n\n**Example**: \"Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [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\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"
34
+ }
35
+ ];
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4";
6
+
7
+ export function bigint(): z.ZodType<bigint | string> {
8
+ return z.union([
9
+ z.bigint().transform((v) => String(v)),
10
+ z.string().transform((v, ctx) => {
11
+ try {
12
+ return BigInt(v);
13
+ } catch {
14
+ ctx.addIssue({
15
+ code: z.ZodIssueCode.custom,
16
+ message: "Invalid bigint value",
17
+ });
18
+ return z.NEVER;
19
+ }
20
+ }),
21
+ z.number().transform((v) => BigInt(Math.trunc(v))),
22
+ z.union([z.null(), z.undefined()]).transform(() => BigInt(0)),
23
+ ]);
24
+ }
25
+
26
+ export function bigintOptional(): z.ZodType<bigint | string | undefined> {
27
+ return z.union([
28
+ z.bigint().transform((v) => String(v)),
29
+ z.string().transform((v, ctx) => {
30
+ try {
31
+ return BigInt(v);
32
+ } catch {
33
+ ctx.addIssue({
34
+ code: z.ZodIssueCode.custom,
35
+ message: "Invalid bigint value",
36
+ });
37
+ return z.NEVER;
38
+ }
39
+ }),
40
+ z.number().transform((v) => BigInt(Math.trunc(v))),
41
+ z.undefined(),
42
+ z.null().transform(() => undefined),
43
+ ]);
44
+ }
45
+
46
+ export function bigintNullable(): z.ZodType<bigint | string | null> {
47
+ return z.union([
48
+ z.bigint().transform((v) => String(v)),
49
+ z.string().transform((v, ctx) => {
50
+ try {
51
+ return BigInt(v);
52
+ } catch {
53
+ ctx.addIssue({
54
+ code: z.ZodIssueCode.custom,
55
+ message: "Invalid bigint value",
56
+ });
57
+ return z.NEVER;
58
+ }
59
+ }),
60
+ z.number().transform((v) => BigInt(Math.trunc(v))),
61
+ z.null(),
62
+ z.undefined().transform(() => null),
63
+ ]);
64
+ }
65
+
66
+ export function bigintConst<T extends bigint>(value: T): z.ZodType<T> {
67
+ return z
68
+ .union([
69
+ z.bigint(),
70
+ z.string().transform((v, ctx) => {
71
+ try {
72
+ return BigInt(v);
73
+ } catch {
74
+ ctx.addIssue({
75
+ code: z.ZodIssueCode.custom,
76
+ message: "Invalid bigint value",
77
+ });
78
+ return z.NEVER;
79
+ }
80
+ }),
81
+ z.number().transform((v) => BigInt(Math.trunc(v))),
82
+ ])
83
+ .refine((v) => v === value, {
84
+ message: `Value must be ${value}`,
85
+ })
86
+ .transform(() => value as T);
87
+ }