@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
package/manifest.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "dxt_version": "0.1",
3
3
  "name": "@egain/egain-mcp-server",
4
- "version": "1.0.24",
4
+ "version": "1.0.25",
5
5
  "description": "",
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.",
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.\n\n## How to Use eGain MCP Tools\n\n**IMPORTANT**: When calling eGain MCP tools, you must provide all required parameters in the correct format.\n\n### Parameter Format\n- **All tools require a `request` parameter** that contains the actual request object\n- The `request` parameter is an object that wraps all the API-specific parameters\n- **Example**: To call `get-portals`, pass: `{\"request\": {\"$lang\": \"en-US\"}}`\n- **Example**: To call `get-article`, pass: `{\"request\": {\"portalID\": \"PROD-1004\", \"articleID\": \"PROD-2996\"}}`\n\n### Tools That Require No Parameters\n- Some tools may accept an empty request object `{}` if all parameters are optional\n- Always check the tool schema for exact requirements\n- If a tool has required parameters, they must be provided in the `request` object\n\n### Common Patterns\n1. **Portal ID is often required**: Most tools need a `portalID`. Use `get-portals` first to find available portals\n2. **Language parameter**: Many tools accept `$lang` (use `Dollar_lang` in the request object) with default \"en-US\"\n3. **Request body**: For POST endpoints, include the request body fields inside the `request` object\n\n### Error Prevention\n- Always provide the `request` parameter, even if it's an empty object `{}`\n- Ensure all required fields are present in the `request` object\n- Check the tool schema to understand the exact structure expected\n",
7
7
  "author": {
8
8
  "name": "Emily Loh - eGain Corporation"
9
9
  },
