@memberjunction/core-actions 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/dist/config.js +17 -23
  2. package/dist/config.js.map +1 -1
  3. package/dist/custom/ai/betty.action.d.ts +0 -4
  4. package/dist/custom/ai/betty.action.d.ts.map +1 -1
  5. package/dist/custom/ai/betty.action.js +11 -21
  6. package/dist/custom/ai/betty.action.js.map +1 -1
  7. package/dist/custom/ai/execute-ai-prompt.action.d.ts +0 -4
  8. package/dist/custom/ai/execute-ai-prompt.action.d.ts.map +1 -1
  9. package/dist/custom/ai/execute-ai-prompt.action.js +12 -22
  10. package/dist/custom/ai/execute-ai-prompt.action.js.map +1 -1
  11. package/dist/custom/ai/find-best-action.action.d.ts +0 -4
  12. package/dist/custom/ai/find-best-action.action.d.ts.map +1 -1
  13. package/dist/custom/ai/find-best-action.action.js +11 -21
  14. package/dist/custom/ai/find-best-action.action.js.map +1 -1
  15. package/dist/custom/ai/find-best-agent.action.d.ts +0 -4
  16. package/dist/custom/ai/find-best-agent.action.d.ts.map +1 -1
  17. package/dist/custom/ai/find-best-agent.action.js +12 -22
  18. package/dist/custom/ai/find-best-agent.action.js.map +1 -1
  19. package/dist/custom/ai/find-candidate-actions.action.d.ts +0 -4
  20. package/dist/custom/ai/find-candidate-actions.action.d.ts.map +1 -1
  21. package/dist/custom/ai/find-candidate-actions.action.js +11 -21
  22. package/dist/custom/ai/find-candidate-actions.action.js.map +1 -1
  23. package/dist/custom/ai/find-candidate-agents.action.d.ts +0 -4
  24. package/dist/custom/ai/find-candidate-agents.action.d.ts.map +1 -1
  25. package/dist/custom/ai/find-candidate-agents.action.js +15 -25
  26. package/dist/custom/ai/find-candidate-agents.action.js.map +1 -1
  27. package/dist/custom/ai/generate-image.action.d.ts +0 -4
  28. package/dist/custom/ai/generate-image.action.d.ts.map +1 -1
  29. package/dist/custom/ai/generate-image.action.js +15 -25
  30. package/dist/custom/ai/generate-image.action.js.map +1 -1
  31. package/dist/custom/ai/load-agent-spec.action.d.ts +0 -4
  32. package/dist/custom/ai/load-agent-spec.action.d.ts.map +1 -1
  33. package/dist/custom/ai/load-agent-spec.action.js +8 -18
  34. package/dist/custom/ai/load-agent-spec.action.js.map +1 -1
  35. package/dist/custom/ai/summarize-content.action.d.ts +0 -4
  36. package/dist/custom/ai/summarize-content.action.d.ts.map +1 -1
  37. package/dist/custom/ai/summarize-content.action.js +20 -30
  38. package/dist/custom/ai/summarize-content.action.js.map +1 -1
  39. package/dist/custom/code-execution/execute-code.action.d.ts +0 -1
  40. package/dist/custom/code-execution/execute-code.action.d.ts.map +1 -1
  41. package/dist/custom/code-execution/execute-code.action.js +10 -17
  42. package/dist/custom/code-execution/execute-code.action.js.map +1 -1
  43. package/dist/custom/communication/send-single-message.action.d.ts +0 -1
  44. package/dist/custom/communication/send-single-message.action.d.ts.map +1 -1
  45. package/dist/custom/communication/send-single-message.action.js +11 -18
  46. package/dist/custom/communication/send-single-message.action.js.map +1 -1
  47. package/dist/custom/communication/slack-webhook.action.d.ts +0 -4
  48. package/dist/custom/communication/slack-webhook.action.d.ts.map +1 -1
  49. package/dist/custom/communication/slack-webhook.action.js +11 -24
  50. package/dist/custom/communication/slack-webhook.action.js.map +1 -1
  51. package/dist/custom/communication/teams-webhook.action.d.ts +0 -4
  52. package/dist/custom/communication/teams-webhook.action.d.ts.map +1 -1
  53. package/dist/custom/communication/teams-webhook.action.js +12 -25
  54. package/dist/custom/communication/teams-webhook.action.js.map +1 -1
  55. package/dist/custom/crud/base-record-mutation.action.js +8 -12
  56. package/dist/custom/crud/base-record-mutation.action.js.map +1 -1
  57. package/dist/custom/crud/create-record.action.d.ts +1 -2
  58. package/dist/custom/crud/create-record.action.d.ts.map +1 -1
  59. package/dist/custom/crud/create-record.action.js +7 -15
  60. package/dist/custom/crud/create-record.action.js.map +1 -1
  61. package/dist/custom/crud/delete-record.action.d.ts +1 -2
  62. package/dist/custom/crud/delete-record.action.d.ts.map +1 -1
  63. package/dist/custom/crud/delete-record.action.js +7 -15
  64. package/dist/custom/crud/delete-record.action.js.map +1 -1
  65. package/dist/custom/crud/get-record.action.d.ts +1 -2
  66. package/dist/custom/crud/get-record.action.d.ts.map +1 -1
  67. package/dist/custom/crud/get-record.action.js +7 -15
  68. package/dist/custom/crud/get-record.action.js.map +1 -1
  69. package/dist/custom/crud/get-records.action.d.ts +0 -1
  70. package/dist/custom/crud/get-records.action.d.ts.map +1 -1
  71. package/dist/custom/crud/get-records.action.js +8 -17
  72. package/dist/custom/crud/get-records.action.js.map +1 -1
  73. package/dist/custom/crud/index.d.ts +6 -6
  74. package/dist/custom/crud/index.js +6 -22
  75. package/dist/custom/crud/index.js.map +1 -1
  76. package/dist/custom/crud/update-record.action.d.ts +1 -2
  77. package/dist/custom/crud/update-record.action.d.ts.map +1 -1
  78. package/dist/custom/crud/update-record.action.js +9 -17
  79. package/dist/custom/crud/update-record.action.js.map +1 -1
  80. package/dist/custom/data/aggregate-data.action.d.ts +0 -4
  81. package/dist/custom/data/aggregate-data.action.d.ts.map +1 -1
  82. package/dist/custom/data/aggregate-data.action.js +10 -20
  83. package/dist/custom/data/aggregate-data.action.js.map +1 -1
  84. package/dist/custom/data/csv-parser.action.d.ts +1 -5
  85. package/dist/custom/data/csv-parser.action.d.ts.map +1 -1
  86. package/dist/custom/data/csv-parser.action.js +8 -41
  87. package/dist/custom/data/csv-parser.action.js.map +1 -1
  88. package/dist/custom/data/data-mapper.action.d.ts +0 -4
  89. package/dist/custom/data/data-mapper.action.d.ts.map +1 -1
  90. package/dist/custom/data/data-mapper.action.js +13 -47
  91. package/dist/custom/data/data-mapper.action.js.map +1 -1
  92. package/dist/custom/data/execute-research-query.action.d.ts +0 -4
  93. package/dist/custom/data/execute-research-query.action.d.ts.map +1 -1
  94. package/dist/custom/data/execute-research-query.action.js +47 -55
  95. package/dist/custom/data/execute-research-query.action.js.map +1 -1
  96. package/dist/custom/data/explore-database-schema.action.d.ts +0 -4
  97. package/dist/custom/data/explore-database-schema.action.d.ts.map +1 -1
  98. package/dist/custom/data/explore-database-schema.action.js +8 -19
  99. package/dist/custom/data/explore-database-schema.action.js.map +1 -1
  100. package/dist/custom/data/get-entity-details.action.d.ts +0 -4
  101. package/dist/custom/data/get-entity-details.action.d.ts.map +1 -1
  102. package/dist/custom/data/get-entity-details.action.js +9 -20
  103. package/dist/custom/data/get-entity-details.action.js.map +1 -1
  104. package/dist/custom/data/get-entity-list.action.d.ts +0 -4
  105. package/dist/custom/data/get-entity-list.action.d.ts.map +1 -1
  106. package/dist/custom/data/get-entity-list.action.js +8 -19
  107. package/dist/custom/data/get-entity-list.action.js.map +1 -1
  108. package/dist/custom/data/json-transform.action.d.ts +0 -4
  109. package/dist/custom/data/json-transform.action.d.ts.map +1 -1
  110. package/dist/custom/data/json-transform.action.js +14 -47
  111. package/dist/custom/data/json-transform.action.js.map +1 -1
  112. package/dist/custom/data/xml-parser.action.d.ts +1 -5
  113. package/dist/custom/data/xml-parser.action.d.ts.map +1 -1
  114. package/dist/custom/data/xml-parser.action.js +13 -46
  115. package/dist/custom/data/xml-parser.action.js.map +1 -1
  116. package/dist/custom/demo/calculate-expression.action.d.ts +0 -5
  117. package/dist/custom/demo/calculate-expression.action.d.ts.map +1 -1
  118. package/dist/custom/demo/calculate-expression.action.js +6 -17
  119. package/dist/custom/demo/calculate-expression.action.js.map +1 -1
  120. package/dist/custom/demo/color-converter.action.d.ts +0 -4
  121. package/dist/custom/demo/color-converter.action.d.ts.map +1 -1
  122. package/dist/custom/demo/color-converter.action.js +20 -27
  123. package/dist/custom/demo/color-converter.action.js.map +1 -1
  124. package/dist/custom/demo/get-stock-price.action.d.ts +0 -5
  125. package/dist/custom/demo/get-stock-price.action.d.ts.map +1 -1
  126. package/dist/custom/demo/get-stock-price.action.js +9 -23
  127. package/dist/custom/demo/get-stock-price.action.js.map +1 -1
  128. package/dist/custom/demo/get-weather.action.d.ts +0 -5
  129. package/dist/custom/demo/get-weather.action.d.ts.map +1 -1
  130. package/dist/custom/demo/get-weather.action.js +11 -25
  131. package/dist/custom/demo/get-weather.action.js.map +1 -1
  132. package/dist/custom/demo/text-analyzer.action.d.ts +0 -4
  133. package/dist/custom/demo/text-analyzer.action.d.ts.map +1 -1
  134. package/dist/custom/demo/text-analyzer.action.js +6 -16
  135. package/dist/custom/demo/text-analyzer.action.js.map +1 -1
  136. package/dist/custom/demo/unit-converter.action.d.ts +0 -4
  137. package/dist/custom/demo/unit-converter.action.d.ts.map +1 -1
  138. package/dist/custom/demo/unit-converter.action.js +80 -87
  139. package/dist/custom/demo/unit-converter.action.js.map +1 -1
  140. package/dist/custom/files/base-file-storage.action.js +7 -11
  141. package/dist/custom/files/base-file-storage.action.js.map +1 -1
  142. package/dist/custom/files/copy-object.action.d.ts +1 -2
  143. package/dist/custom/files/copy-object.action.d.ts.map +1 -1
  144. package/dist/custom/files/copy-object.action.js +7 -14
  145. package/dist/custom/files/copy-object.action.js.map +1 -1
  146. package/dist/custom/files/create-directory.action.d.ts +1 -2
  147. package/dist/custom/files/create-directory.action.d.ts.map +1 -1
  148. package/dist/custom/files/create-directory.action.js +7 -14
  149. package/dist/custom/files/create-directory.action.js.map +1 -1
  150. package/dist/custom/files/delete-directory.action.d.ts +1 -2
  151. package/dist/custom/files/delete-directory.action.d.ts.map +1 -1
  152. package/dist/custom/files/delete-directory.action.js +7 -14
  153. package/dist/custom/files/delete-directory.action.js.map +1 -1
  154. package/dist/custom/files/delete-object.action.d.ts +1 -2
  155. package/dist/custom/files/delete-object.action.d.ts.map +1 -1
  156. package/dist/custom/files/delete-object.action.js +7 -14
  157. package/dist/custom/files/delete-object.action.js.map +1 -1
  158. package/dist/custom/files/directory-exists.action.d.ts +1 -2
  159. package/dist/custom/files/directory-exists.action.d.ts.map +1 -1
  160. package/dist/custom/files/directory-exists.action.js +7 -14
  161. package/dist/custom/files/directory-exists.action.js.map +1 -1
  162. package/dist/custom/files/excel-reader.action.d.ts +1 -5
  163. package/dist/custom/files/excel-reader.action.d.ts.map +1 -1
  164. package/dist/custom/files/excel-reader.action.js +8 -41
  165. package/dist/custom/files/excel-reader.action.js.map +1 -1
  166. package/dist/custom/files/excel-writer.action.d.ts +1 -5
  167. package/dist/custom/files/excel-writer.action.d.ts.map +1 -1
  168. package/dist/custom/files/excel-writer.action.js +11 -21
  169. package/dist/custom/files/excel-writer.action.js.map +1 -1
  170. package/dist/custom/files/file-compress.action.d.ts +1 -5
  171. package/dist/custom/files/file-compress.action.d.ts.map +1 -1
  172. package/dist/custom/files/file-compress.action.js +11 -44
  173. package/dist/custom/files/file-compress.action.js.map +1 -1
  174. package/dist/custom/files/get-download-url.action.d.ts +1 -2
  175. package/dist/custom/files/get-download-url.action.d.ts.map +1 -1
  176. package/dist/custom/files/get-download-url.action.js +7 -14
  177. package/dist/custom/files/get-download-url.action.js.map +1 -1
  178. package/dist/custom/files/get-file-content.action.d.ts +1 -2
  179. package/dist/custom/files/get-file-content.action.d.ts.map +1 -1
  180. package/dist/custom/files/get-file-content.action.js +10 -40
  181. package/dist/custom/files/get-file-content.action.js.map +1 -1
  182. package/dist/custom/files/get-metadata.action.d.ts +1 -2
  183. package/dist/custom/files/get-metadata.action.d.ts.map +1 -1
  184. package/dist/custom/files/get-metadata.action.js +7 -14
  185. package/dist/custom/files/get-metadata.action.js.map +1 -1
  186. package/dist/custom/files/get-object.action.d.ts +1 -2
  187. package/dist/custom/files/get-object.action.d.ts.map +1 -1
  188. package/dist/custom/files/get-object.action.js +7 -14
  189. package/dist/custom/files/get-object.action.js.map +1 -1
  190. package/dist/custom/files/get-upload-url.action.d.ts +1 -2
  191. package/dist/custom/files/get-upload-url.action.d.ts.map +1 -1
  192. package/dist/custom/files/get-upload-url.action.js +7 -14
  193. package/dist/custom/files/get-upload-url.action.js.map +1 -1
  194. package/dist/custom/files/index.d.ts +15 -15
  195. package/dist/custom/files/index.js +15 -33
  196. package/dist/custom/files/index.js.map +1 -1
  197. package/dist/custom/files/list-objects.action.d.ts +1 -2
  198. package/dist/custom/files/list-objects.action.d.ts.map +1 -1
  199. package/dist/custom/files/list-objects.action.js +7 -14
  200. package/dist/custom/files/list-objects.action.js.map +1 -1
  201. package/dist/custom/files/list-storage-providers.action.d.ts +1 -5
  202. package/dist/custom/files/list-storage-providers.action.d.ts.map +1 -1
  203. package/dist/custom/files/list-storage-providers.action.js +9 -21
  204. package/dist/custom/files/list-storage-providers.action.js.map +1 -1
  205. package/dist/custom/files/move-object.action.d.ts +1 -2
  206. package/dist/custom/files/move-object.action.d.ts.map +1 -1
  207. package/dist/custom/files/move-object.action.js +7 -14
  208. package/dist/custom/files/move-object.action.js.map +1 -1
  209. package/dist/custom/files/object-exists.action.d.ts +1 -2
  210. package/dist/custom/files/object-exists.action.d.ts.map +1 -1
  211. package/dist/custom/files/object-exists.action.js +7 -14
  212. package/dist/custom/files/object-exists.action.js.map +1 -1
  213. package/dist/custom/files/pdf-extractor.action.d.ts +1 -5
  214. package/dist/custom/files/pdf-extractor.action.d.ts.map +1 -1
  215. package/dist/custom/files/pdf-extractor.action.js +8 -18
  216. package/dist/custom/files/pdf-extractor.action.js.map +1 -1
  217. package/dist/custom/files/pdf-generator.action.d.ts +1 -5
  218. package/dist/custom/files/pdf-generator.action.d.ts.map +1 -1
  219. package/dist/custom/files/pdf-generator.action.js +12 -45
  220. package/dist/custom/files/pdf-generator.action.js.map +1 -1
  221. package/dist/custom/files/search-storage-files.action.d.ts +1 -5
  222. package/dist/custom/files/search-storage-files.action.d.ts.map +1 -1
  223. package/dist/custom/files/search-storage-files.action.js +9 -21
  224. package/dist/custom/files/search-storage-files.action.js.map +1 -1
  225. package/dist/custom/integration/api-rate-limiter.action.d.ts +0 -4
  226. package/dist/custom/integration/api-rate-limiter.action.d.ts.map +1 -1
  227. package/dist/custom/integration/api-rate-limiter.action.js +19 -32
  228. package/dist/custom/integration/api-rate-limiter.action.js.map +1 -1
  229. package/dist/custom/integration/gamma-generate-presentation.action.d.ts +0 -4
  230. package/dist/custom/integration/gamma-generate-presentation.action.d.ts.map +1 -1
  231. package/dist/custom/integration/gamma-generate-presentation.action.js +12 -25
  232. package/dist/custom/integration/gamma-generate-presentation.action.js.map +1 -1
  233. package/dist/custom/integration/graphql-query.action.d.ts +0 -4
  234. package/dist/custom/integration/graphql-query.action.d.ts.map +1 -1
  235. package/dist/custom/integration/graphql-query.action.js +11 -24
  236. package/dist/custom/integration/graphql-query.action.js.map +1 -1
  237. package/dist/custom/integration/http-request.action.d.ts +0 -4
  238. package/dist/custom/integration/http-request.action.d.ts.map +1 -1
  239. package/dist/custom/integration/http-request.action.js +12 -25
  240. package/dist/custom/integration/http-request.action.js.map +1 -1
  241. package/dist/custom/integration/oauth-flow.action.d.ts +0 -4
  242. package/dist/custom/integration/oauth-flow.action.d.ts.map +1 -1
  243. package/dist/custom/integration/oauth-flow.action.js +37 -70
  244. package/dist/custom/integration/oauth-flow.action.js.map +1 -1
  245. package/dist/custom/lists/add-records-to-list.action.d.ts +0 -1
  246. package/dist/custom/lists/add-records-to-list.action.d.ts.map +1 -1
  247. package/dist/custom/lists/add-records-to-list.action.js +9 -16
  248. package/dist/custom/lists/add-records-to-list.action.js.map +1 -1
  249. package/dist/custom/lists/create-list.action.d.ts +0 -1
  250. package/dist/custom/lists/create-list.action.d.ts.map +1 -1
  251. package/dist/custom/lists/create-list.action.js +9 -16
  252. package/dist/custom/lists/create-list.action.js.map +1 -1
  253. package/dist/custom/lists/get-list-records.action.d.ts +0 -1
  254. package/dist/custom/lists/get-list-records.action.d.ts.map +1 -1
  255. package/dist/custom/lists/get-list-records.action.js +10 -17
  256. package/dist/custom/lists/get-list-records.action.js.map +1 -1
  257. package/dist/custom/lists/get-record-list-membership.action.d.ts +0 -1
  258. package/dist/custom/lists/get-record-list-membership.action.d.ts.map +1 -1
  259. package/dist/custom/lists/get-record-list-membership.action.js +8 -15
  260. package/dist/custom/lists/get-record-list-membership.action.js.map +1 -1
  261. package/dist/custom/lists/index.d.ts +6 -10
  262. package/dist/custom/lists/index.d.ts.map +1 -1
  263. package/dist/custom/lists/index.js +6 -41
  264. package/dist/custom/lists/index.js.map +1 -1
  265. package/dist/custom/lists/remove-records-from-list.action.d.ts +0 -1
  266. package/dist/custom/lists/remove-records-from-list.action.d.ts.map +1 -1
  267. package/dist/custom/lists/remove-records-from-list.action.js +8 -15
  268. package/dist/custom/lists/remove-records-from-list.action.js.map +1 -1
  269. package/dist/custom/lists/update-list-item-status.action.d.ts +0 -1
  270. package/dist/custom/lists/update-list-item-status.action.d.ts.map +1 -1
  271. package/dist/custom/lists/update-list-item-status.action.js +8 -15
  272. package/dist/custom/lists/update-list-item-status.action.js.map +1 -1
  273. package/dist/custom/mcp/execute-mcp-tool.action.d.ts +46 -0
  274. package/dist/custom/mcp/execute-mcp-tool.action.d.ts.map +1 -0
  275. package/dist/custom/mcp/execute-mcp-tool.action.js +164 -0
  276. package/dist/custom/mcp/execute-mcp-tool.action.js.map +1 -0
  277. package/dist/custom/mcp/index.d.ts +14 -0
  278. package/dist/custom/mcp/index.d.ts.map +1 -0
  279. package/dist/custom/mcp/index.js +15 -0
  280. package/dist/custom/mcp/index.js.map +1 -0
  281. package/dist/custom/mcp/list-mcp-tools.action.d.ts +39 -0
  282. package/dist/custom/mcp/list-mcp-tools.action.d.ts.map +1 -0
  283. package/dist/custom/mcp/list-mcp-tools.action.js +125 -0
  284. package/dist/custom/mcp/list-mcp-tools.action.js.map +1 -0
  285. package/dist/custom/mcp/mcp-tool.action.d.ts +67 -0
  286. package/dist/custom/mcp/mcp-tool.action.d.ts.map +1 -0
  287. package/dist/custom/mcp/mcp-tool.action.js +220 -0
  288. package/dist/custom/mcp/mcp-tool.action.js.map +1 -0
  289. package/dist/custom/mcp/sync-mcp-tools.action.d.ts +40 -0
  290. package/dist/custom/mcp/sync-mcp-tools.action.d.ts.map +1 -0
  291. package/dist/custom/mcp/sync-mcp-tools.action.js +120 -0
  292. package/dist/custom/mcp/sync-mcp-tools.action.js.map +1 -0
  293. package/dist/custom/mcp/test-mcp-connection.action.d.ts +39 -0
  294. package/dist/custom/mcp/test-mcp-connection.action.d.ts.map +1 -0
  295. package/dist/custom/mcp/test-mcp-connection.action.js +115 -0
  296. package/dist/custom/mcp/test-mcp-connection.action.js.map +1 -0
  297. package/dist/custom/security/password-strength.action.d.ts +0 -4
  298. package/dist/custom/security/password-strength.action.d.ts.map +1 -1
  299. package/dist/custom/security/password-strength.action.js +20 -50
  300. package/dist/custom/security/password-strength.action.js.map +1 -1
  301. package/dist/custom/user-management/assign-user-roles.action.d.ts +0 -1
  302. package/dist/custom/user-management/assign-user-roles.action.d.ts.map +1 -1
  303. package/dist/custom/user-management/assign-user-roles.action.js +10 -17
  304. package/dist/custom/user-management/assign-user-roles.action.js.map +1 -1
  305. package/dist/custom/user-management/check-user-permission.action.d.ts +0 -1
  306. package/dist/custom/user-management/check-user-permission.action.d.ts.map +1 -1
  307. package/dist/custom/user-management/check-user-permission.action.js +12 -19
  308. package/dist/custom/user-management/check-user-permission.action.js.map +1 -1
  309. package/dist/custom/user-management/create-employee.action.d.ts +1 -2
  310. package/dist/custom/user-management/create-employee.action.d.ts.map +1 -1
  311. package/dist/custom/user-management/create-employee.action.js +9 -16
  312. package/dist/custom/user-management/create-employee.action.js.map +1 -1
  313. package/dist/custom/user-management/create-user.action.d.ts +1 -2
  314. package/dist/custom/user-management/create-user.action.d.ts.map +1 -1
  315. package/dist/custom/user-management/create-user.action.js +11 -18
  316. package/dist/custom/user-management/create-user.action.js.map +1 -1
  317. package/dist/custom/user-management/validate-email-unique.action.d.ts +0 -1
  318. package/dist/custom/user-management/validate-email-unique.action.d.ts.map +1 -1
  319. package/dist/custom/user-management/validate-email-unique.action.js +8 -15
  320. package/dist/custom/user-management/validate-email-unique.action.js.map +1 -1
  321. package/dist/custom/utilities/base-file-handler.d.ts +0 -1
  322. package/dist/custom/utilities/base-file-handler.d.ts.map +1 -1
  323. package/dist/custom/utilities/base-file-handler.js +5 -9
  324. package/dist/custom/utilities/base-file-handler.js.map +1 -1
  325. package/dist/custom/utilities/business-days-calculator.action.d.ts +0 -4
  326. package/dist/custom/utilities/business-days-calculator.action.d.ts.map +1 -1
  327. package/dist/custom/utilities/business-days-calculator.action.js +20 -27
  328. package/dist/custom/utilities/business-days-calculator.action.js.map +1 -1
  329. package/dist/custom/utilities/census-data-lookup.action.d.ts +0 -4
  330. package/dist/custom/utilities/census-data-lookup.action.d.ts.map +1 -1
  331. package/dist/custom/utilities/census-data-lookup.action.js +67 -77
  332. package/dist/custom/utilities/census-data-lookup.action.js.map +1 -1
  333. package/dist/custom/utilities/external-change-detection.action.d.ts +0 -1
  334. package/dist/custom/utilities/external-change-detection.action.d.ts.map +1 -1
  335. package/dist/custom/utilities/external-change-detection.action.js +13 -20
  336. package/dist/custom/utilities/external-change-detection.action.js.map +1 -1
  337. package/dist/custom/utilities/index.d.ts +2 -2
  338. package/dist/custom/utilities/index.js +2 -18
  339. package/dist/custom/utilities/index.js.map +1 -1
  340. package/dist/custom/utilities/ip-geolocation.action.d.ts +0 -4
  341. package/dist/custom/utilities/ip-geolocation.action.d.ts.map +1 -1
  342. package/dist/custom/utilities/ip-geolocation.action.js +9 -22
  343. package/dist/custom/utilities/ip-geolocation.action.js.map +1 -1
  344. package/dist/custom/utilities/json-param-helper.js +1 -5
  345. package/dist/custom/utilities/json-param-helper.js.map +1 -1
  346. package/dist/custom/utilities/qr-code.action.d.ts +0 -4
  347. package/dist/custom/utilities/qr-code.action.d.ts.map +1 -1
  348. package/dist/custom/utilities/qr-code.action.js +6 -16
  349. package/dist/custom/utilities/qr-code.action.js.map +1 -1
  350. package/dist/custom/utilities/vectorize-entity.action.d.ts +0 -9
  351. package/dist/custom/utilities/vectorize-entity.action.d.ts.map +1 -1
  352. package/dist/custom/utilities/vectorize-entity.action.js +10 -25
  353. package/dist/custom/utilities/vectorize-entity.action.js.map +1 -1
  354. package/dist/custom/visualization/create-mermaid-diagram.action.d.ts +0 -5
  355. package/dist/custom/visualization/create-mermaid-diagram.action.d.ts.map +1 -1
  356. package/dist/custom/visualization/create-mermaid-diagram.action.js +11 -25
  357. package/dist/custom/visualization/create-mermaid-diagram.action.js.map +1 -1
  358. package/dist/custom/visualization/create-svg-chart.action.d.ts +1 -6
  359. package/dist/custom/visualization/create-svg-chart.action.d.ts.map +1 -1
  360. package/dist/custom/visualization/create-svg-chart.action.js +52 -86
  361. package/dist/custom/visualization/create-svg-chart.action.js.map +1 -1
  362. package/dist/custom/visualization/create-svg-diagram.action.d.ts +1 -5
  363. package/dist/custom/visualization/create-svg-diagram.action.d.ts.map +1 -1
  364. package/dist/custom/visualization/create-svg-diagram.action.js +39 -72
  365. package/dist/custom/visualization/create-svg-diagram.action.js.map +1 -1
  366. package/dist/custom/visualization/create-svg-infographic.action.d.ts +1 -5
  367. package/dist/custom/visualization/create-svg-infographic.action.d.ts.map +1 -1
  368. package/dist/custom/visualization/create-svg-infographic.action.js +16 -26
  369. package/dist/custom/visualization/create-svg-infographic.action.js.map +1 -1
  370. package/dist/custom/visualization/create-svg-network.action.d.ts +1 -5
  371. package/dist/custom/visualization/create-svg-network.action.d.ts.map +1 -1
  372. package/dist/custom/visualization/create-svg-network.action.js +43 -76
  373. package/dist/custom/visualization/create-svg-network.action.js.map +1 -1
  374. package/dist/custom/visualization/create-svg-sketch-diagram.action.d.ts +1 -5
  375. package/dist/custom/visualization/create-svg-sketch-diagram.action.d.ts.map +1 -1
  376. package/dist/custom/visualization/create-svg-sketch-diagram.action.js +48 -84
  377. package/dist/custom/visualization/create-svg-sketch-diagram.action.js.map +1 -1
  378. package/dist/custom/visualization/create-svg-word-cloud.action.d.ts +1 -5
  379. package/dist/custom/visualization/create-svg-word-cloud.action.d.ts.map +1 -1
  380. package/dist/custom/visualization/create-svg-word-cloud.action.js +31 -44
  381. package/dist/custom/visualization/create-svg-word-cloud.action.js.map +1 -1
  382. package/dist/custom/visualization/shared/mermaid-types.js +1 -4
  383. package/dist/custom/visualization/shared/mermaid-types.js.map +1 -1
  384. package/dist/custom/visualization/shared/svg-theming.d.ts +1 -1
  385. package/dist/custom/visualization/shared/svg-theming.js +13 -22
  386. package/dist/custom/visualization/shared/svg-theming.js.map +1 -1
  387. package/dist/custom/visualization/shared/svg-types.js +1 -2
  388. package/dist/custom/visualization/shared/svg-types.js.map +1 -1
  389. package/dist/custom/visualization/shared/svg-utils.d.ts +1 -1
  390. package/dist/custom/visualization/shared/svg-utils.js +3 -7
  391. package/dist/custom/visualization/shared/svg-utils.js.map +1 -1
  392. package/dist/custom/web/duckduckgo-rate-limiter.js +27 -33
  393. package/dist/custom/web/duckduckgo-rate-limiter.js.map +1 -1
  394. package/dist/custom/web/google-custom-search.action.d.ts +0 -4
  395. package/dist/custom/web/google-custom-search.action.d.ts.map +1 -1
  396. package/dist/custom/web/google-custom-search.action.js +11 -24
  397. package/dist/custom/web/google-custom-search.action.js.map +1 -1
  398. package/dist/custom/web/perplexity-search.action.d.ts +0 -4
  399. package/dist/custom/web/perplexity-search.action.d.ts.map +1 -1
  400. package/dist/custom/web/perplexity-search.action.js +11 -24
  401. package/dist/custom/web/perplexity-search.action.js.map +1 -1
  402. package/dist/custom/web/url-link-validator.action.d.ts +0 -4
  403. package/dist/custom/web/url-link-validator.action.d.ts.map +1 -1
  404. package/dist/custom/web/url-link-validator.action.js +12 -19
  405. package/dist/custom/web/url-link-validator.action.js.map +1 -1
  406. package/dist/custom/web/url-metadata-extractor.action.d.ts +0 -4
  407. package/dist/custom/web/url-metadata-extractor.action.d.ts.map +1 -1
  408. package/dist/custom/web/url-metadata-extractor.action.js +14 -24
  409. package/dist/custom/web/url-metadata-extractor.action.js.map +1 -1
  410. package/dist/custom/web/web-page-content.action.d.ts +0 -4
  411. package/dist/custom/web/web-page-content.action.d.ts.map +1 -1
  412. package/dist/custom/web/web-page-content.action.js +19 -33
  413. package/dist/custom/web/web-page-content.action.js.map +1 -1
  414. package/dist/custom/web/web-search.action.d.ts +0 -4
  415. package/dist/custom/web/web-search.action.d.ts.map +1 -1
  416. package/dist/custom/web/web-search.action.js +8 -18
  417. package/dist/custom/web/web-search.action.js.map +1 -1
  418. package/dist/custom/workflow/conditional.action.d.ts +0 -4
  419. package/dist/custom/workflow/conditional.action.d.ts.map +1 -1
  420. package/dist/custom/workflow/conditional.action.js +12 -22
  421. package/dist/custom/workflow/conditional.action.js.map +1 -1
  422. package/dist/custom/workflow/delay.action.d.ts +0 -4
  423. package/dist/custom/workflow/delay.action.d.ts.map +1 -1
  424. package/dist/custom/workflow/delay.action.js +6 -16
  425. package/dist/custom/workflow/delay.action.js.map +1 -1
  426. package/dist/custom/workflow/loop.action.d.ts +0 -4
  427. package/dist/custom/workflow/loop.action.d.ts.map +1 -1
  428. package/dist/custom/workflow/loop.action.js +12 -22
  429. package/dist/custom/workflow/loop.action.js.map +1 -1
  430. package/dist/custom/workflow/parallel-execute.action.d.ts +0 -4
  431. package/dist/custom/workflow/parallel-execute.action.d.ts.map +1 -1
  432. package/dist/custom/workflow/parallel-execute.action.js +12 -22
  433. package/dist/custom/workflow/parallel-execute.action.js.map +1 -1
  434. package/dist/custom/workflow/retry.action.d.ts +0 -4
  435. package/dist/custom/workflow/retry.action.d.ts.map +1 -1
  436. package/dist/custom/workflow/retry.action.js +8 -18
  437. package/dist/custom/workflow/retry.action.js.map +1 -1
  438. package/dist/generated/action_subclasses.d.ts +0 -1
  439. package/dist/generated/action_subclasses.d.ts.map +1 -1
  440. package/dist/generated/action_subclasses.js +14 -21
  441. package/dist/generated/action_subclasses.js.map +1 -1
  442. package/dist/index.d.ts +77 -77
  443. package/dist/index.d.ts.map +1 -1
  444. package/dist/index.js +78 -279
  445. package/dist/index.js.map +1 -1
  446. package/package.json +63 -61
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @fileoverview Action to list available tools from an MCP server
3
+ *
4
+ * This action retrieves the list of tools available from an MCP server
5
+ * connection, useful for discovery and documentation purposes.
6
+ *
7
+ * @module @memberjunction/actions/mcp/list-mcp-tools
8
+ */
9
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14
+ };
15
+ import { RegisterClass } from "@memberjunction/global";
16
+ import { BaseAction } from "@memberjunction/actions";
17
+ import { LogError } from "@memberjunction/core";
18
+ import { MCPClientManager } from "@memberjunction/ai-mcp-client";
19
+ /**
20
+ * Action to list available tools from an MCP server.
21
+ *
22
+ * This action connects to an MCP server and retrieves the list of
23
+ * available tools with their names, descriptions, and input schemas.
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * await runAction({
28
+ * ActionName: 'List MCP Tools',
29
+ * Params: [
30
+ * { Name: 'ConnectionID', Value: 'connection-uuid' }
31
+ * ]
32
+ * });
33
+ * ```
34
+ *
35
+ * **Parameters:**
36
+ * - `ConnectionID` (required): UUID of the MCP Server Connection to query
37
+ *
38
+ * **Result:**
39
+ * - Success: Tool list in Message as JSON
40
+ * - Output params include: `Tools`, `ToolCount`
41
+ */
42
+ let ListMCPToolsAction = class ListMCPToolsAction extends BaseAction {
43
+ async InternalRunAction(params) {
44
+ try {
45
+ // Extract parameters
46
+ const connectionId = this.getStringParam(params, 'ConnectionID');
47
+ // Validate required parameters
48
+ if (!connectionId) {
49
+ return {
50
+ Success: false,
51
+ ResultCode: 'MISSING_PARAMETER',
52
+ Message: "Parameter 'ConnectionID' is required"
53
+ };
54
+ }
55
+ // Get the MCP Client Manager
56
+ const manager = MCPClientManager.Instance;
57
+ // Ensure we're connected
58
+ if (!manager.isConnected(connectionId)) {
59
+ await manager.connect(connectionId, {
60
+ contextUser: params.ContextUser,
61
+ skipAutoSync: true
62
+ });
63
+ }
64
+ // List tools
65
+ const result = await manager.listTools(connectionId, {
66
+ contextUser: params.ContextUser
67
+ });
68
+ // Add output parameters
69
+ this.addOutputParam(params, 'Tools', result.tools);
70
+ this.addOutputParam(params, 'ToolCount', result.tools.length);
71
+ if (!result.success) {
72
+ return {
73
+ Success: false,
74
+ ResultCode: 'LIST_FAILED',
75
+ Message: result.error ?? 'Failed to list tools',
76
+ Params: params.Params
77
+ };
78
+ }
79
+ // Format output message with tool summary
80
+ const toolSummary = result.tools.map(t => ({
81
+ name: t.name,
82
+ description: t.description ?? '(No description)'
83
+ }));
84
+ const message = JSON.stringify({
85
+ count: result.tools.length,
86
+ tools: toolSummary
87
+ }, null, 2);
88
+ return {
89
+ Success: true,
90
+ ResultCode: 'SUCCESS',
91
+ Message: message,
92
+ Params: params.Params
93
+ };
94
+ }
95
+ catch (error) {
96
+ LogError(`[ListMCPToolsAction] Error: ${error}`);
97
+ return {
98
+ Success: false,
99
+ ResultCode: 'UNEXPECTED_ERROR',
100
+ Message: error instanceof Error ? error.message : String(error)
101
+ };
102
+ }
103
+ }
104
+ // Helper methods for parameter extraction
105
+ getStringParam(params, name) {
106
+ const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
107
+ if (!param || param.Value === undefined || param.Value === null) {
108
+ return undefined;
109
+ }
110
+ const value = String(param.Value).trim();
111
+ return value.length > 0 ? value : undefined;
112
+ }
113
+ addOutputParam(params, name, value) {
114
+ params.Params.push({
115
+ Name: name,
116
+ Type: 'Output',
117
+ Value: value
118
+ });
119
+ }
120
+ };
121
+ ListMCPToolsAction = __decorate([
122
+ RegisterClass(BaseAction, "List MCP Tools")
123
+ ], ListMCPToolsAction);
124
+ export { ListMCPToolsAction };
125
+ //# sourceMappingURL=list-mcp-tools.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-mcp-tools.action.js","sourceRoot":"","sources":["../../../src/custom/mcp/list-mcp-tools.action.ts"],"names":[],"mappings":"AAAA;;;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AC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1F,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YAC9D,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,CAAC;IAEO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QACxE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA3FY,kBAAkB;IAD9B,aAAa,CAAC,UAAU,EAAE,gBAAgB,CAAC;GAC/B,kBAAkB,CA2F9B"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @fileoverview Generic driver class for MCP Tool Actions
3
+ *
4
+ * This class handles execution of auto-generated Actions that are linked to
5
+ * MCP Server Tools via the GeneratedActionID field. When an MCP tool is synced
6
+ * to an Action (under System/AI/MCP/{ServerName}), this driver class is used
7
+ * to execute it.
8
+ *
9
+ * The class:
10
+ * 1. Looks up the MCPServerTool using params.Action.ID (matching GeneratedActionID)
11
+ * 2. Finds an active connection for the tool's server
12
+ * 3. Maps Action parameters to tool arguments
13
+ * 4. Calls the tool via MCPClientManager
14
+ *
15
+ * @module @memberjunction/actions/mcp/mcp-tool
16
+ */
17
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
18
+ import { BaseAction } from "@memberjunction/actions";
19
+ /**
20
+ * Generic driver class for all auto-generated MCP Tool Actions.
21
+ *
22
+ * When an MCP Server Tool is synced to an Action (via syncActionsForServer),
23
+ * the Action's DriverClass is set to 'MCPToolAction'. This class handles
24
+ * execution of all such actions by:
25
+ *
26
+ * 1. Looking up the MCPServerTool entity that has GeneratedActionID = Action.ID
27
+ * 2. Finding an active connection for the tool's server
28
+ * 3. Mapping ActionParams to tool arguments (using param Name as key)
29
+ * 4. Calling the MCP tool and returning the result
30
+ *
31
+ * @example
32
+ * // An Action with DriverClass='MCPToolAction' will be handled by this class
33
+ * // The tool is identified by looking up MCPServerTool.GeneratedActionID = Action.ID
34
+ *
35
+ * await runAction({
36
+ * ActionName: 'search_documentation', // Name matches ToolName from MCP Server
37
+ * Params: [
38
+ * { Name: 'query', Value: 'MemberJunction API' },
39
+ * { Name: 'maxResults', Value: 10 }
40
+ * ]
41
+ * });
42
+ *
43
+ * **Optional Parameter:**
44
+ * - `ConnectionID` (optional): Specific connection to use. If not provided,
45
+ * an active connection for the server will be automatically selected.
46
+ */
47
+ export declare class MCPToolAction extends BaseAction {
48
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
49
+ /**
50
+ * Looks up the MCPServerTool entity that has GeneratedActionID matching the action ID.
51
+ */
52
+ private lookupMCPServerTool;
53
+ /**
54
+ * Resolves the connection ID to use for the tool execution.
55
+ * First checks for an explicit ConnectionID parameter, then finds an active connection.
56
+ */
57
+ private resolveConnectionId;
58
+ /**
59
+ * Builds the tool arguments object from ActionParams.
60
+ * Excludes system parameters like ConnectionID and Timeout.
61
+ */
62
+ private buildToolArguments;
63
+ private getStringParam;
64
+ private getNumericParam;
65
+ private addOutputParam;
66
+ }
67
+ //# sourceMappingURL=mcp-tool.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool.action.d.ts","sourceRoot":"","sources":["../../../src/custom/mcp/mcp-tool.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBACa,aAAc,SAAQ,UAAU;cAEzB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgGvF;;OAEG;YACW,mBAAmB;IAmBjC;;;OAGG;YACW,mBAAmB;IA4BjC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,cAAc;CAOzB"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * @fileoverview Generic driver class for MCP Tool Actions
3
+ *
4
+ * This class handles execution of auto-generated Actions that are linked to
5
+ * MCP Server Tools via the GeneratedActionID field. When an MCP tool is synced
6
+ * to an Action (under System/AI/MCP/{ServerName}), this driver class is used
7
+ * to execute it.
8
+ *
9
+ * The class:
10
+ * 1. Looks up the MCPServerTool using params.Action.ID (matching GeneratedActionID)
11
+ * 2. Finds an active connection for the tool's server
12
+ * 3. Maps Action parameters to tool arguments
13
+ * 4. Calls the tool via MCPClientManager
14
+ *
15
+ * @module @memberjunction/actions/mcp/mcp-tool
16
+ */
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ import { RegisterClass } from "@memberjunction/global";
24
+ import { BaseAction } from "@memberjunction/actions";
25
+ import { LogError, LogStatus, RunView } from "@memberjunction/core";
26
+ import { MCPClientManager } from "@memberjunction/ai-mcp-client";
27
+ /**
28
+ * Generic driver class for all auto-generated MCP Tool Actions.
29
+ *
30
+ * When an MCP Server Tool is synced to an Action (via syncActionsForServer),
31
+ * the Action's DriverClass is set to 'MCPToolAction'. This class handles
32
+ * execution of all such actions by:
33
+ *
34
+ * 1. Looking up the MCPServerTool entity that has GeneratedActionID = Action.ID
35
+ * 2. Finding an active connection for the tool's server
36
+ * 3. Mapping ActionParams to tool arguments (using param Name as key)
37
+ * 4. Calling the MCP tool and returning the result
38
+ *
39
+ * @example
40
+ * // An Action with DriverClass='MCPToolAction' will be handled by this class
41
+ * // The tool is identified by looking up MCPServerTool.GeneratedActionID = Action.ID
42
+ *
43
+ * await runAction({
44
+ * ActionName: 'search_documentation', // Name matches ToolName from MCP Server
45
+ * Params: [
46
+ * { Name: 'query', Value: 'MemberJunction API' },
47
+ * { Name: 'maxResults', Value: 10 }
48
+ * ]
49
+ * });
50
+ *
51
+ * **Optional Parameter:**
52
+ * - `ConnectionID` (optional): Specific connection to use. If not provided,
53
+ * an active connection for the server will be automatically selected.
54
+ */
55
+ let MCPToolAction = class MCPToolAction extends BaseAction {
56
+ async InternalRunAction(params) {
57
+ try {
58
+ const actionId = params.Action.ID;
59
+ const actionName = params.Action.Name;
60
+ LogStatus(`[MCPToolAction] Executing action '${actionName}' (ID: ${actionId})`);
61
+ // Step 1: Look up the MCPServerTool by GeneratedActionID
62
+ const tool = await this.lookupMCPServerTool(actionId, params);
63
+ if (!tool) {
64
+ return {
65
+ Success: false,
66
+ ResultCode: 'TOOL_NOT_FOUND',
67
+ Message: `Could not find MCP Server Tool linked to action '${actionName}' (ID: ${actionId}). ` +
68
+ `Ensure the tool has been synced with GeneratedActionID set.`
69
+ };
70
+ }
71
+ LogStatus(`[MCPToolAction] Found tool '${tool.ToolName}' on server '${tool.MCPServer}'`);
72
+ // Step 2: Get the connection (either from params or find an active one)
73
+ const connectionId = await this.resolveConnectionId(tool, params);
74
+ if (!connectionId) {
75
+ return {
76
+ Success: false,
77
+ ResultCode: 'NO_CONNECTION',
78
+ Message: `No active connection available for MCP Server '${tool.MCPServer}'. ` +
79
+ `Please create an active connection or provide a ConnectionID parameter.`
80
+ };
81
+ }
82
+ // Step 3: Build arguments from ActionParams
83
+ const toolArguments = this.buildToolArguments(params);
84
+ LogStatus(`[MCPToolAction] Calling tool '${tool.ToolName}' via connection '${connectionId}'`);
85
+ // Step 4: Get the MCP Client Manager and ensure connected
86
+ const manager = MCPClientManager.Instance;
87
+ if (!manager.isConnected(connectionId)) {
88
+ await manager.connect(connectionId, {
89
+ contextUser: params.ContextUser,
90
+ skipAutoSync: true
91
+ });
92
+ }
93
+ // Step 5: Call the tool
94
+ const timeout = this.getNumericParam(params, 'Timeout', 60000);
95
+ const result = await manager.callTool(connectionId, tool.ToolName, {
96
+ arguments: toolArguments,
97
+ timeout
98
+ }, { contextUser: params.ContextUser });
99
+ // Step 6: Add output parameters
100
+ this.addOutputParam(params, 'ToolOutput', result.content);
101
+ this.addOutputParam(params, 'StructuredOutput', result.structuredContent);
102
+ this.addOutputParam(params, 'DurationMs', result.durationMs);
103
+ this.addOutputParam(params, 'IsToolError', result.isToolError);
104
+ this.addOutputParam(params, 'ToolName', tool.ToolName);
105
+ this.addOutputParam(params, 'ServerName', tool.MCPServer);
106
+ if (!result.success) {
107
+ return {
108
+ Success: false,
109
+ ResultCode: result.isToolError ? 'TOOL_ERROR' : 'EXECUTION_FAILED',
110
+ Message: result.error ?? `Tool '${tool.ToolName}' execution failed`,
111
+ Params: params.Params
112
+ };
113
+ }
114
+ // Format output message
115
+ const output = result.structuredContent ?? result.content;
116
+ const message = typeof output === 'string' ? output : JSON.stringify(output, null, 2);
117
+ return {
118
+ Success: true,
119
+ ResultCode: 'SUCCESS',
120
+ Message: message,
121
+ Params: params.Params
122
+ };
123
+ }
124
+ catch (error) {
125
+ LogError(`[MCPToolAction] Error executing action '${params.Action?.Name}': ${error}`);
126
+ return {
127
+ Success: false,
128
+ ResultCode: 'UNEXPECTED_ERROR',
129
+ Message: error instanceof Error ? error.message : String(error)
130
+ };
131
+ }
132
+ }
133
+ /**
134
+ * Looks up the MCPServerTool entity that has GeneratedActionID matching the action ID.
135
+ */
136
+ async lookupMCPServerTool(actionId, params) {
137
+ const rv = new RunView();
138
+ const result = await rv.RunView({
139
+ EntityName: 'MJ: MCP Server Tools',
140
+ ExtraFilter: `GeneratedActionID='${actionId}'`,
141
+ ResultType: 'entity_object'
142
+ }, params.ContextUser);
143
+ if (!result.Success || result.Results.length === 0) {
144
+ return null;
145
+ }
146
+ return result.Results[0];
147
+ }
148
+ /**
149
+ * Resolves the connection ID to use for the tool execution.
150
+ * First checks for an explicit ConnectionID parameter, then finds an active connection.
151
+ */
152
+ async resolveConnectionId(tool, params) {
153
+ // Check for explicit ConnectionID parameter
154
+ const explicitConnectionId = this.getStringParam(params, 'ConnectionID');
155
+ if (explicitConnectionId) {
156
+ return explicitConnectionId;
157
+ }
158
+ // Find an active connection for the tool's server
159
+ const rv = new RunView();
160
+ const result = await rv.RunView({
161
+ EntityName: 'MJ: MCP Server Connections',
162
+ ExtraFilter: `MCPServerID='${tool.MCPServerID}' AND Status='Active'`,
163
+ OrderBy: '__mj_CreatedAt ASC', // Use oldest connection as default
164
+ MaxRows: 1,
165
+ ResultType: 'entity_object'
166
+ }, params.ContextUser);
167
+ if (!result.Success || result.Results.length === 0) {
168
+ return null;
169
+ }
170
+ return result.Results[0].ID;
171
+ }
172
+ /**
173
+ * Builds the tool arguments object from ActionParams.
174
+ * Excludes system parameters like ConnectionID and Timeout.
175
+ */
176
+ buildToolArguments(params) {
177
+ const systemParams = new Set(['connectionid', 'timeout']);
178
+ const args = {};
179
+ for (const param of params.Params) {
180
+ // Skip output params and system params
181
+ if (param.Type === 'Output' || systemParams.has(param.Name.toLowerCase())) {
182
+ continue;
183
+ }
184
+ // Add to arguments using original param name
185
+ if (param.Value !== undefined && param.Value !== null) {
186
+ args[param.Name] = param.Value;
187
+ }
188
+ }
189
+ return args;
190
+ }
191
+ // Helper methods for parameter extraction
192
+ getStringParam(params, name) {
193
+ const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
194
+ if (!param || param.Value === undefined || param.Value === null) {
195
+ return undefined;
196
+ }
197
+ const value = String(param.Value).trim();
198
+ return value.length > 0 ? value : undefined;
199
+ }
200
+ getNumericParam(params, name, defaultValue) {
201
+ const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
202
+ if (!param || param.Value === undefined || param.Value === null) {
203
+ return defaultValue;
204
+ }
205
+ const parsed = Number(param.Value);
206
+ return isNaN(parsed) ? defaultValue : parsed;
207
+ }
208
+ addOutputParam(params, name, value) {
209
+ params.Params.push({
210
+ Name: name,
211
+ Type: 'Output',
212
+ Value: value
213
+ });
214
+ }
215
+ };
216
+ MCPToolAction = __decorate([
217
+ RegisterClass(BaseAction, "MCPToolAction")
218
+ ], MCPToolAction);
219
+ export { MCPToolAction };
220
+ //# sourceMappingURL=mcp-tool.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool.action.js","sourceRoot":"","sources":["../../../src/custom/mcp/mcp-tool.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAE/B,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,UAAU,GAAG,MAAM,CAAC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C,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA1MY,aAAa;IADzB,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;GAC9B,aAAa,CA0MzB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @fileoverview Action to synchronize tools from an MCP server to the database
3
+ *
4
+ * This action discovers tools from an MCP server and updates the local
5
+ * tool definitions in the database for discoverability and management.
6
+ *
7
+ * @module @memberjunction/actions/mcp/sync-mcp-tools
8
+ */
9
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
10
+ import { BaseAction } from "@memberjunction/actions";
11
+ /**
12
+ * Action to synchronize MCP server tools to the database.
13
+ *
14
+ * This action connects to an MCP server, lists all available tools,
15
+ * and updates the local database cache. New tools are added, existing
16
+ * tools are updated, and tools no longer available are marked deprecated.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * await runAction({
21
+ * ActionName: 'Sync MCP Tools',
22
+ * Params: [
23
+ * { Name: 'ConnectionID', Value: 'connection-uuid' }
24
+ * ]
25
+ * });
26
+ * ```
27
+ *
28
+ * **Parameters:**
29
+ * - `ConnectionID` (required): UUID of the MCP Server Connection to sync
30
+ *
31
+ * **Result:**
32
+ * - Success: Sync summary in Message
33
+ * - Output params include: `Added`, `Updated`, `Deprecated`, `Total`
34
+ */
35
+ export declare class SyncMCPToolsAction extends BaseAction {
36
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
37
+ private getStringParam;
38
+ private addOutputParam;
39
+ }
40
+ //# sourceMappingURL=sync-mcp-tools.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-mcp-tools.action.d.ts","sourceRoot":"","sources":["../../../src/custom/mcp/sync-mcp-tools.action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,kBAAmB,SAAQ,UAAU;cAE9B,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkEvF,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,cAAc;CAOzB"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @fileoverview Action to synchronize tools from an MCP server to the database
3
+ *
4
+ * This action discovers tools from an MCP server and updates the local
5
+ * tool definitions in the database for discoverability and management.
6
+ *
7
+ * @module @memberjunction/actions/mcp/sync-mcp-tools
8
+ */
9
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14
+ };
15
+ import { RegisterClass } from "@memberjunction/global";
16
+ import { BaseAction } from "@memberjunction/actions";
17
+ import { LogError } from "@memberjunction/core";
18
+ import { MCPClientManager } from "@memberjunction/ai-mcp-client";
19
+ /**
20
+ * Action to synchronize MCP server tools to the database.
21
+ *
22
+ * This action connects to an MCP server, lists all available tools,
23
+ * and updates the local database cache. New tools are added, existing
24
+ * tools are updated, and tools no longer available are marked deprecated.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * await runAction({
29
+ * ActionName: 'Sync MCP Tools',
30
+ * Params: [
31
+ * { Name: 'ConnectionID', Value: 'connection-uuid' }
32
+ * ]
33
+ * });
34
+ * ```
35
+ *
36
+ * **Parameters:**
37
+ * - `ConnectionID` (required): UUID of the MCP Server Connection to sync
38
+ *
39
+ * **Result:**
40
+ * - Success: Sync summary in Message
41
+ * - Output params include: `Added`, `Updated`, `Deprecated`, `Total`
42
+ */
43
+ let SyncMCPToolsAction = class SyncMCPToolsAction extends BaseAction {
44
+ async InternalRunAction(params) {
45
+ try {
46
+ // Extract parameters
47
+ const connectionId = this.getStringParam(params, 'ConnectionID');
48
+ // Validate required parameters
49
+ if (!connectionId) {
50
+ return {
51
+ Success: false,
52
+ ResultCode: 'MISSING_PARAMETER',
53
+ Message: "Parameter 'ConnectionID' is required"
54
+ };
55
+ }
56
+ // Get the MCP Client Manager
57
+ const manager = MCPClientManager.Instance;
58
+ // Ensure we're connected
59
+ if (!manager.isConnected(connectionId)) {
60
+ await manager.connect(connectionId, {
61
+ contextUser: params.ContextUser,
62
+ skipAutoSync: true // We'll sync manually
63
+ });
64
+ }
65
+ // Sync tools
66
+ const result = await manager.syncTools(connectionId, {
67
+ contextUser: params.ContextUser
68
+ });
69
+ // Add output parameters
70
+ this.addOutputParam(params, 'Added', result.added);
71
+ this.addOutputParam(params, 'Updated', result.updated);
72
+ this.addOutputParam(params, 'Deprecated', result.deprecated);
73
+ this.addOutputParam(params, 'Total', result.total);
74
+ if (!result.success) {
75
+ return {
76
+ Success: false,
77
+ ResultCode: 'SYNC_FAILED',
78
+ Message: result.error ?? 'Tool synchronization failed',
79
+ Params: params.Params
80
+ };
81
+ }
82
+ const message = `Tool sync completed: ${result.added} added, ${result.updated} updated, ${result.deprecated} deprecated. Total: ${result.total} tools.`;
83
+ return {
84
+ Success: true,
85
+ ResultCode: 'SUCCESS',
86
+ Message: message,
87
+ Params: params.Params
88
+ };
89
+ }
90
+ catch (error) {
91
+ LogError(`[SyncMCPToolsAction] Error: ${error}`);
92
+ return {
93
+ Success: false,
94
+ ResultCode: 'UNEXPECTED_ERROR',
95
+ Message: error instanceof Error ? error.message : String(error)
96
+ };
97
+ }
98
+ }
99
+ // Helper methods for parameter extraction
100
+ getStringParam(params, name) {
101
+ const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
102
+ if (!param || param.Value === undefined || param.Value === null) {
103
+ return undefined;
104
+ }
105
+ const value = String(param.Value).trim();
106
+ return value.length > 0 ? value : undefined;
107
+ }
108
+ addOutputParam(params, name, value) {
109
+ params.Params.push({
110
+ Name: name,
111
+ Type: 'Output',
112
+ Value: value
113
+ });
114
+ }
115
+ };
116
+ SyncMCPToolsAction = __decorate([
117
+ RegisterClass(BaseAction, "Sync MCP Tools")
118
+ ], SyncMCPToolsAction);
119
+ export { SyncMCPToolsAction };
120
+ //# sourceMappingURL=sync-mcp-tools.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-mcp-tools.action.js","sourceRoot":"","sources":["../../../src/custom/mcp/sync-mcp-tools.action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAEpC,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,qBAAqB;YACrB,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAEjE,+BAA+B;YAC/B,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChB,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,mBAAmB;oBAC/B,OAAO,EAAE,sCAAsC;iBAClD,CAAC;YACN,CAAC;YAED,6BAA6B;YAC7B,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ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ies connectivity to an MCP server and retrieves
5
+ * server information including name, version, and capabilities.
6
+ *
7
+ * @module @memberjunction/actions/mcp/test-mcp-connection
8
+ */
9
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
10
+ import { BaseAction } from "@memberjunction/actions";
11
+ /**
12
+ * Action to test an MCP server connection.
13
+ *
14
+ * This action attempts to connect to an MCP server and validates
15
+ * the connection is working. It returns server information and latency.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * await runAction({
20
+ * ActionName: 'Test MCP Connection',
21
+ * Params: [
22
+ * { Name: 'ConnectionID', Value: 'connection-uuid' }
23
+ * ]
24
+ * });
25
+ * ```
26
+ *
27
+ * **Parameters:**
28
+ * - `ConnectionID` (required): UUID of the MCP Server Connection to test
29
+ *
30
+ * **Result:**
31
+ * - Success: Connection details in Message
32
+ * - Output params include: `ServerName`, `ServerVersion`, `LatencyMs`, `Capabilities`
33
+ */
34
+ export declare class TestMCPConnectionAction extends BaseAction {
35
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
36
+ private getStringParam;
37
+ private addOutputParam;
38
+ }
39
+ //# sourceMappingURL=test-mcp-connection.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-mcp-connection.action.d.ts","sourceRoot":"","sources":["../../../src/custom/mcp/test-mcp-connection.action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,uBAAwB,SAAQ,UAAU;cAEnC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8DvF,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,cAAc;CAOzB"}