@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.
- package/README.md +20 -43
- package/bin/mcp-server.js +39534 -29516
- package/bin/mcp-server.js.map +298 -185
- package/esm/src/cloudflare-worker/cloudflare-worker.d.ts.map +1 -1
- package/esm/src/cloudflare-worker/cloudflare-worker.js +20 -9
- package/esm/src/cloudflare-worker/cloudflare-worker.js.map +1 -1
- package/esm/src/funcs/aiSearch.d.ts +63 -0
- package/esm/src/funcs/aiSearch.d.ts.map +1 -0
- package/esm/src/funcs/aiSearch.js +151 -0
- package/esm/src/funcs/aiSearch.js.map +1 -0
- package/esm/src/funcs/getAnnouncementArticles.d.ts +61 -0
- package/esm/src/funcs/getAnnouncementArticles.d.ts.map +1 -0
- package/esm/src/funcs/getAnnouncementArticles.js +152 -0
- package/esm/src/funcs/getAnnouncementArticles.js.map +1 -0
- package/esm/src/funcs/getAnnouncements.d.ts +39 -1
- package/esm/src/funcs/getAnnouncements.d.ts.map +1 -1
- package/esm/src/funcs/getAnnouncements.js +39 -1
- package/esm/src/funcs/getAnnouncements.js.map +1 -1
- package/esm/src/funcs/getArticle.d.ts +42 -0
- package/esm/src/funcs/getArticle.d.ts.map +1 -1
- package/esm/src/funcs/getArticle.js +42 -0
- package/esm/src/funcs/getArticle.js.map +1 -1
- package/esm/src/funcs/getArticleById.d.ts +70 -0
- package/esm/src/funcs/getArticleById.d.ts.map +1 -0
- package/esm/src/funcs/getArticleById.js +163 -0
- package/esm/src/funcs/getArticleById.js.map +1 -0
- package/esm/src/funcs/getBestAnswer.d.ts +66 -0
- package/esm/src/funcs/getBestAnswer.d.ts.map +1 -0
- package/esm/src/funcs/getBestAnswer.js +148 -0
- package/esm/src/funcs/getBestAnswer.js.map +1 -0
- package/esm/src/funcs/getMyPortals.d.ts +97 -0
- package/esm/src/funcs/getMyPortals.d.ts.map +1 -0
- package/esm/src/funcs/getMyPortals.js +180 -0
- package/esm/src/funcs/getMyPortals.js.map +1 -0
- package/esm/src/funcs/getPopularArticles.d.ts +39 -0
- package/esm/src/funcs/getPopularArticles.d.ts.map +1 -1
- package/esm/src/funcs/getPopularArticles.js +47 -3
- package/esm/src/funcs/getPopularArticles.js.map +1 -1
- package/esm/src/funcs/getPortals.d.ts +26 -1
- package/esm/src/funcs/getPortals.d.ts.map +1 -1
- package/esm/src/funcs/getPortals.js +35 -10
- package/esm/src/funcs/getPortals.js.map +1 -1
- package/esm/src/funcs/makeSuggestion.d.ts +46 -2
- package/esm/src/funcs/makeSuggestion.d.ts.map +1 -1
- package/esm/src/funcs/makeSuggestion.js +51 -3
- package/esm/src/funcs/makeSuggestion.js.map +1 -1
- package/esm/src/funcs/queryAnswers.d.ts +41 -5
- package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
- package/esm/src/funcs/queryAnswers.js +41 -5
- package/esm/src/funcs/queryAnswers.js.map +1 -1
- package/esm/src/funcs/queryRetrieve.d.ts +41 -1
- package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
- package/esm/src/funcs/queryRetrieve.js +41 -1
- package/esm/src/funcs/queryRetrieve.js.map +1 -1
- package/esm/src/funcs/querySearch.d.ts +48 -1
- package/esm/src/funcs/querySearch.d.ts.map +1 -1
- package/esm/src/funcs/querySearch.js +48 -1
- package/esm/src/funcs/querySearch.js.map +1 -1
- package/esm/src/funcs/retrieveChunks.d.ts +41 -7
- package/esm/src/funcs/retrieveChunks.d.ts.map +1 -1
- package/esm/src/funcs/retrieveChunks.js +45 -19
- package/esm/src/funcs/retrieveChunks.js.map +1 -1
- package/esm/src/hooks/auth-hook.d.ts +1 -2
- package/esm/src/hooks/auth-hook.d.ts.map +1 -1
- package/esm/src/hooks/auth-hook.js +1 -65
- package/esm/src/hooks/auth-hook.js.map +1 -1
- package/esm/src/hooks/registration.d.ts.map +1 -1
- package/esm/src/hooks/registration.js +2 -16
- package/esm/src/hooks/registration.js.map +1 -1
- package/esm/src/landing-page.d.ts +5 -0
- package/esm/src/landing-page.d.ts.map +1 -0
- package/esm/src/landing-page.js +1070 -0
- package/esm/src/landing-page.js.map +1 -0
- package/esm/src/lib/base64.d.ts +2 -2
- package/esm/src/lib/base64.d.ts.map +1 -1
- package/esm/src/lib/base64.js +2 -2
- package/esm/src/lib/base64.js.map +1 -1
- package/esm/src/lib/config.d.ts +3 -3
- package/esm/src/lib/config.js +5 -5
- package/esm/src/lib/config.js.map +1 -1
- package/esm/src/lib/encodings.d.ts.map +1 -1
- package/esm/src/lib/encodings.js +10 -1
- package/esm/src/lib/encodings.js.map +1 -1
- package/esm/src/lib/matchers.d.ts.map +1 -1
- package/esm/src/lib/matchers.js +4 -1
- package/esm/src/lib/matchers.js.map +1 -1
- package/esm/src/lib/schemas.d.ts +4 -4
- package/esm/src/lib/schemas.d.ts.map +1 -1
- package/esm/src/lib/schemas.js +2 -2
- package/esm/src/lib/schemas.js.map +1 -1
- package/esm/src/lib/sdks.js +2 -2
- package/esm/src/lib/sdks.js.map +1 -1
- package/esm/src/lib/security.d.ts.map +1 -1
- package/esm/src/lib/security.js +18 -0
- package/esm/src/lib/security.js.map +1 -1
- package/esm/src/mcp-server/cli/start/command.d.ts.map +1 -1
- package/esm/src/mcp-server/cli/start/command.js +30 -0
- package/esm/src/mcp-server/cli/start/command.js.map +1 -1
- package/esm/src/mcp-server/cli/start/impl.d.ts +2 -7
- package/esm/src/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/esm/src/mcp-server/cli/start/impl.js +98 -22
- package/esm/src/mcp-server/cli/start/impl.js.map +1 -1
- package/esm/src/mcp-server/extensions.d.ts +4 -4
- package/esm/src/mcp-server/extensions.d.ts.map +1 -1
- package/esm/src/mcp-server/flags.d.ts +17 -0
- package/esm/src/mcp-server/flags.d.ts.map +1 -0
- package/esm/src/mcp-server/flags.js +5 -0
- package/esm/src/mcp-server/flags.js.map +1 -0
- package/esm/src/mcp-server/mcp-server.js +1 -1
- package/esm/src/mcp-server/mcp-server.js.map +1 -1
- package/esm/src/mcp-server/prompts.d.ts +4 -7
- package/esm/src/mcp-server/prompts.d.ts.map +1 -1
- package/esm/src/mcp-server/prompts.js.map +1 -1
- package/esm/src/mcp-server/server.d.ts +8 -1
- package/esm/src/mcp-server/server.d.ts.map +1 -1
- package/esm/src/mcp-server/server.js +19 -16
- package/esm/src/mcp-server/server.js.map +1 -1
- package/esm/src/mcp-server/tools/aiSearch.d.ts +7 -0
- package/esm/src/mcp-server/tools/aiSearch.d.ts.map +1 -0
- package/esm/src/mcp-server/tools/aiSearch.js +83 -0
- package/esm/src/mcp-server/tools/aiSearch.js.map +1 -0
- package/esm/src/mcp-server/tools/getAnnouncementArticles.d.ts +7 -0
- package/esm/src/mcp-server/tools/getAnnouncementArticles.d.ts.map +1 -0
- package/esm/src/mcp-server/tools/getAnnouncementArticles.js +81 -0
- package/esm/src/mcp-server/tools/getAnnouncementArticles.js.map +1 -0
- package/esm/src/mcp-server/tools/getAnnouncements.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/getAnnouncements.js +39 -1
- package/esm/src/mcp-server/tools/getAnnouncements.js.map +1 -1
- package/esm/src/mcp-server/tools/getArticle.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/getArticle.js +42 -0
- package/esm/src/mcp-server/tools/getArticle.js.map +1 -1
- package/esm/src/mcp-server/tools/getArticleById.d.ts +7 -0
- package/esm/src/mcp-server/tools/getArticleById.d.ts.map +1 -0
- package/esm/src/mcp-server/tools/getArticleById.js +90 -0
- package/esm/src/mcp-server/tools/getArticleById.js.map +1 -0
- package/esm/src/mcp-server/tools/getBestAnswer.d.ts +7 -0
- package/esm/src/mcp-server/tools/getBestAnswer.d.ts.map +1 -0
- package/esm/src/mcp-server/tools/getBestAnswer.js +85 -0
- package/esm/src/mcp-server/tools/getBestAnswer.js.map +1 -0
- package/esm/src/mcp-server/tools/getMyPortals.d.ts +7 -0
- package/esm/src/mcp-server/tools/getMyPortals.d.ts.map +1 -0
- package/esm/src/mcp-server/tools/getMyPortals.js +117 -0
- package/esm/src/mcp-server/tools/getMyPortals.js.map +1 -0
- package/esm/src/mcp-server/tools/getPopularArticles.d.ts +1 -1
- package/esm/src/mcp-server/tools/getPopularArticles.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/getPopularArticles.js +40 -0
- package/esm/src/mcp-server/tools/getPopularArticles.js.map +1 -1
- package/esm/src/mcp-server/tools/getPortals.d.ts +1 -1
- package/esm/src/mcp-server/tools/getPortals.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/getPortals.js +26 -1
- package/esm/src/mcp-server/tools/getPortals.js.map +1 -1
- package/esm/src/mcp-server/tools/makeSuggestion.d.ts +1 -1
- package/esm/src/mcp-server/tools/makeSuggestion.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/makeSuggestion.js +44 -0
- package/esm/src/mcp-server/tools/makeSuggestion.js.map +1 -1
- package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/queryAnswers.js +41 -5
- package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
- package/esm/src/mcp-server/tools/queryRetrieve.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/queryRetrieve.js +41 -1
- package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
- package/esm/src/mcp-server/tools/querySearch.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/querySearch.js +48 -1
- package/esm/src/mcp-server/tools/querySearch.js.map +1 -1
- package/esm/src/mcp-server/tools/retrieveChunks.d.ts +1 -1
- package/esm/src/mcp-server/tools/retrieveChunks.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/retrieveChunks.js +41 -7
- package/esm/src/mcp-server/tools/retrieveChunks.js.map +1 -1
- package/esm/src/mcp-server/tools.d.ts +14 -4
- package/esm/src/mcp-server/tools.d.ts.map +1 -1
- package/esm/src/mcp-server/tools.js +203 -5
- package/esm/src/mcp-server/tools.js.map +1 -1
- package/esm/src/models/acceptlanguage.d.ts +36 -5
- package/esm/src/models/acceptlanguage.d.ts.map +1 -1
- package/esm/src/models/acceptlanguage.js +18 -4
- package/esm/src/models/acceptlanguage.js.map +1 -1
- package/esm/src/models/accessibleportal.d.ts +1 -1
- package/esm/src/models/accessibleportal.d.ts.map +1 -1
- package/esm/src/models/accessibleportal.js.map +1 -1
- package/esm/src/models/additionalsnippets.d.ts +18 -3
- package/esm/src/models/additionalsnippets.d.ts.map +1 -1
- package/esm/src/models/additionalsnippets.js +8 -1
- package/esm/src/models/additionalsnippets.js.map +1 -1
- package/esm/src/models/aisearchop.d.ts +4 -10
- package/esm/src/models/aisearchop.d.ts.map +1 -1
- package/esm/src/models/aisearchop.js +9 -20
- package/esm/src/models/aisearchop.js.map +1 -1
- package/esm/src/models/aisearchresponse.d.ts +2 -2
- package/esm/src/models/aisearchresponse.d.ts.map +1 -1
- package/esm/src/models/aisearchresponse.js.map +1 -1
- package/esm/src/models/aispaginationinfo.d.ts +1 -1
- package/esm/src/models/aispaginationinfo.d.ts.map +1 -1
- package/esm/src/models/aispaginationinfo.js +5 -4
- package/esm/src/models/aispaginationinfo.js.map +1 -1
- package/esm/src/models/aitopicbreadcrumb.d.ts +1 -1
- package/esm/src/models/aitopicbreadcrumb.d.ts.map +1 -1
- package/esm/src/models/aitopicbreadcrumb.js +2 -1
- package/esm/src/models/aitopicbreadcrumb.js.map +1 -1
- package/esm/src/models/aitopicsummary.d.ts +1 -1
- package/esm/src/models/aitopicsummary.d.ts.map +1 -1
- package/esm/src/models/aitopicsummary.js.map +1 -1
- package/esm/src/models/allaccessibleportals.d.ts +1 -1
- package/esm/src/models/allaccessibleportals.d.ts.map +1 -1
- package/esm/src/models/allaccessibleportals.js +2 -1
- package/esm/src/models/allaccessibleportals.js.map +1 -1
- package/esm/src/models/answersrequest.d.ts +16 -25
- package/esm/src/models/answersrequest.d.ts.map +1 -1
- package/esm/src/models/answersrequest.js +11 -25
- package/esm/src/models/answersrequest.js.map +1 -1
- package/esm/src/models/answersresponse.d.ts +28 -7
- package/esm/src/models/answersresponse.d.ts.map +1 -1
- package/esm/src/models/answersresponse.js +8 -0
- package/esm/src/models/answersresponse.js.map +1 -1
- package/esm/src/models/article.d.ts +2 -2
- package/esm/src/models/article.d.ts.map +1 -1
- package/esm/src/models/article.js +3 -4
- package/esm/src/models/article.js.map +1 -1
- package/esm/src/models/articleadditionalattributes.d.ts +36 -2
- package/esm/src/models/articleadditionalattributes.d.ts.map +1 -1
- package/esm/src/models/articleadditionalattributes.js +17 -0
- package/esm/src/models/articleadditionalattributes.js.map +1 -1
- package/esm/src/models/articleaisearchresult.d.ts +48 -9
- package/esm/src/models/articleaisearchresult.d.ts.map +1 -1
- package/esm/src/models/articleaisearchresult.js +17 -1
- package/esm/src/models/articleaisearchresult.js.map +1 -1
- package/esm/src/models/articleattachment.d.ts +14 -3
- package/esm/src/models/articleattachment.d.ts.map +1 -1
- package/esm/src/models/articleattachment.js +7 -2
- package/esm/src/models/articleattachment.js.map +1 -1
- package/esm/src/models/articleresult.d.ts +1 -1
- package/esm/src/models/articleresult.d.ts.map +1 -1
- package/esm/src/models/articleresult.js +1 -1
- package/esm/src/models/articleresult.js.map +1 -1
- package/esm/src/models/articleresultadditionalattributes.d.ts +34 -2
- package/esm/src/models/articleresultadditionalattributes.d.ts.map +1 -1
- package/esm/src/models/articleresultadditionalattributes.js +16 -0
- package/esm/src/models/articleresultadditionalattributes.js.map +1 -1
- package/esm/src/models/articleresults.d.ts +1 -1
- package/esm/src/models/articleresults.d.ts.map +1 -1
- package/esm/src/models/articleresults.js.map +1 -1
- package/esm/src/models/articletype.d.ts +2 -7
- package/esm/src/models/articletype.d.ts.map +1 -1
- package/esm/src/models/articletype.js +2 -16
- package/esm/src/models/articletype.js.map +1 -1
- package/esm/src/models/attachmentforcreatesuggestion.d.ts +1 -1
- package/esm/src/models/attachmentforcreatesuggestion.d.ts.map +1 -1
- package/esm/src/models/attachmentforcreatesuggestion.js.map +1 -1
- package/esm/src/models/bookmarkstatus.d.ts +1 -1
- package/esm/src/models/bookmarkstatus.d.ts.map +1 -1
- package/esm/src/models/bookmarkstatus.js +1 -1
- package/esm/src/models/bookmarkstatus.js.map +1 -1
- package/esm/src/models/complianceforarticle.d.ts +3 -3
- package/esm/src/models/complianceforarticle.d.ts.map +1 -1
- package/esm/src/models/complianceforarticle.js +8 -5
- package/esm/src/models/complianceforarticle.js.map +1 -1
- package/esm/src/models/createdby.d.ts +1 -1
- package/esm/src/models/createdby.d.ts.map +1 -1
- package/esm/src/models/createdby.js.map +1 -1
- package/esm/src/models/createsuggestion.d.ts +69 -6
- package/esm/src/models/createsuggestion.d.ts.map +1 -1
- package/esm/src/models/createsuggestion.js +31 -2
- package/esm/src/models/createsuggestion.js.map +1 -1
- package/esm/src/models/customattribute.d.ts +18 -3
- package/esm/src/models/customattribute.d.ts.map +1 -1
- package/esm/src/models/customattribute.js +6 -0
- package/esm/src/models/customattribute.js.map +1 -1
- package/esm/src/models/department.d.ts +1 -1
- package/esm/src/models/department.d.ts.map +1 -1
- package/esm/src/models/department.js.map +1 -1
- package/esm/src/models/edition.d.ts +2 -2
- package/esm/src/models/edition.d.ts.map +1 -1
- package/esm/src/models/edition.js +1 -2
- package/esm/src/models/edition.js.map +1 -1
- package/esm/src/models/errors/sdkvalidationerror.d.ts +1 -1
- package/esm/src/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/esm/src/models/errors/sdkvalidationerror.js +2 -49
- package/esm/src/models/errors/sdkvalidationerror.js.map +1 -1
- package/esm/src/models/folderbreadcrumb.d.ts +1 -1
- package/esm/src/models/folderbreadcrumb.d.ts.map +1 -1
- package/esm/src/models/folderbreadcrumb.js.map +1 -1
- package/esm/src/models/foldersummary.d.ts +1 -1
- package/esm/src/models/foldersummary.d.ts.map +1 -1
- package/esm/src/models/foldersummary.js +1 -1
- package/esm/src/models/foldersummary.js.map +1 -1
- package/esm/src/models/getannouncementarticlesop.d.ts +8 -9
- package/esm/src/models/getannouncementarticlesop.d.ts.map +1 -1
- package/esm/src/models/getannouncementarticlesop.js +12 -10
- package/esm/src/models/getannouncementarticlesop.js.map +1 -1
- package/esm/src/models/getarticlebyidop.d.ts +77 -11
- package/esm/src/models/getarticlebyidop.d.ts.map +1 -1
- package/esm/src/models/getarticlebyidop.js +31 -62
- package/esm/src/models/getarticlebyidop.js.map +1 -1
- package/esm/src/models/getbestanswerop.d.ts +1 -9
- package/esm/src/models/getbestanswerop.d.ts.map +1 -1
- package/esm/src/models/getbestanswerop.js +3 -16
- package/esm/src/models/getbestanswerop.js.map +1 -1
- package/esm/src/models/getmyportalsop.d.ts +4 -10
- package/esm/src/models/getmyportalsop.d.ts.map +1 -1
- package/esm/src/models/getmyportalsop.js +9 -10
- package/esm/src/models/getmyportalsop.js.map +1 -1
- package/esm/src/models/getpopulararticlesop.d.ts +8 -9
- package/esm/src/models/getpopulararticlesop.d.ts.map +1 -1
- package/esm/src/models/getpopulararticlesop.js +12 -10
- package/esm/src/models/getpopulararticlesop.js.map +1 -1
- package/esm/src/models/l10nstring.d.ts +1 -1
- package/esm/src/models/l10nstring.d.ts.map +1 -1
- package/esm/src/models/l10nstring.js.map +1 -1
- package/esm/src/models/languagecode.d.ts +69 -2
- package/esm/src/models/languagecode.d.ts.map +1 -1
- package/esm/src/models/languagecode.js +32 -0
- package/esm/src/models/languagecode.js.map +1 -1
- package/esm/src/models/languagecodeparameter.d.ts +90 -5
- package/esm/src/models/languagecodeparameter.d.ts.map +1 -1
- package/esm/src/models/languagecodeparameter.js +45 -4
- package/esm/src/models/languagecodeparameter.js.map +1 -1
- package/esm/src/models/languagequeryparameter.d.ts +90 -5
- package/esm/src/models/languagequeryparameter.d.ts.map +1 -1
- package/esm/src/models/languagequeryparameter.js +45 -4
- package/esm/src/models/languagequeryparameter.js.map +1 -1
- package/esm/src/models/link.d.ts +1 -1
- package/esm/src/models/link.d.ts.map +1 -1
- package/esm/src/models/link.js.map +1 -1
- package/esm/src/models/makesuggestionop.d.ts +4 -9
- package/esm/src/models/makesuggestionop.d.ts.map +1 -1
- package/esm/src/models/makesuggestionop.js +3 -7
- package/esm/src/models/makesuggestionop.js.map +1 -1
- package/esm/src/models/mandatorylanguagequeryparameter.d.ts +90 -5
- package/esm/src/models/mandatorylanguagequeryparameter.d.ts.map +1 -1
- package/esm/src/models/mandatorylanguagequeryparameter.js +45 -4
- package/esm/src/models/mandatorylanguagequeryparameter.js.map +1 -1
- package/esm/src/models/milestone.d.ts +1 -1
- package/esm/src/models/milestone.d.ts.map +1 -1
- package/esm/src/models/milestone.js.map +1 -1
- package/esm/src/models/milestonename.d.ts +1 -1
- package/esm/src/models/milestonename.d.ts.map +1 -1
- package/esm/src/models/milestonename.js.map +1 -1
- package/esm/src/models/modifiedby.d.ts +1 -1
- package/esm/src/models/modifiedby.d.ts.map +1 -1
- package/esm/src/models/modifiedby.js.map +1 -1
- package/esm/src/models/order.d.ts +10 -2
- package/esm/src/models/order.d.ts.map +1 -1
- package/esm/src/models/order.js +4 -0
- package/esm/src/models/order.js.map +1 -1
- package/esm/src/models/ownedby.d.ts +1 -1
- package/esm/src/models/ownedby.d.ts.map +1 -1
- package/esm/src/models/ownedby.js +1 -2
- package/esm/src/models/ownedby.js.map +1 -1
- package/esm/src/models/paginationinfo.d.ts +1 -1
- package/esm/src/models/paginationinfo.d.ts.map +1 -1
- package/esm/src/models/paginationinfo.js +3 -3
- package/esm/src/models/paginationinfo.js.map +1 -1
- package/esm/src/models/personalization.d.ts +4 -4
- package/esm/src/models/personalization.d.ts.map +1 -1
- package/esm/src/models/personalization.js +1 -2
- package/esm/src/models/personalization.js.map +1 -1
- package/esm/src/models/publishview.d.ts +2 -2
- package/esm/src/models/publishview.d.ts.map +1 -1
- package/esm/src/models/publishview.js.map +1 -1
- package/esm/src/models/referenceresponse.d.ts +30 -5
- package/esm/src/models/referenceresponse.d.ts.map +1 -1
- package/esm/src/models/referenceresponse.js +12 -1
- package/esm/src/models/referenceresponse.js.map +1 -1
- package/esm/src/models/requiredlanguagecode.d.ts +71 -2
- package/esm/src/models/requiredlanguagecode.d.ts.map +1 -1
- package/esm/src/models/requiredlanguagecode.js +33 -0
- package/esm/src/models/requiredlanguagecode.js.map +1 -1
- package/esm/src/models/retrievechunksop.d.ts +1 -9
- package/esm/src/models/retrievechunksop.d.ts.map +1 -1
- package/esm/src/models/retrievechunksop.js +1 -15
- package/esm/src/models/retrievechunksop.js.map +1 -1
- package/esm/src/models/retrieverequest.d.ts +15 -4
- package/esm/src/models/retrieverequest.d.ts.map +1 -1
- package/esm/src/models/retrieverequest.js +4 -0
- package/esm/src/models/retrieverequest.js.map +1 -1
- package/esm/src/models/retrieveresponse.d.ts +27 -8
- package/esm/src/models/retrieveresponse.d.ts.map +1 -1
- package/esm/src/models/retrieveresponse.js +8 -1
- package/esm/src/models/retrieveresponse.js.map +1 -1
- package/esm/src/models/schemaslink.d.ts +1 -1
- package/esm/src/models/schemaslink.d.ts.map +1 -1
- package/esm/src/models/schemaslink.js.map +1 -1
- package/esm/src/models/schemastags.d.ts +1 -1
- package/esm/src/models/schemastags.d.ts.map +1 -1
- package/esm/src/models/schemastags.js.map +1 -1
- package/esm/src/models/searchresult.d.ts +40 -5
- package/esm/src/models/searchresult.d.ts.map +1 -1
- package/esm/src/models/searchresult.js +19 -0
- package/esm/src/models/searchresult.js.map +1 -1
- package/esm/src/models/security.d.ts +5 -2
- package/esm/src/models/security.d.ts.map +1 -1
- package/esm/src/models/security.js +5 -3
- package/esm/src/models/security.js.map +1 -1
- package/esm/src/models/shorturl.d.ts +1 -1
- package/esm/src/models/shorturl.d.ts.map +1 -1
- package/esm/src/models/shorturl.js +1 -2
- package/esm/src/models/shorturl.js.map +1 -1
- package/esm/src/models/sortidnamedepartment.d.ts +12 -2
- package/esm/src/models/sortidnamedepartment.d.ts.map +1 -1
- package/esm/src/models/sortidnamedepartment.js +5 -0
- package/esm/src/models/sortidnamedepartment.js.map +1 -1
- package/esm/src/models/stage.d.ts +1 -1
- package/esm/src/models/stage.d.ts.map +1 -1
- package/esm/src/models/stage.js +1 -2
- package/esm/src/models/stage.js.map +1 -1
- package/esm/src/models/structuredauthoringfields.d.ts +1 -1
- package/esm/src/models/structuredauthoringfields.d.ts.map +1 -1
- package/esm/src/models/structuredauthoringfields.js.map +1 -1
- package/esm/src/models/tag.d.ts +1 -1
- package/esm/src/models/tag.d.ts.map +1 -1
- package/esm/src/models/tag.js.map +1 -1
- package/esm/src/models/tagcategory.d.ts +1 -1
- package/esm/src/models/tagcategory.d.ts.map +1 -1
- package/esm/src/models/tagcategory.js.map +1 -1
- package/esm/src/models/taggroup.d.ts +1 -1
- package/esm/src/models/taggroup.d.ts.map +1 -1
- package/esm/src/models/taggroup.js +1 -2
- package/esm/src/models/taggroup.js.map +1 -1
- package/esm/src/models/taggroups.d.ts +1 -1
- package/esm/src/models/taggroups.d.ts.map +1 -1
- package/esm/src/models/taggroups.js.map +1 -1
- package/esm/src/models/tags.d.ts +1 -1
- package/esm/src/models/tags.d.ts.map +1 -1
- package/esm/src/models/tags.js.map +1 -1
- package/esm/src/models/topicbreadcrumb.d.ts +1 -1
- package/esm/src/models/topicbreadcrumb.d.ts.map +1 -1
- package/esm/src/models/topicbreadcrumb.js.map +1 -1
- package/esm/src/models/topicsummary.d.ts +1 -1
- package/esm/src/models/topicsummary.d.ts.map +1 -1
- package/esm/src/models/topicsummary.js.map +1 -1
- package/esm/src/models/workflow.d.ts +1 -1
- package/esm/src/models/workflow.d.ts.map +1 -1
- package/esm/src/models/workflow.js +1 -2
- package/esm/src/models/workflow.js.map +1 -1
- package/esm/src/models/workflowmilestone.d.ts +12 -2
- package/esm/src/models/workflowmilestone.d.ts.map +1 -1
- package/esm/src/models/workflowmilestone.js +5 -0
- package/esm/src/models/workflowmilestone.js.map +1 -1
- package/esm/src/models/wserrorcommon.d.ts +2 -2
- package/esm/src/models/wserrorcommon.d.ts.map +1 -1
- package/esm/src/models/wserrorcommon.js +1 -2
- package/esm/src/models/wserrorcommon.js.map +1 -1
- package/esm/src/tool-names.d.ts +5 -0
- package/esm/src/tool-names.d.ts.map +1 -0
- package/esm/src/tool-names.js +36 -0
- package/esm/src/tool-names.js.map +1 -0
- package/esm/src/types/bigint.d.ts +6 -0
- package/esm/src/types/bigint.d.ts.map +1 -0
- package/esm/src/types/bigint.js +87 -0
- package/esm/src/types/bigint.js.map +1 -0
- package/esm/worker-configuration.d.ts +1 -0
- package/esm/worker-configuration.d.ts.map +1 -1
- package/manifest.json +78 -51
- package/package.json +11 -7
- package/src/cloudflare-worker/cloudflare-worker.ts +22 -9
- package/src/funcs/{querySearch.ts → aiSearch.ts} +49 -2
- package/src/funcs/{getAnnouncements.ts → getAnnouncementArticles.ts} +67 -10
- package/src/funcs/{getArticle.ts → getArticleById.ts} +58 -1
- package/src/funcs/{queryAnswers.ts → getBestAnswer.ts} +52 -14
- package/src/funcs/{getPortals.ts → getMyPortals.ts} +35 -2
- package/src/funcs/getPopularArticles.ts +68 -8
- package/src/funcs/makeSuggestion.ts +67 -9
- package/src/funcs/{queryRetrieve.ts → retrieveChunks.ts} +50 -15
- package/src/hooks/auth-hook.ts +3 -63
- package/src/hooks/registration.ts +3 -18
- package/src/landing-page.ts +1084 -0
- package/src/lib/base64.ts +2 -2
- package/src/lib/config.ts +5 -5
- package/src/lib/encodings.ts +12 -3
- package/src/lib/matchers.ts +5 -1
- package/src/lib/schemas.ts +10 -22
- package/src/lib/sdks.ts +2 -2
- package/src/lib/security.ts +21 -0
- package/src/mcp-server/cli/start/command.ts +31 -0
- package/src/mcp-server/cli/start/impl.ts +118 -31
- package/src/mcp-server/extensions.ts +6 -4
- package/src/mcp-server/flags.ts +21 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +9 -19
- package/src/mcp-server/server.ts +22 -16
- package/src/mcp-server/tools/aiSearch.ts +92 -0
- package/src/mcp-server/tools/getAnnouncementArticles.ts +90 -0
- package/src/mcp-server/tools/getArticleById.ts +99 -0
- package/src/mcp-server/tools/getBestAnswer.ts +94 -0
- package/src/mcp-server/tools/{getPortals.ts → getMyPortals.ts} +39 -5
- package/src/mcp-server/tools/getPopularArticles.ts +40 -0
- package/src/mcp-server/tools/makeSuggestion.ts +44 -0
- package/src/mcp-server/tools/retrieveChunks.ts +89 -0
- package/src/mcp-server/tools.ts +300 -46
- package/src/models/acceptlanguage.ts +21 -8
- package/src/models/accessibleportal.ts +9 -11
- package/src/models/additionalsnippets.ts +25 -18
- package/src/models/aisearchop.ts +14 -37
- package/src/models/aisearchresponse.ts +7 -13
- package/src/models/aispaginationinfo.ts +7 -10
- package/src/models/aitopicbreadcrumb.ts +4 -7
- package/src/models/aitopicsummary.ts +1 -5
- package/src/models/allaccessibleportals.ts +5 -8
- package/src/models/answersrequest.ts +22 -58
- package/src/models/answersresponse.ts +30 -24
- package/src/models/article.ts +39 -40
- package/src/models/articleadditionalattributes.ts +22 -4
- package/src/models/articleaisearchresult.ts +70 -52
- package/src/models/articleattachment.ts +18 -15
- package/src/models/articleresult.ts +2 -6
- package/src/models/articleresultadditionalattributes.ts +43 -0
- package/src/models/articleresults.ts +1 -5
- package/src/models/articletype.ts +4 -25
- package/src/models/attachmentforcreatesuggestion.ts +1 -3
- package/src/models/bookmarkstatus.ts +2 -6
- package/src/models/complianceforarticle.ts +13 -22
- package/src/models/createdby.ts +7 -8
- package/src/models/createsuggestion.ts +54 -31
- package/src/models/customattribute.ts +13 -7
- package/src/models/department.ts +1 -5
- package/src/models/edition.ts +8 -13
- package/src/models/errors/sdkvalidationerror.ts +2 -57
- package/src/models/folderbreadcrumb.ts +5 -7
- package/src/models/foldersummary.ts +2 -6
- package/src/models/getannouncementarticlesop.ts +34 -23
- package/src/models/getarticlebyidop.ts +91 -95
- package/src/models/getbestanswerop.ts +16 -48
- package/src/models/getmyportalsop.ts +29 -44
- package/src/models/getpopulararticlesop.ts +34 -23
- package/src/models/l10nstring.ts +1 -5
- package/src/models/languagecode.ts +38 -2
- package/src/models/languagecodeparameter.ts +48 -10
- package/src/models/languagequeryparameter.ts +48 -10
- package/src/models/link.ts +1 -1
- package/src/models/makesuggestionop.ts +20 -30
- package/src/models/mandatorylanguagequeryparameter.ts +50 -10
- package/src/models/milestone.ts +3 -4
- package/src/models/milestonename.ts +1 -5
- package/src/models/modifiedby.ts +1 -5
- package/src/models/order.ts +7 -2
- package/src/models/ownedby.ts +7 -8
- package/src/models/paginationinfo.ts +4 -8
- package/src/models/personalization.ts +6 -19
- package/src/models/publishview.ts +2 -8
- package/src/models/referenceresponse.ts +34 -20
- package/src/models/requiredlanguagecode.ts +39 -4
- package/src/models/retrievechunksop.ts +16 -48
- package/src/models/retrieverequest.ts +12 -10
- package/src/models/retrieveresponse.ts +34 -28
- package/src/models/schemaslink.ts +1 -5
- package/src/models/schemastags.ts +1 -5
- package/src/models/searchresult.ts +34 -8
- package/src/models/security.ts +14 -7
- package/src/models/shorturl.ts +6 -7
- package/src/models/sortidnamedepartment.ts +8 -4
- package/src/models/stage.ts +4 -5
- package/src/models/structuredauthoringfields.ts +1 -3
- package/src/models/tag.ts +1 -1
- package/src/models/tagcategory.ts +1 -5
- package/src/models/taggroup.ts +4 -5
- package/src/models/taggroups.ts +3 -4
- package/src/models/tags.ts +1 -1
- package/src/models/topicbreadcrumb.ts +1 -5
- package/src/models/topicsummary.ts +1 -5
- package/src/models/workflow.ts +3 -4
- package/src/models/workflowmilestone.ts +8 -2
- package/src/models/wserrorcommon.ts +5 -10
- package/src/tool-names.ts +35 -0
- package/src/types/bigint.ts +87 -0
- package/tsconfig.json +0 -1
- package/worker-configuration.d.ts +2 -2
- package/worker-configuration.ts +1 -0
- package/src/cloudflare-worker/landing-page.ts +0 -337
- package/src/hooks/portal-cache-hook.ts +0 -505
- package/src/hooks/portal-lookup-hook.ts +0 -429
- package/src/mcp-server/tools/getAnnouncements.ts +0 -53
- package/src/mcp-server/tools/getArticle.ts +0 -56
- package/src/mcp-server/tools/queryAnswers.ts +0 -57
- package/src/mcp-server/tools/queryRetrieve.ts +0 -55
- package/src/mcp-server/tools/querySearch.ts +0 -44
|
@@ -32,9 +32,56 @@ import { Result } from "../types/fp.js";
|
|
|
32
32
|
* Hybrid Search
|
|
33
33
|
*
|
|
34
34
|
* @remarks
|
|
35
|
-
*
|
|
35
|
+
* Hybrid Search
|
|
36
|
+
*
|
|
37
|
+
* ## How to Use This Tool
|
|
38
|
+
*
|
|
39
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
40
|
+
*
|
|
41
|
+
* **Parameter Format**:
|
|
42
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "q": "loan information"}}`
|
|
43
|
+
* - Required parameters:
|
|
44
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
45
|
+
* - `q` (string) - The search query string (must be URL-escaped)
|
|
46
|
+
* - Optional parameters:
|
|
47
|
+
* - `Dollar_lang` (string, default: "en-US") - Language code
|
|
48
|
+
* - `dollarFilterUserProfileID` (string) - User profile ID filter
|
|
49
|
+
* - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
|
|
50
|
+
* - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by
|
|
51
|
+
* - `articleCustomAdditionalAttributes` (string) - Comma-separated custom attribute names
|
|
52
|
+
* - `Dollar_pagenum` (number, default: 1) - Page number for pagination
|
|
53
|
+
* - `Dollar_pagesize` (number, default: 20) - Number of results per page
|
|
54
|
+
*
|
|
55
|
+
* **Example**: To search for "loan information" in portal "PZ-9999", call with:
|
|
56
|
+
* ```json
|
|
57
|
+
* {"request": {"portalID": "PZ-9999", "q": "loan information"}}
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* **Example with optional parameters**:
|
|
61
|
+
* ```json
|
|
62
|
+
* {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "Dollar_pagesize": 25}}
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* **Note**: This endpoint is only available for Self Service environments.
|
|
66
|
+
*
|
|
67
|
+
* ## Displaying Results (MCP-Specific)
|
|
68
|
+
* **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.
|
|
69
|
+
*
|
|
70
|
+
* **What to display:**
|
|
71
|
+
* - Display all search results with article names and IDs
|
|
72
|
+
* - Show article `snippet` or `keywordSnippet` (the relevant text excerpt)
|
|
73
|
+
* - Display `normalizedScore` or `relevanceScore` to indicate relevance
|
|
74
|
+
* - Show `docType`, `source`, and `topicBreadcrumb` metadata
|
|
75
|
+
* - Display `contextualSummary` if available
|
|
76
|
+
* - Include `paginationInfo` if pagination is used
|
|
77
|
+
* - Format results in a numbered list with clear relevance indicators
|
|
78
|
+
*
|
|
79
|
+
* **Example**: "I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)..."
|
|
80
|
+
*
|
|
81
|
+
* ## Overview
|
|
82
|
+
* 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.
|
|
36
83
|
*/
|
|
37
|
-
export function
|
|
84
|
+
export function aiSearch(
|
|
38
85
|
client$: EgainMcpCore,
|
|
39
86
|
request: AiSearchRequest,
|
|
40
87
|
options?: RequestOptions,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { EgainMcpCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple, queryJoin } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -34,16 +34,52 @@ import { Result } from "../types/fp.js";
|
|
|
34
34
|
* @remarks
|
|
35
35
|
* Get Announcements
|
|
36
36
|
*
|
|
37
|
+
* ## How to Use This Tool
|
|
38
|
+
*
|
|
39
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
40
|
+
*
|
|
41
|
+
* **Parameter Format**:
|
|
42
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999"}}`
|
|
43
|
+
* - Required parameter:
|
|
44
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
45
|
+
* - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
|
|
46
|
+
* - Optional parameters:
|
|
47
|
+
* - `Dollar_lang` (string, default: "en-US") - Language code
|
|
48
|
+
* - `Dollar_pagesize` (number, default: 10) - Number of results per page
|
|
49
|
+
*
|
|
50
|
+
* **Example**: To get announcements from portal "PZ-9999", call with:
|
|
51
|
+
* ```json
|
|
52
|
+
* {"request": {"portalID": "PZ-9999"}}
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* **Example with optional parameters**:
|
|
56
|
+
* ```json
|
|
57
|
+
* {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* ## Displaying Results (MCP-Specific)
|
|
61
|
+
* **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.
|
|
62
|
+
*
|
|
63
|
+
* **What to display:**
|
|
64
|
+
* - Display all announcement articles with their names and IDs
|
|
65
|
+
* - Show the article content (`content` or `contentText`) for each announcement
|
|
66
|
+
* - Display metadata such as `createdDate`, `modifiedDate`, `articleSummary`
|
|
67
|
+
* - Show `attachments` if present
|
|
68
|
+
* - Include `paginationInfo` if pagination is used
|
|
69
|
+
* - Format announcements in a clear list format
|
|
70
|
+
*
|
|
71
|
+
* **Example**: "Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]..."
|
|
72
|
+
*
|
|
37
73
|
* ## Prerequisites
|
|
38
74
|
* - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
39
|
-
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "
|
|
75
|
+
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
|
|
40
76
|
*
|
|
41
77
|
* ## Overview
|
|
42
78
|
* The Get Announcements API allows a user to retrieve all announcement articles for a specific portal. Announcements are special articles that are prominently displayed to users and typically contain important updates, news, or notifications.
|
|
43
79
|
*
|
|
44
80
|
* This API returns announcement articles with their full content, metadata, and any associated attachments or links.
|
|
45
81
|
*/
|
|
46
|
-
export function
|
|
82
|
+
export function getAnnouncementArticles(
|
|
47
83
|
client$: EgainMcpCore,
|
|
48
84
|
request: GetAnnouncementArticlesRequest,
|
|
49
85
|
options?: RequestOptions,
|
|
@@ -105,13 +141,19 @@ async function $do(
|
|
|
105
141
|
const path$ = pathToFunc("/portals/{portalID}/articles/announcements")(
|
|
106
142
|
pathParams$,
|
|
107
143
|
);
|
|
108
|
-
const query$ =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
144
|
+
const query$ = queryJoin(
|
|
145
|
+
encodeFormQuery({
|
|
146
|
+
"articleResultAdditionalAttributes":
|
|
147
|
+
payload$.articleResultAdditionalAttributes,
|
|
148
|
+
}, { explode: false }),
|
|
149
|
+
encodeFormQuery({
|
|
150
|
+
"$filter[tags]": payload$.dollarFilterTags,
|
|
151
|
+
"$lang": payload$.Dollar_lang,
|
|
152
|
+
"$pagenum": payload$.Dollar_pagenum,
|
|
153
|
+
"$pagesize": payload$.Dollar_pagesize,
|
|
154
|
+
"workflowMilestone": payload$.workflowMilestone,
|
|
155
|
+
}),
|
|
156
|
+
);
|
|
115
157
|
|
|
116
158
|
const headers$ = new Headers(compactMap({
|
|
117
159
|
Accept: "application/json",
|
|
@@ -120,6 +162,21 @@ async function $do(
|
|
|
120
162
|
payload$.acceptLanguage,
|
|
121
163
|
{ explode: false, charEncoding: "none" },
|
|
122
164
|
),
|
|
165
|
+
"x-egain-activity-id": encodeSimple(
|
|
166
|
+
"x-egain-activity-id",
|
|
167
|
+
payload$.xEgainActivityId,
|
|
168
|
+
{ explode: false, charEncoding: "none" },
|
|
169
|
+
),
|
|
170
|
+
"x-ext-integration-id": encodeSimple(
|
|
171
|
+
"x-ext-integration-id",
|
|
172
|
+
payload$.xExtIntegrationId,
|
|
173
|
+
{ explode: false, charEncoding: "none" },
|
|
174
|
+
),
|
|
175
|
+
"x-ext-interaction-id": encodeSimple(
|
|
176
|
+
"x-ext-interaction-id",
|
|
177
|
+
payload$.xExtInteractionId,
|
|
178
|
+
{ explode: false, charEncoding: "none" },
|
|
179
|
+
),
|
|
123
180
|
}));
|
|
124
181
|
const securityInput = await extractSecurity(client$._options.security);
|
|
125
182
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
@@ -34,6 +34,48 @@ import { Result } from "../types/fp.js";
|
|
|
34
34
|
* @remarks
|
|
35
35
|
* Get Article by ID
|
|
36
36
|
*
|
|
37
|
+
* ## How to Use This Tool
|
|
38
|
+
*
|
|
39
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
40
|
+
*
|
|
41
|
+
* **Parameter Format**:
|
|
42
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}`
|
|
43
|
+
* - Required parameters:
|
|
44
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
45
|
+
* - `articleID` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PROD-2996")
|
|
46
|
+
* - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
|
|
47
|
+
* - Optional parameters:
|
|
48
|
+
* - `Dollar_lang` (string, default: "en-US") - Language code
|
|
49
|
+
* - `articleAdditionalAttributes` (array) - Additional article attributes to return
|
|
50
|
+
* - `Dollar_customAdditionalAttributes` (string) - Custom additional attributes
|
|
51
|
+
* - `accessSource` (string, default: "article_view") - How the article was accessed
|
|
52
|
+
* - `publishViewId` (string) - Publish view ID
|
|
53
|
+
* - `workflowMilestone` (string) - Workflow milestone filter
|
|
54
|
+
*
|
|
55
|
+
* **Example**: To get article "PROD-2996" from portal "PZ-9999", call with:
|
|
56
|
+
* ```json
|
|
57
|
+
* {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* **Example with optional parameters**:
|
|
61
|
+
* ```json
|
|
62
|
+
* {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996", "Dollar_lang": "en-US", "accessSource": "article_view"}}
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ## Displaying Results (MCP-Specific)
|
|
66
|
+
* **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.
|
|
67
|
+
*
|
|
68
|
+
* **What to display:**
|
|
69
|
+
* - Display the article `name` as the title
|
|
70
|
+
* - Show the article `content` or `contentText` (the full article body)
|
|
71
|
+
* - Display article metadata: `id`, `articleType`, `createdDate`, `modifiedDate`
|
|
72
|
+
* - Show `attachments` if present
|
|
73
|
+
* - Display `topicBreadcrumb` to show where the article is categorized
|
|
74
|
+
* - Include any other relevant metadata like `articleSummary`, `description`, `articleKeywords`
|
|
75
|
+
* - Format the article content in a readable way for the user
|
|
76
|
+
*
|
|
77
|
+
* **Example**: "Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]..."
|
|
78
|
+
*
|
|
37
79
|
* ## Prerequisites
|
|
38
80
|
* - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
39
81
|
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
@@ -46,7 +88,7 @@ import { Result } from "../types/fp.js";
|
|
|
46
88
|
* - The "Allow Structured Authoring" setting is enabled at the partition/department level
|
|
47
89
|
* - The "Use Structured Authoring" flag is set on the article type
|
|
48
90
|
*/
|
|
49
|
-
export function
|
|
91
|
+
export function getArticleById(
|
|
50
92
|
client$: EgainMcpCore,
|
|
51
93
|
request: GetArticleByIdRequest,
|
|
52
94
|
options?: RequestOptions,
|
|
@@ -132,6 +174,21 @@ async function $do(
|
|
|
132
174
|
payload$.acceptLanguage,
|
|
133
175
|
{ explode: false, charEncoding: "none" },
|
|
134
176
|
),
|
|
177
|
+
"x-egain-activity-id": encodeSimple(
|
|
178
|
+
"x-egain-activity-id",
|
|
179
|
+
payload$.xEgainActivityId,
|
|
180
|
+
{ explode: false, charEncoding: "none" },
|
|
181
|
+
),
|
|
182
|
+
"x-ext-integration-id": encodeSimple(
|
|
183
|
+
"x-ext-integration-id",
|
|
184
|
+
payload$.xExtIntegrationId,
|
|
185
|
+
{ explode: false, charEncoding: "none" },
|
|
186
|
+
),
|
|
187
|
+
"x-ext-interaction-id": encodeSimple(
|
|
188
|
+
"x-ext-interaction-id",
|
|
189
|
+
payload$.xExtInteractionId,
|
|
190
|
+
{ explode: false, charEncoding: "none" },
|
|
191
|
+
),
|
|
135
192
|
}));
|
|
136
193
|
const securityInput = await extractSecurity(client$._options.security);
|
|
137
194
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
@@ -10,6 +10,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
AnswersResponse,
|
|
15
|
+
AnswersResponse$zodSchema,
|
|
16
|
+
} from "../models/answersresponse.js";
|
|
13
17
|
import { APIError } from "../models/errors/apierror.js";
|
|
14
18
|
import {
|
|
15
19
|
ConnectionError,
|
|
@@ -22,8 +26,6 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
22
26
|
import {
|
|
23
27
|
GetBestAnswerRequest,
|
|
24
28
|
GetBestAnswerRequest$zodSchema,
|
|
25
|
-
GetBestAnswerResponse,
|
|
26
|
-
GetBestAnswerResponse$zodSchema,
|
|
27
29
|
} from "../models/getbestanswerop.js";
|
|
28
30
|
import { APICall, APIPromise } from "../types/async.js";
|
|
29
31
|
import { Result } from "../types/fp.js";
|
|
@@ -34,26 +36,62 @@ import { Result } from "../types/fp.js";
|
|
|
34
36
|
* @remarks
|
|
35
37
|
* Get Answers
|
|
36
38
|
*
|
|
39
|
+
* ## How to Use This Tool
|
|
40
|
+
*
|
|
41
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
42
|
+
*
|
|
43
|
+
* **Parameter Format**:
|
|
44
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}`
|
|
45
|
+
* - Required parameters:
|
|
46
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
47
|
+
* - `q` (string) - The search query string
|
|
48
|
+
* - `Dollar_lang` (string) - Language code (e.g., "en-US")
|
|
49
|
+
* - Optional parameters:
|
|
50
|
+
* - `dollarFilterUserProfileID` (string) - User profile ID filter
|
|
51
|
+
* - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
|
|
52
|
+
* - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by
|
|
53
|
+
* - `AnswersRequest` (object) - Request body parameters:
|
|
54
|
+
* - `eventId` (string, **required**) - Event ID
|
|
55
|
+
* - `sessionId` (string, **required**) - Session ID
|
|
56
|
+
* - `channel` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.
|
|
57
|
+
* - `context` (object) - Additional context (companyContext, pageContext, userContext)
|
|
58
|
+
*
|
|
59
|
+
* **Example**: To get answers for query "loan information" from portal "PZ-9999", call with:
|
|
60
|
+
* ```json
|
|
61
|
+
* {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "AnswersRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* **Note**: The `channel` field in `AnswersRequest` is optional and recommended to omit unless specifically needed. The API works reliably without it.
|
|
65
|
+
*
|
|
66
|
+
* ## Displaying Results (MCP-Specific)
|
|
67
|
+
* **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.
|
|
68
|
+
*
|
|
69
|
+
* **What to display:**
|
|
70
|
+
* - Display the `answer.answerValue` text prominently as the main answer to the user's query
|
|
71
|
+
* - Indicate the answer type (`answerType`: "certified" or "generative")
|
|
72
|
+
* - If `relevanceScore` is present, you may mention the confidence level
|
|
73
|
+
* - List all `references` (article IDs and names) that were used to generate the answer
|
|
74
|
+
* - Display `searchResults` showing related articles with their names, IDs, snippets, and relevance scores
|
|
75
|
+
* - Format the answer in a clear, readable way - this is the primary response the user is seeking
|
|
76
|
+
*
|
|
77
|
+
* **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]..."
|
|
78
|
+
*
|
|
37
79
|
* ## Prerequisites
|
|
38
80
|
* - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
39
|
-
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "
|
|
81
|
+
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
|
|
40
82
|
*
|
|
41
83
|
* ## Overview
|
|
42
84
|
* 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
85
|
*
|
|
44
86
|
* 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.
|
|
49
87
|
*/
|
|
50
|
-
export function
|
|
88
|
+
export function getBestAnswer(
|
|
51
89
|
client$: EgainMcpCore,
|
|
52
90
|
request: GetBestAnswerRequest,
|
|
53
91
|
options?: RequestOptions,
|
|
54
92
|
): APIPromise<
|
|
55
93
|
Result<
|
|
56
|
-
|
|
94
|
+
AnswersResponse,
|
|
57
95
|
| APIError
|
|
58
96
|
| SDKValidationError
|
|
59
97
|
| UnexpectedClientError
|
|
@@ -77,7 +115,7 @@ async function $do(
|
|
|
77
115
|
): Promise<
|
|
78
116
|
[
|
|
79
117
|
Result<
|
|
80
|
-
|
|
118
|
+
AnswersResponse,
|
|
81
119
|
| APIError
|
|
82
120
|
| SDKValidationError
|
|
83
121
|
| UnexpectedClientError
|
|
@@ -175,7 +213,7 @@ async function $do(
|
|
|
175
213
|
};
|
|
176
214
|
|
|
177
215
|
const [result$] = await M.match<
|
|
178
|
-
|
|
216
|
+
AnswersResponse,
|
|
179
217
|
| APIError
|
|
180
218
|
| SDKValidationError
|
|
181
219
|
| UnexpectedClientError
|
|
@@ -184,9 +222,9 @@ async function $do(
|
|
|
184
222
|
| RequestTimeoutError
|
|
185
223
|
| ConnectionError
|
|
186
224
|
>(
|
|
187
|
-
M.json(200,
|
|
188
|
-
M.nil(400,
|
|
189
|
-
M.nil(500,
|
|
225
|
+
M.json(200, AnswersResponse$zodSchema, { key: "AnswersResponse" }),
|
|
226
|
+
M.nil(400, AnswersResponse$zodSchema),
|
|
227
|
+
M.nil(500, AnswersResponse$zodSchema),
|
|
190
228
|
)(response, req$, { extraFields: responseFields$ });
|
|
191
229
|
|
|
192
230
|
return [result$, { status: "complete", request: req$, response }];
|
|
@@ -35,13 +35,43 @@ import { Result } from "../types/fp.js";
|
|
|
35
35
|
* Get All Portals Accessible to User
|
|
36
36
|
*
|
|
37
37
|
* ## Overview
|
|
38
|
-
*
|
|
38
|
+
* Retrieves 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.
|
|
39
|
+
*
|
|
39
40
|
* - If no access tags are specified for a portal, any user can access the portal.
|
|
40
41
|
* - 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.
|
|
41
42
|
* - Global users (partition) cannot be assigned user profiles; their access is limited to portals without access restrictions.
|
|
42
43
|
* - The only articles returned are associated to an Article type when the parameter “Include in browse on portals” is set to "Yes".
|
|
43
44
|
* - 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.
|
|
44
45
|
*
|
|
46
|
+
* ## Prerequisites
|
|
47
|
+
* Authentication is required. No portal ID is needed for this call. This is typically the first API you should call before using any other tool.
|
|
48
|
+
*
|
|
49
|
+
* ## How to Use This Tool
|
|
50
|
+
* - 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.
|
|
51
|
+
*
|
|
52
|
+
* ## Parameter Requirements
|
|
53
|
+
* This tool requires **both** a query language parameter **and** an HTTP language header. An empty request object is **invalid** and MUST NOT be used.
|
|
54
|
+
*
|
|
55
|
+
* ### Required (both MUST be provided)
|
|
56
|
+
* - `Dollar_lang` (string, default: "en-US") - Language code
|
|
57
|
+
* - `Accept-Language` (string, default: "en-US") - Accept-Language header value
|
|
58
|
+
*
|
|
59
|
+
* Both parameters **MUST** be present on every invocation.
|
|
60
|
+
* If either parameter is missing, the request is invalid.
|
|
61
|
+
*
|
|
62
|
+
* #### Optional
|
|
63
|
+
*
|
|
64
|
+
* - `Dollar_pagenum` — Page number to retrieve (defaults to `1` if omitted)
|
|
65
|
+
* - `Dollar_pagesize` — Number of items per page (server default applied if omitted)
|
|
66
|
+
*
|
|
67
|
+
* **Example**: To get all portals accessible to the user, call with:
|
|
68
|
+
* ```json
|
|
69
|
+
* {"request": {"Dollar_lang": "en-US", "Accept-Language": "en-US"}}
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* ## Overview
|
|
73
|
+
* The Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.
|
|
74
|
+
*
|
|
45
75
|
* ## Pagination behavior (CRITICAL for AI assistants)
|
|
46
76
|
*
|
|
47
77
|
* **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.
|
|
@@ -81,8 +111,11 @@ import { Result } from "../types/fp.js";
|
|
|
81
111
|
* - Search the complete merged list before concluding the portal doesn't exist
|
|
82
112
|
*
|
|
83
113
|
* This ensures reliable portal name-to-ID resolution and prevents false "not found" errors.
|
|
114
|
+
*
|
|
115
|
+
* ## Displaying Results (MCP-Specific)
|
|
116
|
+
* Always 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.
|
|
84
117
|
*/
|
|
85
|
-
export function
|
|
118
|
+
export function getMyPortals(
|
|
86
119
|
client$: EgainMcpCore,
|
|
87
120
|
request: GetMyPortalsRequest,
|
|
88
121
|
options?: RequestOptions,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { EgainMcpCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple, queryJoin } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -34,6 +34,45 @@ import { Result } from "../types/fp.js";
|
|
|
34
34
|
* @remarks
|
|
35
35
|
* Get Popular Articles
|
|
36
36
|
*
|
|
37
|
+
* ## How to Use This Tool
|
|
38
|
+
*
|
|
39
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
40
|
+
*
|
|
41
|
+
* **Parameter Format**:
|
|
42
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999"}}`
|
|
43
|
+
* - Required parameter:
|
|
44
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
45
|
+
* - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
|
|
46
|
+
* - Optional parameters:
|
|
47
|
+
* - `Dollar_lang` (string, default: "en-US") - Language code
|
|
48
|
+
* - `Dollar_pagenum` (number, default: 1) - Page number for pagination
|
|
49
|
+
* - `Dollar_pagesize` (number, default: 10) - Number of results per page
|
|
50
|
+
* - `dollarFilterTopicId` (string) - Filter by topic ID
|
|
51
|
+
* - `dollarFilterTags` (string) - Comma-separated list of Tag/Tag Group IDs
|
|
52
|
+
*
|
|
53
|
+
* **Example**: To get popular articles from portal "PZ-9999", call with:
|
|
54
|
+
* ```json
|
|
55
|
+
* {"request": {"portalID": "PZ-9999"}}
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* **Example with optional parameters**:
|
|
59
|
+
* ```json
|
|
60
|
+
* {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* ## Displaying Results (MCP-Specific)
|
|
64
|
+
* **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.
|
|
65
|
+
*
|
|
66
|
+
* **What to display:**
|
|
67
|
+
* - Display all popular articles with their names and IDs
|
|
68
|
+
* - Show article summaries or descriptions when available
|
|
69
|
+
* - Display metadata such as `articleType`, `createdDate`, `modifiedDate`
|
|
70
|
+
* - Show `imageURL` if available (mention thumbnail availability)
|
|
71
|
+
* - Include `paginationInfo` if pagination is used
|
|
72
|
+
* - Format articles in a numbered or bulleted list
|
|
73
|
+
*
|
|
74
|
+
* **Example**: "Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]..."
|
|
75
|
+
*
|
|
37
76
|
* ## Prerequisites
|
|
38
77
|
* - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
39
78
|
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
@@ -105,13 +144,19 @@ async function $do(
|
|
|
105
144
|
const path$ = pathToFunc("/portals/{portalID}/populararticles")(
|
|
106
145
|
pathParams$,
|
|
107
146
|
);
|
|
108
|
-
const query$ =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
147
|
+
const query$ = queryJoin(
|
|
148
|
+
encodeFormQuery({
|
|
149
|
+
"articleResultAdditionalAttributes":
|
|
150
|
+
payload$.articleResultAdditionalAttributes,
|
|
151
|
+
}, { explode: false }),
|
|
152
|
+
encodeFormQuery({
|
|
153
|
+
"$filter[tags]": payload$.dollarFilterTags,
|
|
154
|
+
"$filter[topicId]": payload$.dollarFilterTopicId,
|
|
155
|
+
"$lang": payload$.Dollar_lang,
|
|
156
|
+
"$pagenum": payload$.Dollar_pagenum,
|
|
157
|
+
"$pagesize": payload$.Dollar_pagesize,
|
|
158
|
+
}),
|
|
159
|
+
);
|
|
115
160
|
|
|
116
161
|
const headers$ = new Headers(compactMap({
|
|
117
162
|
Accept: "application/json",
|
|
@@ -120,6 +165,21 @@ async function $do(
|
|
|
120
165
|
payload$.acceptLanguage,
|
|
121
166
|
{ explode: false, charEncoding: "none" },
|
|
122
167
|
),
|
|
168
|
+
"x-egain-activity-id": encodeSimple(
|
|
169
|
+
"x-egain-activity-id",
|
|
170
|
+
payload$.xEgainActivityId,
|
|
171
|
+
{ explode: false, charEncoding: "none" },
|
|
172
|
+
),
|
|
173
|
+
"x-ext-integration-id": encodeSimple(
|
|
174
|
+
"x-ext-integration-id",
|
|
175
|
+
payload$.xExtIntegrationId,
|
|
176
|
+
{ explode: false, charEncoding: "none" },
|
|
177
|
+
),
|
|
178
|
+
"x-ext-interaction-id": encodeSimple(
|
|
179
|
+
"x-ext-interaction-id",
|
|
180
|
+
payload$.xExtInteractionId,
|
|
181
|
+
{ explode: false, charEncoding: "none" },
|
|
182
|
+
),
|
|
123
183
|
}));
|
|
124
184
|
const securityInput = await extractSecurity(client$._options.security);
|
|
125
185
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import * as z from "zod";
|
|
5
6
|
import { EgainMcpCore } from "../core.js";
|
|
6
7
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -22,9 +23,8 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
22
23
|
import {
|
|
23
24
|
MakeSuggestionRequest,
|
|
24
25
|
MakeSuggestionRequest$zodSchema,
|
|
25
|
-
MakeSuggestionResponse,
|
|
26
|
-
MakeSuggestionResponse$zodSchema,
|
|
27
26
|
} from "../models/makesuggestionop.js";
|
|
27
|
+
import { WSErrorCommon, WSErrorCommon$zodSchema } from "../models/wserrorcommon.js";
|
|
28
28
|
import { APICall, APIPromise } from "../types/async.js";
|
|
29
29
|
import { Result } from "../types/fp.js";
|
|
30
30
|
|
|
@@ -34,6 +34,49 @@ import { Result } from "../types/fp.js";
|
|
|
34
34
|
* @remarks
|
|
35
35
|
* Make a Suggestion
|
|
36
36
|
*
|
|
37
|
+
* ## How to Use This Tool
|
|
38
|
+
*
|
|
39
|
+
* **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
|
|
40
|
+
*
|
|
41
|
+
* **Parameter Format**:
|
|
42
|
+
* - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "CreateSuggestion": {...}}}`
|
|
43
|
+
* - Required parameters:
|
|
44
|
+
* - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
45
|
+
* - `CreateSuggestion` (object) - The suggestion object with:
|
|
46
|
+
* - `name` (string, **required**) - Name/title of the suggestion
|
|
47
|
+
* - `content` (string, **required**) - Content/description of the suggestion
|
|
48
|
+
* - `language` (object, **required**) - Language object with `code` property (e.g., {"code": "en-US"})
|
|
49
|
+
* - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
|
|
50
|
+
*
|
|
51
|
+
* - Optional parameters:
|
|
52
|
+
* - `CreateSuggestion` additional optional fields:
|
|
53
|
+
* - `description` (string) - Additional description
|
|
54
|
+
* - `feedbackArticle` (object) - Article ID object if providing feedback on existing article: `{"id": "PROD-2996"}`
|
|
55
|
+
* - `attachments` (object) - Attachments object
|
|
56
|
+
* - `customAttributes` (array) - Custom attributes array
|
|
57
|
+
*
|
|
58
|
+
* **Example**: To create a suggestion in portal "PZ-9999", call with:
|
|
59
|
+
* ```json
|
|
60
|
+
* {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "New Article Request", "content": "Please add information about loan rates", "language": {"code": "en-US"}}}}
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* **Example with feedback on existing article**:
|
|
64
|
+
* ```json
|
|
65
|
+
* {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "Article Feedback", "content": "This article needs updating", "language": {"code": "en-US"}, "feedbackArticle": {"id": "PROD-2996"}}}}
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* ## Displaying Results (MCP-Specific)
|
|
69
|
+
* **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.
|
|
70
|
+
*
|
|
71
|
+
* **What to display:**
|
|
72
|
+
* - Confirm that the suggestion was successfully created
|
|
73
|
+
* - Display the suggestion `id` if returned in the response
|
|
74
|
+
* - Show the suggestion `name` and `content` that was submitted
|
|
75
|
+
* - If an error occurs, display the error message clearly
|
|
76
|
+
* - Provide confirmation message to the user
|
|
77
|
+
*
|
|
78
|
+
* **Example**: "Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]..."
|
|
79
|
+
*
|
|
37
80
|
* ## Prerequisites
|
|
38
81
|
* - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
39
82
|
* - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
@@ -49,7 +92,7 @@ export function makeSuggestion(
|
|
|
49
92
|
options?: RequestOptions,
|
|
50
93
|
): APIPromise<
|
|
51
94
|
Result<
|
|
52
|
-
|
|
95
|
+
Record<string, never> | WSErrorCommon,
|
|
53
96
|
| APIError
|
|
54
97
|
| SDKValidationError
|
|
55
98
|
| UnexpectedClientError
|
|
@@ -73,7 +116,7 @@ async function $do(
|
|
|
73
116
|
): Promise<
|
|
74
117
|
[
|
|
75
118
|
Result<
|
|
76
|
-
|
|
119
|
+
Record<string, never> | WSErrorCommon,
|
|
77
120
|
| APIError
|
|
78
121
|
| SDKValidationError
|
|
79
122
|
| UnexpectedClientError
|
|
@@ -116,6 +159,21 @@ async function $do(
|
|
|
116
159
|
payload$.acceptLanguage,
|
|
117
160
|
{ explode: false, charEncoding: "none" },
|
|
118
161
|
),
|
|
162
|
+
"x-egain-activity-id": encodeSimple(
|
|
163
|
+
"x-egain-activity-id",
|
|
164
|
+
payload$.xEgainActivityId,
|
|
165
|
+
{ explode: false, charEncoding: "none" },
|
|
166
|
+
),
|
|
167
|
+
"x-ext-integration-id": encodeSimple(
|
|
168
|
+
"x-ext-integration-id",
|
|
169
|
+
payload$.xExtIntegrationId,
|
|
170
|
+
{ explode: false, charEncoding: "none" },
|
|
171
|
+
),
|
|
172
|
+
"x-ext-interaction-id": encodeSimple(
|
|
173
|
+
"x-ext-interaction-id",
|
|
174
|
+
payload$.xExtInteractionId,
|
|
175
|
+
{ explode: false, charEncoding: "none" },
|
|
176
|
+
),
|
|
119
177
|
}));
|
|
120
178
|
const securityInput = await extractSecurity(client$._options.security);
|
|
121
179
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
@@ -170,7 +228,7 @@ async function $do(
|
|
|
170
228
|
};
|
|
171
229
|
|
|
172
230
|
const [result$] = await M.match<
|
|
173
|
-
|
|
231
|
+
Record<string, never> | WSErrorCommon,
|
|
174
232
|
| APIError
|
|
175
233
|
| SDKValidationError
|
|
176
234
|
| UnexpectedClientError
|
|
@@ -179,12 +237,12 @@ async function $do(
|
|
|
179
237
|
| RequestTimeoutError
|
|
180
238
|
| ConnectionError
|
|
181
239
|
>(
|
|
182
|
-
M.nil(201,
|
|
183
|
-
M.json([400, 401, 403, 404, 406],
|
|
240
|
+
M.nil(201, z.object({})),
|
|
241
|
+
M.json([400, 401, 403, 404, 406], WSErrorCommon$zodSchema, {
|
|
184
242
|
key: "WSErrorCommon",
|
|
185
243
|
}),
|
|
186
|
-
M.nil(415,
|
|
187
|
-
M.json(500,
|
|
244
|
+
M.nil(415, WSErrorCommon$zodSchema),
|
|
245
|
+
M.json(500, WSErrorCommon$zodSchema, { key: "WSErrorCommon" }),
|
|
188
246
|
)(response, req$, { extraFields: responseFields$ });
|
|
189
247
|
|
|
190
248
|
return [result$, { status: "complete", request: req$, response }];
|