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