@@ -28,35 +28,35 @@
28
28
  "tools": [
29
29
  {
30
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"
31
+ "description": "Retrieve Chunks\n\nRetrieve Chunks\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}\\`\n- Required parameters:\n - \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - \\`q\\` (string) - The search query string\n - \\`Dollar_lang\\` (string) - Language code (e.g., \"en-US\")\n- Optional parameters:\n - \\`dollarFilterUserProfileID\\` (string) - User profile ID filter\n - \\`dollarFilterTags\\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - \\`dollarFilterTopicIds\\` (array) - Array of topic IDs to filter by\n - \\`RetrieveRequest\\` (object) - Additional request body parameters:\n - \\`channel\\` (object) - Channel information (optional, recommended to omit)\n - \\`eventId\\` (string) - Event ID\n - \\`sessionId\\` (string) - Session ID\n\n**Example**: To retrieve chunks for query \"loan information\" from portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}\n\\`\\`\\`\n\n**Example with RetrieveRequest body**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"RetrieveRequest\": {\"eventId\": \"event-123\", \"sessionId\": \"session-456\"}}}\n\\`\\`\\`\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the results to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- If a certified answer is returned (\\`answer\\` object), display the \\`answerValue\\` text and list the \\`references\\` (article IDs and names)\n- Display all \\`searchResults\\` with their article names, IDs, snippets, and relevance scores (\\`normalizedScore\\`)\n- Show article metadata such as \\`docType\\`, \\`source\\`, and \\`topicBreadcrumb\\` when available\n- Format the results in a user-friendly way (e.g., numbered list, formatted text)\n\n**Example**: \"I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]...\"\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., \"PROD-1004\")\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
32
  },
33
33
  {
34
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"
35
+ "description": "Generate an Answer\n\nGet Answers\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\"}}\\`\n- Required parameters:\n - \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - \\`q\\` (string) - The search query string\n - \\`Dollar_lang\\` (string) - Language code (e.g., \"en-US\")\n- Optional parameters:\n - \\`dollarFilterUserProfileID\\` (string) - User profile ID filter\n - \\`dollarFilterTags\\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - \\`dollarFilterTopicIds\\` (array) - Array of topic IDs to filter by\n - \\`AnswersRequest\\` (object) - Request body parameters:\n - \\`eventId\\` (string, **required**) - Event ID\n - \\`sessionId\\` (string, **required**) - Session ID\n - \\`channel\\` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.\n - \\`context\\` (object) - Additional context (companyContext, pageContext, userContext)\n\n**Example**: To get answers for query \"loan information\" from portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"AnswersRequest\": {\"eventId\": \"event-123\", \"sessionId\": \"session-456\"}}}\n\\`\\`\\`\n\n**Note**: The \\`channel\\` field in \\`AnswersRequest\\` is optional and recommended to omit unless specifically needed. The API works reliably without it.\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the results to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Display the \\`answer.answerValue\\` text prominently as the main answer to the user's query\n- Indicate the answer type (\\`answerType\\`: \"certified\" or \"generative\")\n- If \\`relevanceScore\\` is present, you may mention the confidence level\n- List all \\`references\\` (article IDs and names) that were used to generate the answer\n- Display \\`searchResults\\` showing related articles with their names, IDs, snippets, and relevance scores\n- Format the answer in a clear, readable way - this is the primary response the user is seeking\n\n**Example**: \"Based on the knowledge base, here's the answer: [answerValue]. This answer was generated using information from: [list references]. Related articles: [list search results]...\"\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"PROD-1004\")\n\n## Overview\nThe Answers API enables users to get the best answer for a user query. This API can return certified answers or generative answers along with search results, providing users with comprehensive responses to their questions.\n\nThe API leverages AI capabilities to provide intelligent answers based on the knowledge base content, making it easier for users to find the information they need quickly and accurately.\n"
36
36
  },
37
37
  {
38
38
  "name": "get-article",
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"
39
+ "description": "Get Article by ID\n\nGet Article by ID\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\"}}\\`\n- Required parameters:\n - \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - \\`articleID\\` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PROD-2996\")\n- Optional parameters:\n - \\`Dollar_lang\\` (string, default: \"en-US\") - Language code\n - \\`acceptLanguage\\` (string, default: \"en-US\") - Accept-Language header value\n - \\`articleAdditionalAttributes\\` (array) - Additional article attributes to return\n - \\`Dollar_customAdditionalAttributes\\` (string) - Custom additional attributes\n - \\`accessSource\\` (string, default: \"article_view\") - How the article was accessed\n - \\`publishViewId\\` (string) - Publish view ID\n - \\`workflowMilestone\\` (string) - Workflow milestone filter\n\n**Example**: To get article \"PROD-2996\" from portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\"}}\n\\`\\`\\`\n\n**Example with optional parameters**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"articleID\": \"PROD-2996\", \"Dollar_lang\": \"en-US\", \"accessSource\": \"article_view\"}}\n\\`\\`\\`\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the article content to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Display the article \\`name\\` as the title\n- Show the article \\`content\\` or \\`contentText\\` (the full article body)\n- Display article metadata: \\`id\\`, \\`articleType\\`, \\`createdDate\\`, \\`modifiedDate\\`\n- Show \\`attachments\\` if present\n- Display \\`topicBreadcrumb\\` to show where the article is categorized\n- Include any other relevant metadata like \\`articleSummary\\`, \\`description\\`, \\`articleKeywords\\`\n- Format the article content in a readable way for the user\n\n**Example**: \"Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]...\"\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n- Requires a valid article ID. Article ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"PROD-2996\")\n\n## Overview\nThe Get Article by ID API allows a user to retrieve a specific article using its ID. Additional article attributes and contextual views can be specified in the query parameters.\n\nThis API returns structured authoring attributes of Issue, Environment, Cause and Confidence Level when the following conditions are met:\n- The \"Allow Structured Authoring\" setting is enabled at the partition/department level\n- The \"Use Structured Authoring\" flag is set on the article type\n"
40
40
  },
41
41
  {
42
42
  "name": "get-announcements",
43
- "description": "Get Announcement Articles\n\nGet Announcements\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 Get Announcements API allows a user to retrieve all announcement articles for a specific portal. Announcements are special articles that are prominently displayed to users and typically contain important updates, news, or notifications.\n\nThis API returns announcement articles with their full content, metadata, and any associated attachments or links.\n"
43
+ "description": "Get Announcement Articles\n\nGet Announcements\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\"}}\\`\n- Required parameter: \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n- Optional parameters:\n - \\`Dollar_lang\\` (string, default: \"en-US\") - Language code\n - \\`acceptLanguage\\` (string, default: \"en-US\") - Accept-Language header value\n - \\`dollarFilterTags\\` (string) - Comma-separated list of Tag/Tag Group IDs\n - \\`workflowMilestone\\` (string) - Workflow milestone filter (\"authoring\", \"staging\", \"publish\")\n - \\`Dollar_pagenum\\` (number, default: 1) - Page number for pagination\n - \\`Dollar_pagesize\\` (number, default: 10) - Number of results per page\n\n**Example**: To get announcements from portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\"}}\n\\`\\`\\`\n\n**Example with optional parameters**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 20}}\n\\`\\`\\`\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the announcement articles to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Display all announcement articles with their names and IDs\n- Show the article content (\\`content\\` or \\`contentText\\`) for each announcement\n- Display metadata such as \\`createdDate\\`, \\`modifiedDate\\`, \\`articleSummary\\`\n- Show \\`attachments\\` if present\n- Include \\`paginationInfo\\` if pagination is used\n- Format announcements in a clear list format\n\n**Example**: \"Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]...\"\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"PROD-1004\")\n\n## Overview\nThe Get Announcements API allows a user to retrieve all announcement articles for a specific portal. Announcements are special articles that are prominently displayed to users and typically contain important updates, news, or notifications.\n\nThis API returns announcement articles with their full content, metadata, and any associated attachments or links.\n"
44
44
  },
45
45
  {
46
46
  "name": "get-popular-articles",
47
- "description": "Get Popular Articles\n\nGet Popular Articles\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe Popular Articles API allows a user to retrieve the most popular articles from a specific portal. Popular articles are typically determined by user engagement metrics such as views, ratings, or usage frequency.\n\nThis API returns a list of popular articles with their metadata, allowing users to discover the most relevant and frequently accessed content within the portal.\n"
47
+ "description": "Get Popular Articles\n\nGet Popular Articles\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\"}}\\`\n- Required parameter: \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n- Optional parameters:\n - \\`Dollar_lang\\` (string, default: \"en-US\") - Language code\n - \\`Dollar_pagenum\\` (number, default: 1) - Page number for pagination\n - \\`Dollar_pagesize\\` (number, default: 10) - Number of results per page\n - \\`dollarFilterTopicId\\` (string) - Filter by topic ID\n - \\`dollarFilterTags\\` (string) - Comma-separated list of Tag/Tag Group IDs\n\n**Example**: To get popular articles from portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\"}}\n\\`\\`\\`\n\n**Example with optional parameters**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 20}}\n\\`\\`\\`\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the popular articles to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Display all popular articles with their names and IDs\n- Show article summaries or descriptions when available\n- Display metadata such as \\`articleType\\`, \\`createdDate\\`, \\`modifiedDate\\`\n- Show \\`imageURL\\` if available (mention thumbnail availability)\n- Include \\`paginationInfo\\` if pagination is used\n- Format articles in a numbered or bulleted list\n\n**Example**: \"Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]...\"\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe Popular Articles API allows a user to retrieve the most popular articles from a specific portal. Popular articles are typically determined by user engagement metrics such as views, ratings, or usage frequency.\n\nThis API returns a list of popular articles with their metadata, allowing users to discover the most relevant and frequently accessed content within the portal.\n"
48
48
  },
49
49
  {
50
50
  "name": "get-portals",
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"
51
+ "description": "Get All Portals Accessible To User\n\nGet All Portals Accessible to User\n\n## How to Use This Tool\n\n**Parameter Format**: This tool requires a \\`request\\` parameter containing the request object.\n- **CRITICAL**: All parameters in this tool are optional. You may pass an empty request object: \\`{\"request\": {}}\\`\n- If you want to specify a language, pass: \\`{\"request\": {\"Dollar_lang\": \"en-US\"}}\\`\n- The \\`Dollar_lang\\` parameter is **optional** - if omitted, the API defaults to \"en-US\"\n- **Example with empty request** (recommended if you don't need to specify language): \\`{\"request\": {}}\\`\n- **Example with language**: \\`{\"request\": {\"Dollar_lang\": \"en-US\"}}\\`\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\n## Displaying Results (MCP-Specific)\n**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.\n\n**What to display:**\n- Display all portals with their names and IDs\n- Show portal \\`id\\` (the portal ID needed for other API calls)\n- Display portal \\`name\\` (the human-readable portal name)\n- Show \\`departmentName\\` if available\n- Include \\`shortURL\\` if available\n- Display \\`paginationInfo\\` to show total count and current page\n- Format portals in a clear list format (e.g., \"Portal Name (ID: PORTAL-123)\")\n\n**Example**: \"Here are the available portals: 1) Business Portal (ID: PORTAL-123), 2) Customer Portal (ID: PORTAL-456)...\"\n\n**Important**: Always display portal IDs clearly, as users will need these IDs to call other tools.\n"
52
52
  },
53
53
  {
54
54
  "name": "query-search",
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"
55
+ "description": "Hybrid Search\n\nHybrid Search\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\"}}\\`\n- Required parameters:\n - \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - \\`q\\` (string) - The search query string (must be URL-escaped)\n- Optional parameters:\n - \\`Dollar_lang\\` (string, default: \"en-US\") - Language code\n - \\`dollarFilterUserProfileID\\` (string) - User profile ID filter\n - \\`dollarFilterTags\\` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs\n - \\`dollarFilterTopicIds\\` (array) - Array of topic IDs to filter by\n - \\`articleCustomAdditionalAttributes\\` (string) - Comma-separated custom attribute names\n - \\`Dollar_pagenum\\` (number, default: 1) - Page number for pagination\n - \\`Dollar_pagesize\\` (number, default: 20) - Number of results per page\n\n**Example**: To search for \"loan information\" in portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\"}}\n\\`\\`\\`\n\n**Example with optional parameters**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"q\": \"loan information\", \"Dollar_lang\": \"en-US\", \"Dollar_pagesize\": 25}}\n\\`\\`\\`\n\n**Note**: This endpoint is only available for Self Service environments.\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the search results to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Display all search results with article names and IDs\n- Show article \\`snippet\\` or \\`keywordSnippet\\` (the relevant text excerpt)\n- Display \\`normalizedScore\\` or \\`relevanceScore\\` to indicate relevance\n- Show \\`docType\\`, \\`source\\`, and \\`topicBreadcrumb\\` metadata\n- Display \\`contextualSummary\\` if available\n- Include \\`paginationInfo\\` if pagination is used\n- Format results in a numbered list with clear relevance indicators\n\n**Example**: \"I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)...\"\n\n## Overview\nThe Search API is a hybrid search service that combines semantic understanding with keyword precision to deliver fast, contextual, and relevant results from your enterprise knowledge base. It enables secure, role-aware access to articles, FAQs, and documentation across customer, agent, and employee interfaces. Each query returns a ranked list of results with snippets, metadata, and relevance scores.\n"
56
56
  },
57
57
  {
58
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"
59
+ "description": "Make a Suggestion\n\nMake a Suggestion\n\n## How to Use This Tool\n\n**CRITICAL**: This tool requires a \\`request\\` parameter containing the request object. All parameters must be passed inside a \\`request\\` object.\n\n**Parameter Format**: \n- Always wrap parameters in a \\`request\\` object: \\`{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {...}}}\\`\n- Required parameters:\n - \\`portalID\\` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., \"PZ-9999\")\n - \\`CreateSuggestion\\` (object) - The suggestion object with:\n - \\`name\\` (string, **required**) - Name/title of the suggestion\n - \\`content\\` (string, **required**) - Content/description of the suggestion\n - \\`language\\` (object, **required**) - Language object with \\`code\\` property (e.g., {\"code\": \"en-US\"})\n- Optional parameters:\n - \\`acceptLanguage\\` (string, default: \"en-US\") - Accept-Language header value\n - \\`CreateSuggestion\\` additional optional fields:\n - \\`description\\` (string) - Additional description\n - \\`feedbackArticle\\` (object) - Article ID object if providing feedback on existing article: \\`{\"id\": \"PROD-2996\"}\\`\n - \\`attachments\\` (object) - Attachments object\n - \\`customAttributes\\` (array) - Custom attributes array\n\n**Example**: To create a suggestion in portal \"PZ-9999\", call with:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {\"name\": \"New Article Request\", \"content\": \"Please add information about loan rates\", \"language\": {\"code\": \"en-US\"}}}}\n\\`\\`\\`\n\n**Example with feedback on existing article**:\n\\`\\`\\`json\n{\"request\": {\"portalID\": \"PZ-9999\", \"CreateSuggestion\": {\"name\": \"Article Feedback\", \"content\": \"This article needs updating\", \"language\": {\"code\": \"en-US\"}, \"feedbackArticle\": {\"id\": \"PROD-2996\"}}}}\n\\`\\`\\`\n\n## Displaying Results (MCP-Specific)\n**CRITICAL**: When this tool returns data successfully, you MUST display the suggestion creation result to the user in your response. Do not silently process the data - always show the user what was returned.\n\n**What to display:**\n- Confirm that the suggestion was successfully created\n- Display the suggestion \\`id\\` if returned in the response\n- Show the suggestion \\`name\\` and \\`content\\` that was submitted\n- If an error occurs, display the error message clearly\n- Provide confirmation message to the user\n\n**Example**: \"Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]...\"\n\n## Prerequisites\n- Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.\n- Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., \"EB-123456789\")\n\n## Overview\nThe Make a Suggestion API allows users to create an Article Suggestion from within a knowledge portal. This enables users to submit feedback, request new articles, or suggest improvements to existing content.\n\nUsers can submit suggestions with details about what they're looking for, which helps content creators understand user needs and improve the knowledge base.\n"
60
60
  }
61
61
  ],
