@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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { aiSearch } from "../../funcs/aiSearch.js";
|
|
6
|
+
import { AiSearchRequest$zodSchema } from "../../models/aisearchop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: AiSearchRequest$zodSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$aiSearch: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "ai-search",
|
|
15
|
+
description: `Hybrid Search
|
|
16
|
+
|
|
17
|
+
Hybrid Search
|
|
18
|
+
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information"}}\`
|
|
25
|
+
- Required parameters:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`q\` (string) - The search query string (must be URL-escaped)
|
|
28
|
+
- Optional parameters:
|
|
29
|
+
- \`Dollar_lang\` (string, default: "en-US") - Language code
|
|
30
|
+
- \`dollarFilterUserProfileID\` (string) - User profile ID filter
|
|
31
|
+
- \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
|
|
32
|
+
- \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
|
|
33
|
+
- \`articleCustomAdditionalAttributes\` (string) - Comma-separated custom attribute names
|
|
34
|
+
- \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
|
|
35
|
+
- \`Dollar_pagesize\` (number, default: 20) - Number of results per page
|
|
36
|
+
|
|
37
|
+
**Example**: To search for "loan information" in portal "PZ-9999", call with:
|
|
38
|
+
\`\`\`json
|
|
39
|
+
{"request": {"portalID": "PZ-9999", "q": "loan information"}}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
**Example with optional parameters**:
|
|
43
|
+
\`\`\`json
|
|
44
|
+
{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "Dollar_pagesize": 25}}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
**Note**: This endpoint is only available for Self Service environments.
|
|
48
|
+
|
|
49
|
+
## Displaying Results (MCP-Specific)
|
|
50
|
+
**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.
|
|
51
|
+
|
|
52
|
+
**What to display:**
|
|
53
|
+
- Display all search results with article names and IDs
|
|
54
|
+
- Show article \`snippet\` or \`keywordSnippet\` (the relevant text excerpt)
|
|
55
|
+
- Display \`normalizedScore\` or \`relevanceScore\` to indicate relevance
|
|
56
|
+
- Show \`docType\`, \`source\`, and \`topicBreadcrumb\` metadata
|
|
57
|
+
- Display \`contextualSummary\` if available
|
|
58
|
+
- Include \`paginationInfo\` if pagination is used
|
|
59
|
+
- Format results in a numbered list with clear relevance indicators
|
|
60
|
+
|
|
61
|
+
**Example**: "I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)..."
|
|
62
|
+
|
|
63
|
+
## Overview
|
|
64
|
+
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.
|
|
65
|
+
`,
|
|
66
|
+
annotations: {
|
|
67
|
+
"title": "",
|
|
68
|
+
"destructiveHint": false,
|
|
69
|
+
"idempotentHint": false,
|
|
70
|
+
"openWorldHint": false,
|
|
71
|
+
"readOnlyHint": true,
|
|
72
|
+
},
|
|
73
|
+
args,
|
|
74
|
+
tool: async (client, args, ctx) => {
|
|
75
|
+
const [result, apiCall] = await aiSearch(
|
|
76
|
+
client,
|
|
77
|
+
args.request,
|
|
78
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
79
|
+
).$inspect();
|
|
80
|
+
|
|
81
|
+
if (!result.ok) {
|
|
82
|
+
return {
|
|
83
|
+
content: [{ type: "text", text: result.error.message }],
|
|
84
|
+
isError: true,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const value = result.value;
|
|
89
|
+
|
|
90
|
+
return formatResult(value, apiCall);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getAnnouncementArticles } from "../../funcs/getAnnouncementArticles.js";
|
|
6
|
+
import { GetAnnouncementArticlesRequest$zodSchema } from "../../models/getannouncementarticlesop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: GetAnnouncementArticlesRequest$zodSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$getAnnouncementArticles: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "get-announcement-articles",
|
|
15
|
+
description: `Get Announcement Articles
|
|
16
|
+
|
|
17
|
+
Get Announcements
|
|
18
|
+
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999"}}\`
|
|
25
|
+
- Required parameter:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
|
|
28
|
+
- Optional parameters:
|
|
29
|
+
- \`Dollar_lang\` (string, default: "en-US") - Language code
|
|
30
|
+
- \`Dollar_pagesize\` (number, default: 10) - Number of results per page
|
|
31
|
+
|
|
32
|
+
**Example**: To get announcements from portal "PZ-9999", call with:
|
|
33
|
+
\`\`\`json
|
|
34
|
+
{"request": {"portalID": "PZ-9999"}}
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
**Example with optional parameters**:
|
|
38
|
+
\`\`\`json
|
|
39
|
+
{"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
## Displaying Results (MCP-Specific)
|
|
43
|
+
**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.
|
|
44
|
+
|
|
45
|
+
**What to display:**
|
|
46
|
+
- Display all announcement articles with their names and IDs
|
|
47
|
+
- Show the article content (\`content\` or \`contentText\`) for each announcement
|
|
48
|
+
- Display metadata such as \`createdDate\`, \`modifiedDate\`, \`articleSummary\`
|
|
49
|
+
- Show \`attachments\` if present
|
|
50
|
+
- Include \`paginationInfo\` if pagination is used
|
|
51
|
+
- Format announcements in a clear list format
|
|
52
|
+
|
|
53
|
+
**Example**: "Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]..."
|
|
54
|
+
|
|
55
|
+
## Prerequisites
|
|
56
|
+
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
57
|
+
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
|
|
58
|
+
|
|
59
|
+
## Overview
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
This API returns announcement articles with their full content, metadata, and any associated attachments or links.
|
|
63
|
+
`,
|
|
64
|
+
annotations: {
|
|
65
|
+
"title": "",
|
|
66
|
+
"destructiveHint": false,
|
|
67
|
+
"idempotentHint": false,
|
|
68
|
+
"openWorldHint": false,
|
|
69
|
+
"readOnlyHint": true,
|
|
70
|
+
},
|
|
71
|
+
args,
|
|
72
|
+
tool: async (client, args, ctx) => {
|
|
73
|
+
const [result, apiCall] = await getAnnouncementArticles(
|
|
74
|
+
client,
|
|
75
|
+
args.request,
|
|
76
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
77
|
+
).$inspect();
|
|
78
|
+
|
|
79
|
+
if (!result.ok) {
|
|
80
|
+
return {
|
|
81
|
+
content: [{ type: "text", text: result.error.message }],
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const value = result.value;
|
|
87
|
+
|
|
88
|
+
return formatResult(value, apiCall);
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getArticleById } from "../../funcs/getArticleById.js";
|
|
6
|
+
import { GetArticleByIdRequest$zodSchema } from "../../models/getarticlebyidop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: GetArticleByIdRequest$zodSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$getArticleById: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "get-article-by-id",
|
|
15
|
+
description: `Get Article by ID
|
|
16
|
+
|
|
17
|
+
Get Article by ID
|
|
18
|
+
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}\`
|
|
25
|
+
- Required parameters:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`articleID\` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PROD-2996")
|
|
28
|
+
- \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
|
|
29
|
+
- Optional parameters:
|
|
30
|
+
- \`Dollar_lang\` (string, default: "en-US") - Language code
|
|
31
|
+
- \`articleAdditionalAttributes\` (array) - Additional article attributes to return
|
|
32
|
+
- \`Dollar_customAdditionalAttributes\` (string) - Custom additional attributes
|
|
33
|
+
- \`accessSource\` (string, default: "article_view") - How the article was accessed
|
|
34
|
+
- \`publishViewId\` (string) - Publish view ID
|
|
35
|
+
- \`workflowMilestone\` (string) - Workflow milestone filter
|
|
36
|
+
|
|
37
|
+
**Example**: To get article "PROD-2996" from portal "PZ-9999", call with:
|
|
38
|
+
\`\`\`json
|
|
39
|
+
{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
**Example with optional parameters**:
|
|
43
|
+
\`\`\`json
|
|
44
|
+
{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996", "Dollar_lang": "en-US", "accessSource": "article_view"}}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
## Displaying Results (MCP-Specific)
|
|
48
|
+
**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.
|
|
49
|
+
|
|
50
|
+
**What to display:**
|
|
51
|
+
- Display the article \`name\` as the title
|
|
52
|
+
- Show the article \`content\` or \`contentText\` (the full article body)
|
|
53
|
+
- Display article metadata: \`id\`, \`articleType\`, \`createdDate\`, \`modifiedDate\`
|
|
54
|
+
- Show \`attachments\` if present
|
|
55
|
+
- Display \`topicBreadcrumb\` to show where the article is categorized
|
|
56
|
+
- Include any other relevant metadata like \`articleSummary\`, \`description\`, \`articleKeywords\`
|
|
57
|
+
- Format the article content in a readable way for the user
|
|
58
|
+
|
|
59
|
+
**Example**: "Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]..."
|
|
60
|
+
|
|
61
|
+
## Prerequisites
|
|
62
|
+
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
63
|
+
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
64
|
+
- Requires a valid article ID. Article ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-2996")
|
|
65
|
+
|
|
66
|
+
## Overview
|
|
67
|
+
The 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.
|
|
68
|
+
|
|
69
|
+
This API returns structured authoring attributes of Issue, Environment, Cause and Confidence Level when the following conditions are met:
|
|
70
|
+
- The "Allow Structured Authoring" setting is enabled at the partition/department level
|
|
71
|
+
- The "Use Structured Authoring" flag is set on the article type
|
|
72
|
+
`,
|
|
73
|
+
annotations: {
|
|
74
|
+
"title": "",
|
|
75
|
+
"destructiveHint": false,
|
|
76
|
+
"idempotentHint": false,
|
|
77
|
+
"openWorldHint": false,
|
|
78
|
+
"readOnlyHint": true,
|
|
79
|
+
},
|
|
80
|
+
args,
|
|
81
|
+
tool: async (client, args, ctx) => {
|
|
82
|
+
const [result, apiCall] = await getArticleById(
|
|
83
|
+
client,
|
|
84
|
+
args.request,
|
|
85
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
86
|
+
).$inspect();
|
|
87
|
+
|
|
88
|
+
if (!result.ok) {
|
|
89
|
+
return {
|
|
90
|
+
content: [{ type: "text", text: result.error.message }],
|
|
91
|
+
isError: true,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const value = result.value;
|
|
96
|
+
|
|
97
|
+
return formatResult(value, apiCall);
|
|
98
|
+
},
|
|
99
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getBestAnswer } from "../../funcs/getBestAnswer.js";
|
|
6
|
+
import { GetBestAnswerRequest$zodSchema } from "../../models/getbestanswerop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: GetBestAnswerRequest$zodSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$getBestAnswer: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "get-best-answer",
|
|
15
|
+
description: `Generate an Answer
|
|
16
|
+
|
|
17
|
+
Get Answers
|
|
18
|
+
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}\`
|
|
25
|
+
- Required parameters:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`q\` (string) - The search query string
|
|
28
|
+
- \`Dollar_lang\` (string) - Language code (e.g., "en-US")
|
|
29
|
+
- Optional parameters:
|
|
30
|
+
- \`dollarFilterUserProfileID\` (string) - User profile ID filter
|
|
31
|
+
- \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
|
|
32
|
+
- \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
|
|
33
|
+
- \`AnswersRequest\` (object) - Request body parameters:
|
|
34
|
+
- \`eventId\` (string, **required**) - Event ID
|
|
35
|
+
- \`sessionId\` (string, **required**) - Session ID
|
|
36
|
+
- \`channel\` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.
|
|
37
|
+
- \`context\` (object) - Additional context (companyContext, pageContext, userContext)
|
|
38
|
+
|
|
39
|
+
**Example**: To get answers for query "loan information" from portal "PZ-9999", call with:
|
|
40
|
+
\`\`\`json
|
|
41
|
+
{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "AnswersRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
**Note**: The \`channel\` field in \`AnswersRequest\` is optional and recommended to omit unless specifically needed. The API works reliably without it.
|
|
45
|
+
|
|
46
|
+
## Displaying Results (MCP-Specific)
|
|
47
|
+
**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.
|
|
48
|
+
|
|
49
|
+
**What to display:**
|
|
50
|
+
- Display the \`answer.answerValue\` text prominently as the main answer to the user's query
|
|
51
|
+
- Indicate the answer type (\`answerType\`: "certified" or "generative")
|
|
52
|
+
- If \`relevanceScore\` is present, you may mention the confidence level
|
|
53
|
+
- List all \`references\` (article IDs and names) that were used to generate the answer
|
|
54
|
+
- Display \`searchResults\` showing related articles with their names, IDs, snippets, and relevance scores
|
|
55
|
+
- Format the answer in a clear, readable way - this is the primary response the user is seeking
|
|
56
|
+
|
|
57
|
+
**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]..."
|
|
58
|
+
|
|
59
|
+
## Prerequisites
|
|
60
|
+
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
61
|
+
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
|
|
62
|
+
|
|
63
|
+
## Overview
|
|
64
|
+
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.
|
|
65
|
+
|
|
66
|
+
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.
|
|
67
|
+
`,
|
|
68
|
+
annotations: {
|
|
69
|
+
"title": "",
|
|
70
|
+
"destructiveHint": false,
|
|
71
|
+
"idempotentHint": false,
|
|
72
|
+
"openWorldHint": false,
|
|
73
|
+
"readOnlyHint": false,
|
|
74
|
+
},
|
|
75
|
+
args,
|
|
76
|
+
tool: async (client, args, ctx) => {
|
|
77
|
+
const [result, apiCall] = await getBestAnswer(
|
|
78
|
+
client,
|
|
79
|
+
args.request,
|
|
80
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
81
|
+
).$inspect();
|
|
82
|
+
|
|
83
|
+
if (!result.ok) {
|
|
84
|
+
return {
|
|
85
|
+
content: [{ type: "text", text: result.error.message }],
|
|
86
|
+
isError: true,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const value = result.value;
|
|
91
|
+
|
|
92
|
+
return formatResult(value, apiCall);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getMyPortals } from "../../funcs/getMyPortals.js";
|
|
6
6
|
import { GetMyPortalsRequest$zodSchema } from "../../models/getmyportalsop.js";
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
@@ -10,20 +10,50 @@ const args = {
|
|
|
10
10
|
request: GetMyPortalsRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$
|
|
14
|
-
name: "get-portals",
|
|
13
|
+
export const tool$getMyPortals: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "get-my-portals",
|
|
15
15
|
description: `Get All Portals Accessible To User
|
|
16
16
|
|
|
17
17
|
Get All Portals Accessible to User
|
|
18
18
|
|
|
19
19
|
## Overview
|
|
20
|
-
|
|
20
|
+
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.
|
|
21
|
+
|
|
21
22
|
- If no access tags are specified for a portal, any user can access the portal.
|
|
22
23
|
- 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.
|
|
23
24
|
- Global users (partition) cannot be assigned user profiles; their access is limited to portals without access restrictions.
|
|
24
25
|
- The only articles returned are associated to an Article type when the parameter “Include in browse on portals” is set to "Yes".
|
|
25
26
|
- 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.
|
|
26
27
|
|
|
28
|
+
## Prerequisites
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
## How to Use This Tool
|
|
32
|
+
- 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.
|
|
33
|
+
|
|
34
|
+
## Parameter Requirements
|
|
35
|
+
This tool requires **both** a query language parameter **and** an HTTP language header. An empty request object is **invalid** and MUST NOT be used.
|
|
36
|
+
|
|
37
|
+
### Required (both MUST be provided)
|
|
38
|
+
- \`Dollar_lang\` (string, default: "en-US") - Language code
|
|
39
|
+
- \`Accept-Language\` (string, default: "en-US") - Accept-Language header value
|
|
40
|
+
|
|
41
|
+
Both parameters **MUST** be present on every invocation.
|
|
42
|
+
If either parameter is missing, the request is invalid.
|
|
43
|
+
|
|
44
|
+
#### Optional
|
|
45
|
+
|
|
46
|
+
- \`Dollar_pagenum\` — Page number to retrieve (defaults to \`1\` if omitted)
|
|
47
|
+
- \`Dollar_pagesize\` — Number of items per page (server default applied if omitted)
|
|
48
|
+
|
|
49
|
+
**Example**: To get all portals accessible to the user, call with:
|
|
50
|
+
\`\`\`json
|
|
51
|
+
{"request": {"Dollar_lang": "en-US", "Accept-Language": "en-US"}}
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
## Overview
|
|
55
|
+
The Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.
|
|
56
|
+
|
|
27
57
|
## Pagination behavior (CRITICAL for AI assistants)
|
|
28
58
|
|
|
29
59
|
**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.
|
|
@@ -63,8 +93,12 @@ If you search for "business portal" and the first page returns 25 portals but no
|
|
|
63
93
|
- Search the complete merged list before concluding the portal doesn't exist
|
|
64
94
|
|
|
65
95
|
This ensures reliable portal name-to-ID resolution and prevents false "not found" errors.
|
|
96
|
+
|
|
97
|
+
## Displaying Results (MCP-Specific)
|
|
98
|
+
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.
|
|
66
99
|
`,
|
|
67
100
|
annotations: {
|
|
101
|
+
"title": "",
|
|
68
102
|
"destructiveHint": false,
|
|
69
103
|
"idempotentHint": false,
|
|
70
104
|
"openWorldHint": false,
|
|
@@ -72,7 +106,7 @@ This ensures reliable portal name-to-ID resolution and prevents false "not found
|
|
|
72
106
|
},
|
|
73
107
|
args,
|
|
74
108
|
tool: async (client, args, ctx) => {
|
|
75
|
-
const [result, apiCall] = await
|
|
109
|
+
const [result, apiCall] = await getMyPortals(
|
|
76
110
|
client,
|
|
77
111
|
args.request,
|
|
78
112
|
{ fetchOptions: { signal: ctx.signal } },
|
|
@@ -16,6 +16,45 @@ export const tool$getPopularArticles: ToolDefinition<typeof args> = {
|
|
|
16
16
|
|
|
17
17
|
Get Popular Articles
|
|
18
18
|
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999"}}\`
|
|
25
|
+
- Required parameter:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
|
|
28
|
+
- Optional parameters:
|
|
29
|
+
- \`Dollar_lang\` (string, default: "en-US") - Language code
|
|
30
|
+
- \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
|
|
31
|
+
- \`Dollar_pagesize\` (number, default: 10) - Number of results per page
|
|
32
|
+
- \`dollarFilterTopicId\` (string) - Filter by topic ID
|
|
33
|
+
- \`dollarFilterTags\` (string) - Comma-separated list of Tag/Tag Group IDs
|
|
34
|
+
|
|
35
|
+
**Example**: To get popular articles from portal "PZ-9999", call with:
|
|
36
|
+
\`\`\`json
|
|
37
|
+
{"request": {"portalID": "PZ-9999"}}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
**Example with optional parameters**:
|
|
41
|
+
\`\`\`json
|
|
42
|
+
{"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
## Displaying Results (MCP-Specific)
|
|
46
|
+
**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.
|
|
47
|
+
|
|
48
|
+
**What to display:**
|
|
49
|
+
- Display all popular articles with their names and IDs
|
|
50
|
+
- Show article summaries or descriptions when available
|
|
51
|
+
- Display metadata such as \`articleType\`, \`createdDate\`, \`modifiedDate\`
|
|
52
|
+
- Show \`imageURL\` if available (mention thumbnail availability)
|
|
53
|
+
- Include \`paginationInfo\` if pagination is used
|
|
54
|
+
- Format articles in a numbered or bulleted list
|
|
55
|
+
|
|
56
|
+
**Example**: "Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]..."
|
|
57
|
+
|
|
19
58
|
## Prerequisites
|
|
20
59
|
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
21
60
|
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
@@ -26,6 +65,7 @@ The Popular Articles API allows a user to retrieve the most popular articles fro
|
|
|
26
65
|
This API returns a list of popular articles with their metadata, allowing users to discover the most relevant and frequently accessed content within the portal.
|
|
27
66
|
`,
|
|
28
67
|
annotations: {
|
|
68
|
+
"title": "",
|
|
29
69
|
"destructiveHint": false,
|
|
30
70
|
"idempotentHint": false,
|
|
31
71
|
"openWorldHint": false,
|
|
@@ -16,6 +16,49 @@ export const tool$makeSuggestion: ToolDefinition<typeof args> = {
|
|
|
16
16
|
|
|
17
17
|
Make a Suggestion
|
|
18
18
|
|
|
19
|
+
## How to Use This Tool
|
|
20
|
+
|
|
21
|
+
**CRITICAL**: This tool requires a \`request\` parameter containing the request object. All parameters must be passed inside a \`request\` object.
|
|
22
|
+
|
|
23
|
+
**Parameter Format**:
|
|
24
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "CreateSuggestion": {...}}}\`
|
|
25
|
+
- Required parameters:
|
|
26
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
27
|
+
- \`CreateSuggestion\` (object) - The suggestion object with:
|
|
28
|
+
- \`name\` (string, **required**) - Name/title of the suggestion
|
|
29
|
+
- \`content\` (string, **required**) - Content/description of the suggestion
|
|
30
|
+
- \`language\` (object, **required**) - Language object with \`code\` property (e.g., {"code": "en-US"})
|
|
31
|
+
- \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
|
|
32
|
+
|
|
33
|
+
- Optional parameters:
|
|
34
|
+
- \`CreateSuggestion\` additional optional fields:
|
|
35
|
+
- \`description\` (string) - Additional description
|
|
36
|
+
- \`feedbackArticle\` (object) - Article ID object if providing feedback on existing article: \`{"id": "PROD-2996"}\`
|
|
37
|
+
- \`attachments\` (object) - Attachments object
|
|
38
|
+
- \`customAttributes\` (array) - Custom attributes array
|
|
39
|
+
|
|
40
|
+
**Example**: To create a suggestion in portal "PZ-9999", call with:
|
|
41
|
+
\`\`\`json
|
|
42
|
+
{"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "New Article Request", "content": "Please add information about loan rates", "language": {"code": "en-US"}}}}
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
**Example with feedback on existing article**:
|
|
46
|
+
\`\`\`json
|
|
47
|
+
{"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "Article Feedback", "content": "This article needs updating", "language": {"code": "en-US"}, "feedbackArticle": {"id": "PROD-2996"}}}}
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
## Displaying Results (MCP-Specific)
|
|
51
|
+
**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.
|
|
52
|
+
|
|
53
|
+
**What to display:**
|
|
54
|
+
- Confirm that the suggestion was successfully created
|
|
55
|
+
- Display the suggestion \`id\` if returned in the response
|
|
56
|
+
- Show the suggestion \`name\` and \`content\` that was submitted
|
|
57
|
+
- If an error occurs, display the error message clearly
|
|
58
|
+
- Provide confirmation message to the user
|
|
59
|
+
|
|
60
|
+
**Example**: "Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]..."
|
|
61
|
+
|
|
19
62
|
## Prerequisites
|
|
20
63
|
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
21
64
|
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
|
|
@@ -26,6 +69,7 @@ The Make a Suggestion API allows users to create an Article Suggestion from with
|
|
|
26
69
|
Users can submit suggestions with details about what they're looking for, which helps content creators understand user needs and improve the knowledge base.
|
|
27
70
|
`,
|
|
28
71
|
annotations: {
|
|
72
|
+
"title": "",
|
|
29
73
|
"destructiveHint": false,
|
|
30
74
|
"idempotentHint": false,
|
|
31
75
|
"openWorldHint": false,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { retrieveChunks } from "../../funcs/retrieveChunks.js";
|
|
6
|
+
import { RetrieveChunksRequest$zodSchema } from "../../models/retrievechunksop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: RetrieveChunksRequest$zodSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$retrieveChunks: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "retrieve-chunks",
|
|
15
|
+
description: `Retrieve Chunks
|
|
16
|
+
|
|
17
|
+
Retrieve Chunks
|
|
18
|
+
## Overview
|
|
19
|
+
The Retrieve API enables enterprises to directly access relevant content chunks from their organizational knowledge sources. It is designed for scenarios where developers want granular control over retrieved information, such as powering custom search, analytics, or retrieval-augmented generation (RAG) pipelines.
|
|
20
|
+
In 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.
|
|
21
|
+
By leveraging the Retrieve API, organizations can build tailored experiences while retaining confidence in the source material.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
|
|
25
|
+
- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
|
|
26
|
+
|
|
27
|
+
## How to Use This Tool
|
|
28
|
+
All 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.
|
|
29
|
+
|
|
30
|
+
**Parameter Format**:
|
|
31
|
+
- Always wrap parameters in a \`request\` object: \`{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}\`
|
|
32
|
+
- Required parameters:
|
|
33
|
+
- \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
|
|
34
|
+
- \`q\` (string) - The search query string
|
|
35
|
+
- \`Dollar_lang\` (string) - Language code (e.g., "en-US")
|
|
36
|
+
- Optional parameters:
|
|
37
|
+
- \`dollarFilterUserProfileID\` (string) - User profile ID filter
|
|
38
|
+
- \`dollarFilterTags\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
|
|
39
|
+
- \`dollarFilterTopicIds\` (array) - Array of topic IDs to filter by
|
|
40
|
+
- \`RetrieveRequest\` (object) - Additional request body parameters:
|
|
41
|
+
- \`channel\` (object) - Channel information (optional, recommended to omit)
|
|
42
|
+
- \`eventId\` (string) - Event ID
|
|
43
|
+
- \`sessionId\` (string) - Session ID
|
|
44
|
+
|
|
45
|
+
**Example**: To retrieve chunks for query "loan information" from portal "PZ-9999", call with:
|
|
46
|
+
\`\`\`json
|
|
47
|
+
{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
**Example with RetrieveRequest body**:
|
|
51
|
+
\`\`\`json
|
|
52
|
+
{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "RetrieveRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
## Displaying Results (MCP-Specific)
|
|
56
|
+
**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.
|
|
57
|
+
|
|
58
|
+
**What to display:**
|
|
59
|
+
Always 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.
|
|
60
|
+
|
|
61
|
+
**Example**: "I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]..."
|
|
62
|
+
`,
|
|
63
|
+
annotations: {
|
|
64
|
+
"title": "",
|
|
65
|
+
"destructiveHint": false,
|
|
66
|
+
"idempotentHint": false,
|
|
67
|
+
"openWorldHint": false,
|
|
68
|
+
"readOnlyHint": false,
|
|
69
|
+
},
|
|
70
|
+
args,
|
|
71
|
+
tool: async (client, args, ctx) => {
|
|
72
|
+
const [result, apiCall] = await retrieveChunks(
|
|
73
|
+
client,
|
|
74
|
+
args.request,
|
|
75
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
76
|
+
).$inspect();
|
|
77
|
+
|
|
78
|
+
if (!result.ok) {
|
|
79
|
+
return {
|
|
80
|
+
content: [{ type: "text", text: result.error.message }],
|
|
81
|
+
isError: true,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const value = result.value;
|
|
86
|
+
|
|
87
|
+
return formatResult(value, apiCall);
|
|
88
|
+
},
|
|
89
|
+
};
|