@egain/egain-mcp-server 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +18 -43
  2. package/bin/mcp-server.js +335 -89
  3. package/bin/mcp-server.js.map +24 -25
  4. package/esm/src/funcs/getAnnouncements.d.ts +39 -1
  5. package/esm/src/funcs/getAnnouncements.d.ts.map +1 -1
  6. package/esm/src/funcs/getAnnouncements.js +39 -1
  7. package/esm/src/funcs/getAnnouncements.js.map +1 -1
  8. package/esm/src/funcs/getArticle.d.ts +42 -0
  9. package/esm/src/funcs/getArticle.d.ts.map +1 -1
  10. package/esm/src/funcs/getArticle.js +42 -0
  11. package/esm/src/funcs/getArticle.js.map +1 -1
  12. package/esm/src/funcs/getPopularArticles.d.ts +37 -0
  13. package/esm/src/funcs/getPopularArticles.d.ts.map +1 -1
  14. package/esm/src/funcs/getPopularArticles.js +37 -0
  15. package/esm/src/funcs/getPopularArticles.js.map +1 -1
  16. package/esm/src/funcs/getPortals.d.ts +26 -1
  17. package/esm/src/funcs/getPortals.d.ts.map +1 -1
  18. package/esm/src/funcs/getPortals.js +35 -10
  19. package/esm/src/funcs/getPortals.js.map +1 -1
  20. package/esm/src/funcs/makeSuggestion.d.ts +42 -0
  21. package/esm/src/funcs/makeSuggestion.d.ts.map +1 -1
  22. package/esm/src/funcs/makeSuggestion.js +42 -0
  23. package/esm/src/funcs/makeSuggestion.js.map +1 -1
  24. package/esm/src/funcs/queryAnswers.d.ts +41 -5
  25. package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
  26. package/esm/src/funcs/queryAnswers.js +41 -5
  27. package/esm/src/funcs/queryAnswers.js.map +1 -1
  28. package/esm/src/funcs/queryRetrieve.d.ts +41 -1
  29. package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
  30. package/esm/src/funcs/queryRetrieve.js +41 -1
  31. package/esm/src/funcs/queryRetrieve.js.map +1 -1
  32. package/esm/src/funcs/querySearch.d.ts +48 -1
  33. package/esm/src/funcs/querySearch.d.ts.map +1 -1
  34. package/esm/src/funcs/querySearch.js +48 -1
  35. package/esm/src/funcs/querySearch.js.map +1 -1
  36. package/esm/src/lib/config.d.ts +2 -2
  37. package/esm/src/lib/config.js +2 -2
  38. package/esm/src/mcp-server/mcp-server.js +1 -1
  39. package/esm/src/mcp-server/server.js +1 -1
  40. package/esm/src/mcp-server/tools/getAnnouncements.d.ts.map +1 -1
  41. package/esm/src/mcp-server/tools/getAnnouncements.js +39 -1
  42. package/esm/src/mcp-server/tools/getAnnouncements.js.map +1 -1
  43. package/esm/src/mcp-server/tools/getArticle.d.ts.map +1 -1
  44. package/esm/src/mcp-server/tools/getArticle.js +42 -0
  45. package/esm/src/mcp-server/tools/getArticle.js.map +1 -1
  46. package/esm/src/mcp-server/tools/getPopularArticles.d.ts.map +1 -1
  47. package/esm/src/mcp-server/tools/getPopularArticles.js +37 -0
  48. package/esm/src/mcp-server/tools/getPopularArticles.js.map +1 -1
  49. package/esm/src/mcp-server/tools/getPortals.d.ts +1 -1
  50. package/esm/src/mcp-server/tools/getPortals.d.ts.map +1 -1
  51. package/esm/src/mcp-server/tools/getPortals.js +26 -1
  52. package/esm/src/mcp-server/tools/getPortals.js.map +1 -1
  53. package/esm/src/mcp-server/tools/makeSuggestion.d.ts.map +1 -1
  54. package/esm/src/mcp-server/tools/makeSuggestion.js +42 -0
  55. package/esm/src/mcp-server/tools/makeSuggestion.js.map +1 -1
  56. package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
  57. package/esm/src/mcp-server/tools/queryAnswers.js +41 -5
  58. package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
  59. package/esm/src/mcp-server/tools/queryRetrieve.d.ts.map +1 -1
  60. package/esm/src/mcp-server/tools/queryRetrieve.js +41 -1
  61. package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
  62. package/esm/src/mcp-server/tools/querySearch.d.ts.map +1 -1
  63. package/esm/src/mcp-server/tools/querySearch.js +48 -1
  64. package/esm/src/mcp-server/tools/querySearch.js.map +1 -1
  65. package/esm/src/models/articletype.d.ts +1 -6
  66. package/esm/src/models/articletype.d.ts.map +1 -1
  67. package/esm/src/models/articletype.js +1 -15
  68. package/esm/src/models/articletype.js.map +1 -1
  69. package/esm/src/models/getmyportalsop.d.ts +2 -2
  70. package/esm/src/models/getmyportalsop.d.ts.map +1 -1
  71. package/esm/src/models/getmyportalsop.js +2 -2
  72. package/esm/src/models/getmyportalsop.js.map +1 -1
  73. package/manifest.json +10 -10
  74. package/package.json +1 -1
  75. package/src/funcs/getAnnouncements.ts +39 -1
  76. package/src/funcs/getArticle.ts +42 -0
  77. package/src/funcs/getPopularArticles.ts +37 -0
  78. package/src/funcs/getPortals.ts +37 -12
  79. package/src/funcs/makeSuggestion.ts +42 -0
  80. package/src/funcs/queryAnswers.ts +41 -5
  81. package/src/funcs/queryRetrieve.ts +41 -1
  82. package/src/funcs/querySearch.ts +48 -1
  83. package/src/lib/config.ts +2 -2
  84. package/src/mcp-server/mcp-server.ts +1 -1
  85. package/src/mcp-server/server.ts +1 -1
  86. package/src/mcp-server/tools/getAnnouncements.ts +39 -1
  87. package/src/mcp-server/tools/getArticle.ts +42 -0
  88. package/src/mcp-server/tools/getPopularArticles.ts +37 -0
  89. package/src/mcp-server/tools/getPortals.ts +26 -1
  90. package/src/mcp-server/tools/makeSuggestion.ts +42 -0
  91. package/src/mcp-server/tools/queryAnswers.ts +41 -5
  92. package/src/mcp-server/tools/queryRetrieve.ts +41 -1
  93. package/src/mcp-server/tools/querySearch.ts +48 -1
  94. package/src/models/articletype.ts +2 -19
  95. package/src/models/getmyportalsop.ts +5 -5
  96. package/src/models/mandatorylanguagequeryparameter.ts +0 -59