62
62
  "prompts": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egain/egain-mcp-server",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "author": "Emily Loh - eGain Corporation",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,9 +34,47 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Get Announcements
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999"}}`
43
+ * - Required parameter: `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
44
+ * - Optional parameters:
45
+ * - `Dollar_lang` (string, default: "en-US") - Language code
46
+ * - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
47
+ * - `dollarFilterTags` (string) - Comma-separated list of Tag/Tag Group IDs
48
+ * - `workflowMilestone` (string) - Workflow milestone filter ("authoring", "staging", "publish")
49
+ * - `Dollar_pagenum` (number, default: 1) - Page number for pagination
50
+ * - `Dollar_pagesize` (number, default: 10) - Number of results per page
51
+ *
52
+ * **Example**: To get announcements from portal "PZ-9999", call with:
53
+ * ```json
54
+ * {"request": {"portalID": "PZ-9999"}}
55
+ * ```
56
+ *
57
+ * **Example with optional parameters**:
58
+ * ```json
59
+ * {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
60
+ * ```
61
+ *
62
+ * ## Displaying Results (MCP-Specific)
63
+ * **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.
64
+ *
65
+ * **What to display:**
66
+ * - Display all announcement articles with their names and IDs
67
+ * - Show the article content (`content` or `contentText`) for each announcement
68
+ * - Display metadata such as `createdDate`, `modifiedDate`, `articleSummary`
69
+ * - Show `attachments` if present
70
+ * - Include `paginationInfo` if pagination is used
71
+ * - Format announcements in a clear list format
72
+ *
73
+ * **Example**: "Here are the announcements for this portal: 1) [Announcement Name] (ID: PROD-123) - [content]..."
74
+ *
37
75
  * ## Prerequisites
38
76
  * - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
39
- * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
77
+ * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
40
78
  *
41
79
  * ## Overview
42
80
  * 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.
@@ -34,6 +34,48 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Get Article by ID
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}`
43
+ * - Required parameters:
44
+ * - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45
+ * - `articleID` (string) - The article ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PROD-2996")
46
+ * - Optional parameters:
47
+ * - `Dollar_lang` (string, default: "en-US") - Language code
48
+ * - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
49
+ * - `articleAdditionalAttributes` (array) - Additional article attributes to return
50
+ * - `Dollar_customAdditionalAttributes` (string) - Custom additional attributes
51
+ * - `accessSource` (string, default: "article_view") - How the article was accessed
52
+ * - `publishViewId` (string) - Publish view ID
53
+ * - `workflowMilestone` (string) - Workflow milestone filter
54
+ *
55
+ * **Example**: To get article "PROD-2996" from portal "PZ-9999", call with:
56
+ * ```json
57
+ * {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996"}}
58
+ * ```
59
+ *
60
+ * **Example with optional parameters**:
61
+ * ```json
62
+ * {"request": {"portalID": "PZ-9999", "articleID": "PROD-2996", "Dollar_lang": "en-US", "accessSource": "article_view"}}
63
+ * ```
64
+ *
65
+ * ## Displaying Results (MCP-Specific)
66
+ * **CRITICAL**: When this tool returns data successfully, you MUST display the article content to the user in your response. Do not silently process the data - always show the user what was returned.
67
+ *
68
+ * **What to display:**
69
+ * - Display the article `name` as the title
70
+ * - Show the article `content` or `contentText` (the full article body)
71
+ * - Display article metadata: `id`, `articleType`, `createdDate`, `modifiedDate`
72
+ * - Show `attachments` if present
73
+ * - Display `topicBreadcrumb` to show where the article is categorized
74
+ * - Include any other relevant metadata like `articleSummary`, `description`, `articleKeywords`
75
+ * - Format the article content in a readable way for the user
76
+ *
77
+ * **Example**: "Here's the article '[Article Name]' (ID: PROD-2996): [article content]. This article is categorized under: [topic breadcrumb]..."
78
+ *
37
79
  * ## Prerequisites
38
80
  * - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
39
81
  * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -34,6 +34,43 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Get Popular Articles
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999"}}`
43
+ * - Required parameter: `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
44
+ * - Optional parameters:
45
+ * - `Dollar_lang` (string, default: "en-US") - Language code
46
+ * - `Dollar_pagenum` (number, default: 1) - Page number for pagination
47
+ * - `Dollar_pagesize` (number, default: 10) - Number of results per page
48
+ * - `dollarFilterTopicId` (string) - Filter by topic ID
49
+ * - `dollarFilterTags` (string) - Comma-separated list of Tag/Tag Group IDs
50
+ *
51
+ * **Example**: To get popular articles from portal "PZ-9999", call with:
52
+ * ```json
53
+ * {"request": {"portalID": "PZ-9999"}}
54
+ * ```
55
+ *
56
+ * **Example with optional parameters**:
57
+ * ```json
58
+ * {"request": {"portalID": "PZ-9999", "Dollar_lang": "en-US", "Dollar_pagesize": 20}}
59
+ * ```
60
+ *
61
+ * ## Displaying Results (MCP-Specific)
62
+ * **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.
63
+ *
64
+ * **What to display:**
65
+ * - Display all popular articles with their names and IDs
66
+ * - Show article summaries or descriptions when available
67
+ * - Display metadata such as `articleType`, `createdDate`, `modifiedDate`
68
+ * - Show `imageURL` if available (mention thumbnail availability)
69
+ * - Include `paginationInfo` if pagination is used
70
+ * - Format articles in a numbered or bulleted list
71
+ *
72
+ * **Example**: "Here are the most popular articles: 1) [Article Name] (ID: PROD-123) - [summary]..."
73
+ *
37
74
  * ## Prerequisites
38
75
  * - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
39
76
  * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -34,6 +34,15 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Get All Portals Accessible to User
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **Parameter Format**: This tool requires a `request` parameter containing the request object.
40
+ * - **CRITICAL**: All parameters in this tool are optional. You may pass an empty request object: `{"request": {}}`
41
+ * - If you want to specify a language, pass: `{"request": {"Dollar_lang": "en-US"}}`
42
+ * - The `Dollar_lang` parameter is **optional** - if omitted, the API defaults to "en-US"
43
+ * - **Example with empty request** (recommended if you don't need to specify language): `{"request": {}}`
44
+ * - **Example with language**: `{"request": {"Dollar_lang": "en-US"}}`
45
+ *
37
46
  * ## Overview
38
47
  * The Get All Portals Accessible to User API allows a user to fetch all portals accessible to the user across all departments.
39
48
  * - If no access tags are specified for a portal, any user can access the portal.
@@ -81,10 +90,26 @@ import { Result } from "../types/fp.js";
81
90
  * - Search the complete merged list before concluding the portal doesn't exist
82
91
  *
83
92
  * This ensures reliable portal name-to-ID resolution and prevents false "not found" errors.
93
+ *
94
+ * ## Displaying Results (MCP-Specific)
95
+ * **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.
96
+ *
97
+ * **What to display:**
98
+ * - Display all portals with their names and IDs
99
+ * - Show portal `id` (the portal ID needed for other API calls)
100
+ * - Display portal `name` (the human-readable portal name)
101
+ * - Show `departmentName` if available
102
+ * - Include `shortURL` if available
103
+ * - Display `paginationInfo` to show total count and current page
104
+ * - Format portals in a clear list format (e.g., "Portal Name (ID: PORTAL-123)")
105
+ *
106
+ * **Example**: "Here are the available portals: 1) Business Portal (ID: PORTAL-123), 2) Customer Portal (ID: PORTAL-456)..."
107
+ *
108
+ * **Important**: Always display portal IDs clearly, as users will need these IDs to call other tools.
84
109
  */
85
110
  export function getPortals(
86
111
  client$: EgainMcpCore,
87
- request: GetMyPortalsRequest,
112
+ request?: GetMyPortalsRequest | undefined,
88
113
  options?: RequestOptions,
89
114
  ): APIPromise<
90
115
  Result<
@@ -107,7 +132,7 @@ export function getPortals(
107
132
 
108
133
  async function $do(
109
134
  client$: EgainMcpCore,
110
- request: GetMyPortalsRequest,
135
+ request?: GetMyPortalsRequest | undefined,
111
136
  options?: RequestOptions,
112
137
  ): Promise<
113
138
  [
@@ -126,7 +151,7 @@ async function $do(
126
151
  > {
127
152
  const parsed$ = safeParse(
128
153
  request,
129
- (value$) => GetMyPortalsRequest$zodSchema.parse(value$),
154
+ (value$) => GetMyPortalsRequest$zodSchema.optional().parse(value$),
130
155
  "Input validation failed",
131
156
  );
132
157
  if (!parsed$.ok) {
@@ -136,21 +161,21 @@ async function $do(
136
161
  const body$ = null;
137
162
  const path$ = pathToFunc("/myportals")();
138
163
  const query$ = encodeFormQuery({
139
- "$lang": payload$.Dollar_lang,
140
- "$order": payload$.Dollar_order,
141
- "$pagenum": payload$.Dollar_pagenum,
142
- "$pagesize": payload$.Dollar_pagesize,
143
- "$sort": payload$.Dollar_sort,
144
- "department": payload$.department,
145
- "filterText": payload$.filterText,
146
- "shortUrlTemplate": payload$.shortUrlTemplate,
164
+ "$lang": payload$?.Dollar_lang,
165
+ "$order": payload$?.Dollar_order,
166
+ "$pagenum": payload$?.Dollar_pagenum,
167
+ "$pagesize": payload$?.Dollar_pagesize,
168
+ "$sort": payload$?.Dollar_sort,
169
+ "department": payload$?.department,
170
+ "filterText": payload$?.filterText,
171
+ "shortUrlTemplate": payload$?.shortUrlTemplate,
147
172
  });
148
173
 
149
174
  const headers$ = new Headers(compactMap({
150
175
  Accept: "application/json",
151
176
  "Accept-Language": encodeSimple(
152
177
  "Accept-Language",
153
- payload$.acceptLanguage,
178
+ payload$?.acceptLanguage,
154
179
  { explode: false, charEncoding: "none" },
155
180
  ),
156
181
  }));
@@ -34,6 +34,48 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Make a Suggestion
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "CreateSuggestion": {...}}}`
43
+ * - Required parameters:
44
+ * - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45
+ * - `CreateSuggestion` (object) - The suggestion object with:
46
+ * - `name` (string, **required**) - Name/title of the suggestion
47
+ * - `content` (string, **required**) - Content/description of the suggestion
48
+ * - `language` (object, **required**) - Language object with `code` property (e.g., {"code": "en-US"})
49
+ * - Optional parameters:
50
+ * - `acceptLanguage` (string, default: "en-US") - Accept-Language header value
51
+ * - `CreateSuggestion` additional optional fields:
52
+ * - `description` (string) - Additional description
53
+ * - `feedbackArticle` (object) - Article ID object if providing feedback on existing article: `{"id": "PROD-2996"}`
54
+ * - `attachments` (object) - Attachments object
55
+ * - `customAttributes` (array) - Custom attributes array
56
+ *
57
+ * **Example**: To create a suggestion in portal "PZ-9999", call with:
58
+ * ```json
59
+ * {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "New Article Request", "content": "Please add information about loan rates", "language": {"code": "en-US"}}}}
60
+ * ```
61
+ *
62
+ * **Example with feedback on existing article**:
63
+ * ```json
64
+ * {"request": {"portalID": "PZ-9999", "CreateSuggestion": {"name": "Article Feedback", "content": "This article needs updating", "language": {"code": "en-US"}, "feedbackArticle": {"id": "PROD-2996"}}}}
65
+ * ```
66
+ *
67
+ * ## Displaying Results (MCP-Specific)
68
+ * **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.
69
+ *
70
+ * **What to display:**
71
+ * - Confirm that the suggestion was successfully created
72
+ * - Display the suggestion `id` if returned in the response
73
+ * - Show the suggestion `name` and `content` that was submitted
74
+ * - If an error occurs, display the error message clearly
75
+ * - Provide confirmation message to the user
76
+ *
77
+ * **Example**: "Your suggestion '[Suggestion Name]' has been successfully submitted. Suggestion ID: [id]..."
78
+ *
37
79
  * ## Prerequisites
38
80
  * - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
39
81
  * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
@@ -34,18 +34,54 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Get Answers
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}`
43
+ * - Required parameters:
44
+ * - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45
+ * - `q` (string) - The search query string
46
+ * - `Dollar_lang` (string) - Language code (e.g., "en-US")
47
+ * - Optional parameters:
48
+ * - `dollarFilterUserProfileID` (string) - User profile ID filter
49
+ * - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
50
+ * - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by
51
+ * - `AnswersRequest` (object) - Request body parameters:
52
+ * - `eventId` (string, **required**) - Event ID
53
+ * - `sessionId` (string, **required**) - Session ID
54
+ * - `channel` (object, **optional**, recommended to omit) - Channel information. Omit unless specifically needed. If you receive a 400 error with channel, retry without it.
55
+ * - `context` (object) - Additional context (companyContext, pageContext, userContext)
56
+ *
57
+ * **Example**: To get answers for query "loan information" from portal "PZ-9999", call with:
58
+ * ```json
59
+ * {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "AnswersRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
60
+ * ```
61
+ *
62
+ * **Note**: The `channel` field in `AnswersRequest` is optional and recommended to omit unless specifically needed. The API works reliably without it.
63
+ *
64
+ * ## Displaying Results (MCP-Specific)
65
+ * **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.
66
+ *
67
+ * **What to display:**
68
+ * - Display the `answer.answerValue` text prominently as the main answer to the user's query
69
+ * - Indicate the answer type (`answerType`: "certified" or "generative")
70
+ * - If `relevanceScore` is present, you may mention the confidence level
71
+ * - List all `references` (article IDs and names) that were used to generate the answer
72
+ * - Display `searchResults` showing related articles with their names, IDs, snippets, and relevance scores
73
+ * - Format the answer in a clear, readable way - this is the primary response the user is seeking
74
+ *
75
+ * **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]..."
76
+ *
37
77
  * ## Prerequisites
38
78
  * - Requires a valid portal ID. If you don't have the portal ID, first call 'get-portals' to get available portals.
39
- * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
79
+ * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
40
80
  *
41
81
  * ## Overview
42
82
  * 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
83
  *
44
84
  * The API leverages AI capabilities to provide intelligent answers based on the knowledge base content, making it easier for users to find the information they need quickly and accurately.
45
- *
46
- * ## Request Body Notes
47
- * - **channel field**: Optional. **Recommended to omit** unless specifically needed. The API works reliably without it. If you receive a 400 Bad Request error when including channel, retry the request without the channel field.
48
- * - **Required fields**: eventId and sessionId are required in the request body.
49
85
  */
50
86
  export function queryAnswers(
51
87
  client$: EgainMcpCore,
@@ -34,9 +34,49 @@ import { Result } from "../types/fp.js";
34
34
  * @remarks
35
35
  * Retrieve Chunks
36
36
  *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}`
43
+ * - Required parameters:
44
+ * - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45
+ * - `q` (string) - The search query string
46
+ * - `Dollar_lang` (string) - Language code (e.g., "en-US")
47
+ * - Optional parameters:
48
+ * - `dollarFilterUserProfileID` (string) - User profile ID filter
49
+ * - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
50
+ * - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by
51
+ * - `RetrieveRequest` (object) - Additional request body parameters:
52
+ * - `channel` (object) - Channel information (optional, recommended to omit)
53
+ * - `eventId` (string) - Event ID
54
+ * - `sessionId` (string) - Session ID
55
+ *
56
+ * **Example**: To retrieve chunks for query "loan information" from portal "PZ-9999", call with:
57
+ * ```json
58
+ * {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US"}}
59
+ * ```
60
+ *
61
+ * **Example with RetrieveRequest body**:
62
+ * ```json
63
+ * {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "RetrieveRequest": {"eventId": "event-123", "sessionId": "session-456"}}}
64
+ * ```
65
+ *
66
+ * ## Displaying Results (MCP-Specific)
67
+ * **CRITICAL**: When this tool returns data successfully, you MUST display the results to the user in your response. Do not silently process the data - always show the user what was returned.
68
+ *
69
+ * **What to display:**
70
+ * - If a certified answer is returned (`answer` object), display the `answerValue` text and list the `references` (article IDs and names)
71
+ * - Display all `searchResults` with their article names, IDs, snippets, and relevance scores (`normalizedScore`)
72
+ * - Show article metadata such as `docType`, `source`, and `topicBreadcrumb` when available
73
+ * - Format the results in a user-friendly way (e.g., numbered list, formatted text)
74
+ *
75
+ * **Example**: "I found 5 relevant articles about loan information: 1) [Article Name] (ID: PROD-123) - [snippet]..."
76
+ *
37
77
  * ## Prerequisites
38
78
  * - **Requires a valid portal ID** (required parameter). If you don't have the portal ID, first call 'get-portals' to get available portals.
39
- * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "EB-123456789")
79
+ * - Portal ID format: 2-4 letter prefix + dash + 4-15 digits (e.g., "PROD-1004")
40
80
  *
41
81
  * ## Overview
42
82
  * 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.
@@ -32,7 +32,54 @@ import { Result } from "../types/fp.js";
32
32
  * Hybrid Search
33
33
  *
34
34
  * @remarks
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.**
35
+ * Hybrid Search
36
+ *
37
+ * ## How to Use This Tool
38
+ *
39
+ * **CRITICAL**: This tool requires a `request` parameter containing the request object. All parameters must be passed inside a `request` object.
40
+ *
41
+ * **Parameter Format**:
42
+ * - Always wrap parameters in a `request` object: `{"request": {"portalID": "PZ-9999", "q": "loan information"}}`
43
+ * - Required parameters:
44
+ * - `portalID` (string) - The portal ID (format: 2-4 letter prefix + dash + 4-15 digits, e.g., "PZ-9999")
45
+ * - `q` (string) - The search query string (must be URL-escaped)
46
+ * - Optional parameters:
47
+ * - `Dollar_lang` (string, default: "en-US") - Language code
48
+ * - `dollarFilterUserProfileID` (string) - User profile ID filter
49
+ * - `dollarFilterTags` (object) - Object where keys are Category Tag IDs and values are arrays of Tag IDs
50
+ * - `dollarFilterTopicIds` (array) - Array of topic IDs to filter by
51
+ * - `articleCustomAdditionalAttributes` (string) - Comma-separated custom attribute names
52
+ * - `Dollar_pagenum` (number, default: 1) - Page number for pagination
53
+ * - `Dollar_pagesize` (number, default: 20) - Number of results per page
54
+ *
55
+ * **Example**: To search for "loan information" in portal "PZ-9999", call with:
56
+ * ```json
57
+ * {"request": {"portalID": "PZ-9999", "q": "loan information"}}
58
+ * ```
59
+ *
60
+ * **Example with optional parameters**:
61
+ * ```json
62
+ * {"request": {"portalID": "PZ-9999", "q": "loan information", "Dollar_lang": "en-US", "Dollar_pagesize": 25}}
63
+ * ```
64
+ *
65
+ * **Note**: This endpoint is only available for Self Service environments.
66
+ *
67
+ * ## Displaying Results (MCP-Specific)
68
+ * **CRITICAL**: When this tool returns data successfully, you MUST display the search results to the user in your response. Do not silently process the data - always show the user what was returned.
69
+ *
70
+ * **What to display:**
71
+ * - Display all search results with article names and IDs
72
+ * - Show article `snippet` or `keywordSnippet` (the relevant text excerpt)
73
+ * - Display `normalizedScore` or `relevanceScore` to indicate relevance
74
+ * - Show `docType`, `source`, and `topicBreadcrumb` metadata
75
+ * - Display `contextualSummary` if available
76
+ * - Include `paginationInfo` if pagination is used
77
+ * - Format results in a numbered list with clear relevance indicators
78
+ *
79
+ * **Example**: "I found 10 articles matching 'loan information': 1) [Article Name] (ID: PROD-123) - [snippet] (Relevance: 0.89)..."
80
+ *
81
+ * ## Overview
82
+ * The Search API is a hybrid search service that combines semantic understanding with keyword precision to deliver fast, contextual, and relevant results from your enterprise knowledge base. It enables secure, role-aware access to articles, FAQs, and documentation across customer, agent, and employee interfaces. Each query returns a ranked list of results with snippets, metadata, and relevance scores.
36
83
  */
37
84
  export function querySearch(
38
85
  client$: EgainMcpCore,
package/src/lib/config.ts CHANGED
@@ -82,8 +82,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
82
82
  export const SDK_METADATA = {
83
83
  language: "typescript",
84
84
  openapiDocVersion: "1.0.0",
85
- sdkVersion: "1.0.24",
85
+ sdkVersion: "1.0.25",
86
86
  genVersion: "2.723.8",
87
87
  userAgent:
88
- "speakeasy-sdk/mcp-typescript 1.0.24 2.723.8 1.0.0 @egain/egain-mcp-server",
88
+ "speakeasy-sdk/mcp-typescript 1.0.25 2.723.8 1.0.0 @egain/egain-mcp-server",
89
89
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "1.0.24",
22
+ currentVersion: "1.0.25",
23
23
  },
24
24
  });
25
25
 
@@ -34,7 +34,7 @@ export function createMCPServer(deps: {
34
34
  }) {
35
35
  const server = new McpServer({
36
36
  name: "EgainMcp",
37
- version: "1.0.24",
37
+ version: "1.0.25",
38
38
  });
39
39
 
40
40
  const getClient = deps.getSDK || (() =>