@@ -16,9 +16,47 @@ export const tool$getAnnouncements: ToolDefinition<typeof args> = {
16
16
 
17
17
  Get Announcements
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: \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
26
+ - Optional parameters:
27
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
28
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
29
+ - \`dollarFilterTags\` (string) - Comma-separated list of Tag/Tag Group IDs
30
+ - \`workflowMilestone\` (string) - Workflow milestone filter ("authoring", "staging", "publish")
31
+ - \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
32
+ - \`Dollar_pagesize\` (number, default: 10) - Number of results per page
33
+
34
+ **Example**: To get announcements from portal "PZ-9999", call with:
35
+ \`\`\`json
36
+ {"request": {"portalID": "PZ-9999"}}
37
+ \`\`\`
38
+
39
+ **Example with optional parameters**:
40
+ \`\`\`json
41
+ {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
42
+ \`\`\`
43
+
44
+ ## Displaying Results (MCP-Specific)
45
+ **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.
46
+
47
+ **What to display:**
48
+ - Display all announcement articles with their names and IDs
49
+ - Show the article content (\`content\` or \`contentText\`) for each announcement
50
+ - Display metadata such as \`createdDate\`, \`modifiedDate\`, \`articleSummary\`
51
+ - Show \`attachments\` if present
52
+ - Include \`paginationInfo\` if pagination is used
53
+ - Format announcements in a clear list format
54
+
55
+ **Example**: "Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]..."
56
+
19
57
  ## Prerequisites
20
58
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
21
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
59
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
22
60
 
23
61
  ## Overview
24
62
  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.
@@ -16,6 +16,48 @@ export const tool$getArticle: ToolDefinition<typeof args> = {
16
16
 
17
17
  Get Article by ID
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", "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
+ - Optional parameters:
29
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
30
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
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
+
19
61
  ## Prerequisites
20
62
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
21
63
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -16,6 +16,43 @@ 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: \`portalID\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
26
+ - Optional parameters:
27
+ - \`Dollar_lang\` (string, default: "en-US") - Language code
28
+ - \`Dollar_pagenum\` (number, default: 1) - Page number for pagination
29
+ - \`Dollar_pagesize\` (number, default: 10) - Number of results per page
30
+ - \`dollarFilterTopicId\` (string) - Filter by topic ID
31
+ - \`dollarFilterTags\` (string) - Comma-separated list of Tag/Tag Group IDs
32
+
33
+ **Example**: To get popular articles from portal "PZ-9999", call with:
34
+ \`\`\`json
35
+ {"request": {"portalID": "PZ-9999"}}
36
+ \`\`\`
37
+
38
+ **Example with optional parameters**:
39
+ \`\`\`json
40
+ {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
41
+ \`\`\`
42
+
43
+ ## Displaying Results (MCP-Specific)
44
+ **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.
45
+
46
+ **What to display:**
47
+ - Display all popular articles with their names and IDs
48
+ - Show article summaries or descriptions when available
49
+ - Display metadata such as \`articleType\`, \`createdDate\`, \`modifiedDate\`
50
+ - Show \`imageURL\` if available (mention thumbnail availability)
51
+ - Include \`paginationInfo\` if pagination is used
52
+ - Format articles in a numbered or bulleted list
53
+
54
+ **Example**: "Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]..."
55
+
19
56
  ## Prerequisites
20
57
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
21
58
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -7,7 +7,7 @@ import { GetMyPortalsRequest$zodSchema } from "../../models/getmyportalsop.js";
7
7
  import { formatResult, ToolDefinition } from "../tools.js";
8
8
 
9
9
  const args = {
10
- request: GetMyPortalsRequest$zodSchema,
10
+ request: GetMyPortalsRequest$zodSchema.optional(),
11
11
  };
12
12
 
13
13
  export const tool$getPortals: ToolDefinition<typeof args> = {
@@ -16,6 +16,15 @@ export const tool$getPortals: ToolDefinition<typeof args> = {
16
16
 
17
17
  Get All Portals Accessible to User
18
18
 
19
+ ## How to Use This Tool
20
+
21
+ **Parameter Format**: This tool requires a \`request\` parameter containing the request object.
22
+ - **CRITICAL**: All parameters in this tool are optional. You may pass an empty request object: \`{"request": {}}\`
23
+ - If you want to specify a language, pass: \`{"request": {"Dollar_lang": "en-US"}}\`
24
+ - The \`Dollar_lang\` parameter is **optional** - if omitted, the API defaults to "en-US"
25
+ - **Example with empty request** (recommended if you don't need to specify language): \`{"request": {}}\`
26
+ - **Example with language**: \`{"request": {"Dollar_lang": "en-US"}}\`
27
+
19
28
  ## Overview
20
29
  The Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.
21
30
  - If no access tags are specified for a portal, any user can access the portal.
@@ -63,6 +72,22 @@ If you search for "business portal" and the first page returns 25 portals but no
63
72
  - Search the complete merged list before concluding the portal doesn't exist
64
73
 
65
74
  This ensures reliable portal name-to-ID resolution and prevents false "not found" errors.
75
+
76
+ ## Displaying Results (MCP-Specific)
77
+ **CRITICAL**: When this tool returns data successfully, you MUST display the portal information to the user in your response. Do not silently process the data - always show the user what was returned.
78
+
79
+ **What to display:**
80
+ - Display all portals with their names and IDs
81
+ - Show portal \`id\` (the portal ID needed for other API calls)
82
+ - Display portal \`name\` (the human-readable portal name)
83
+ - Show \`departmentName\` if available
84
+ - Include \`shortURL\` if available
85
+ - Display \`paginationInfo\` to show total count and current page
86
+ - Format portals in a clear list format (e.g., "Portal Name (ID: PORTAL-123)")
87
+
88
+ **Example**: "Here are the available portals: 1) Business Portal (ID: PORTAL-123), 2) Customer Portal (ID: PORTAL-456)..."
89
+
90
+ **Important**: Always display portal IDs clearly, as users will need these IDs to call other tools.
66
91
  `,
67
92
  annotations: {
68
93
  "destructiveHint": false,
@@ -16,6 +16,48 @@ 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
+ - Optional parameters:
32
+ - \`acceptLanguage\` (string, default: "en-US") - Accept-Language header value
33
+ - \`CreateSuggestion\` additional optional fields:
34
+ - \`description\` (string) - Additional description
35
+ - \`feedbackArticle\` (object) - Article ID object if providing feedback on existing article: \`{"id": "PROD-2996"}\`
36
+ - \`attachments\` (object) - Attachments object
37
+ - \`customAttributes\` (array) - Custom attributes array
38
+
39
+ **Example**: To create a suggestion in portal "PZ-9999", call with:
40
+ \`\`\`json
41
+ {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "New Article Request", "content": "Please add information about loan rates", "language": {"code": "en-US"}}}}
42
+ \`\`\`
43
+
44
+ **Example with feedback on existing article**:
45
+ \`\`\`json
46
+ {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "Article Feedback", "content": "This article needs updating", "language": {"code": "en-US"}, "feedbackArticle": {"id": "PROD-2996"}}}}
47
+ \`\`\`
48
+
49
+ ## Displaying Results (MCP-Specific)
50
+ **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.
51
+
52
+ **What to display:**
53
+ - Confirm that the suggestion was successfully created
54
+ - Display the suggestion \`id\` if returned in the response
55
+ - Show the suggestion \`name\` and \`content\` that was submitted
56
+ - If an error occurs, display the error message clearly
57
+ - Provide confirmation message to the user
58
+
59
+ **Example**: "Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]..."
60
+
19
61
  ## Prerequisites
20
62
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
21
63
  - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -16,18 +16,54 @@ export const tool$queryAnswers: ToolDefinition<typeof args> = {
16
16
 
17
17
  Get Answers
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", "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
+
19
59
  ## Prerequisites
20
60
  - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
21
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
61
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
22
62
 
23
63
  ## Overview
24
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.
25
65
 
26
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.
27
-
28
- ## Request Body Notes
29
- - **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.
30
- - **Required fields**: eventId and sessionId are required in the request body.
31
67
  `,
32
68
  annotations: {
33
69
  "destructiveHint": false,
@@ -16,9 +16,49 @@ export const tool$queryRetrieve: ToolDefinition<typeof args> = {
16
16
 
17
17
  Retrieve Chunks
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", "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
+ - \`RetrieveRequest\` (object) - Additional request body parameters:
34
+ - \`channel\` (object) - Channel information (optional, recommended to omit)
35
+ - \`eventId\` (string) - Event ID
36
+ - \`sessionId\` (string) - Session ID
37
+
38
+ **Example**: To retrieve chunks for query "loan information" from portal "PZ-9999", call with:
39
+ \`\`\`json
40
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}
41
+ \`\`\`
42
+
43
+ **Example with RetrieveRequest body**:
44
+ \`\`\`json
45
+ {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "RetrieveRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
46
+ \`\`\`
47
+
48
+ ## Displaying Results (MCP-Specific)
49
+ **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.
50
+
51
+ **What to display:**
52
+ - If a certified answer is returned (\`answer\` object), display the \`answerValue\` text and list the \`references\` (article IDs and names)
53
+ - Display all \`searchResults\` with their article names, IDs, snippets, and relevance scores (\`normalizedScore\`)
54
+ - Show article metadata such as \`docType\`, \`source\`, and \`topicBreadcrumb\` when available
55
+ - Format the results in a user-friendly way (e.g., numbered list, formatted text)
56
+
57
+ **Example**: "I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]..."
58
+
19
59
  ## Prerequisites
20
60
  - **Requires a valid portal ID** (required parameter). If you don't have the portal ID, first call 'get-portals' to get available portals.
21
- - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
61
+ - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
22
62
 
23
63
  ## Overview
24
64
  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.
@@ -14,7 +14,54 @@ export const tool$querySearch: ToolDefinition<typeof args> = {
14
14
  name: "query-search",
15
15
  description: `Hybrid Search
16
16
 
17
- 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.**
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.
18
65
  `,
19
66
  annotations: {
20
67
  "destructiveHint": false,
@@ -4,29 +4,12 @@
4
4
 
5
5
  import * as z from "zod";
6
6
 
7
- /**
8
- * Indicates the article category name.
9
- */
10
- export const TypeName$zodSchema = z.enum([
11
- "General",
12
- "Guided Help",
13
- "Data Link",
14
- "PDF Content",
15
- "Topic Home",
16
- "Suggestion",
17
- "Virtual Assistant Action",
18
- "Rich Message",
19
- "Library Content",
20
- ]).describe("Indicates the article category name.");
21
-
22
- export type TypeName = z.infer<typeof TypeName$zodSchema>;
23
-
24
7
  /**
25
8
  * The type of the Article and its attributes.
26
9
  */
27
10
  export type ArticleType = {
28
11
  articleCategoryId?: number | undefined;
29
- typeName?: TypeName | undefined;
12
+ typeName?: string | undefined;
30
13
  useStructuredAuthoring?: boolean | undefined;
31
14
  articleTypeId?: string | undefined;
32
15
  };
@@ -38,6 +21,6 @@ export const ArticleType$zodSchema: z.ZodType<
38
21
  > = z.object({
39
22
  articleCategoryId: z.number().int().optional(),
40
23
  articleTypeId: z.string().optional(),
41
- typeName: TypeName$zodSchema.optional(),
24
+ typeName: z.string().optional(),
42
25
  useStructuredAuthoring: z.boolean().optional(),
43
26
  }).describe("The type of the Article and its attributes.");
@@ -9,9 +9,9 @@ import {
9
9
  AllAccessiblePortals$zodSchema,
10
10
  } from "./allaccessibleportals.js";
11
11
  import {
12
- MandatoryLanguageQueryParameter,
13
- MandatoryLanguageQueryParameter$zodSchema,
14
- } from "./mandatorylanguagequeryparameter.js";
12
+ LanguageQueryParameter,
13
+ LanguageQueryParameter$zodSchema,
14
+ } from "./languagequeryparameter.js";
15
15
  import { Order, Order$zodSchema } from "./order.js";
16
16
  import {
17
17
  SortIdNameDepartment,
@@ -21,7 +21,7 @@ import { WSErrorCommon, WSErrorCommon$zodSchema } from "./wserrorcommon.js";
21
21
 
22
22
  export type GetMyPortalsRequest = {
23
23
  acceptLanguage?: AcceptLanguage | undefined;
24
- Dollar_lang: MandatoryLanguageQueryParameter;
24
+ Dollar_lang?: LanguageQueryParameter | undefined;
25
25
  department?: string | undefined;
26
26
  filterText?: string | undefined;
27
27
  shortUrlTemplate?: string | undefined;
@@ -36,7 +36,7 @@ export const GetMyPortalsRequest$zodSchema: z.ZodType<
36
36
  z.ZodTypeDef,
37
37
  unknown
38
38
  > = z.object({
39
- Dollar_lang: MandatoryLanguageQueryParameter$zodSchema,
39
+ Dollar_lang: LanguageQueryParameter$zodSchema.default("en-US"),
40
40
  Dollar_order: Order$zodSchema.optional(),
41
41
  Dollar_pagenum: z.number().int().default(1).describe(
42
42
  "Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.",
@@ -1,59 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- /**
8
- * The language used for fetching the details of a resource. Resources available in different languages may differ from each other. **Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.
9
- */
10
- export const MandatoryLanguageQueryParameter$zodSchema = z.enum([
11
- "en-US",
12
- "fr-FR",
13
- "en-GB",
14
- "es-ES",
15
- "it-IT",
16
- "nl-NL",
17
- "da-DA",
18
- "sv-SE",
19
- "pt-PT",
20
- "fi-FI",
21
- "no-NB",
22
- "no-NN",
23
- "ja-JA",
24
- "de-DE",
25
- "pt-BR",
26
- "zh-CN",
27
- "zh-TW",
28
- "ko-KO",
29
- "ru-RU",
30
- "el-EL",
31
- "tr-TR",
32
- "pl-PL",
33
- "cs-CS",
34
- "sk-SK",
35
- "hu-HU",
36
- "sr-SR",
37
- "ar-SA",
38
- "hr-HR",
39
- "ro-RO",
40
- "th-TH",
41
- "de-AT",
42
- "vi-VN",
43
- "id-ID",
44
- "ms-MY",
45
- "fil-PH",
46
- "fr-CA",
47
- "hi-IN",
48
- "uk-UA",
49
- "bg-BG",
50
- "sl-SI",
51
- "sr-RS",
52
- "xx-XX",
53
- ]).describe(
54
- "The language used for fetching the details of a resource. Resources available in different languages may differ from each other. **Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.",
55
- );
56
-
57
- export type MandatoryLanguageQueryParameter = z.infer<
58
- typeof MandatoryLanguageQueryParameter$zodSchema
59
- >;