@langwatch/mcp-server 2.2.0 → 3.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 (251) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/add-dashboard-widget-55UI6H22.js +44 -0
  3. package/dist/add-dashboard-widget-MJHIC3CC.js +45 -0
  4. package/dist/{archive-project-SPVHXK6A.js → archive-project-K5UD7A6X.js} +4 -4
  5. package/dist/{archive-project-KWFM3I5Z.js → archive-project-L4PAKT34.js} +4 -4
  6. package/dist/{archive-run-plan-65QN3XRX.js → archive-run-plan-5HSQG2HX.js} +4 -4
  7. package/dist/{archive-run-plan-Z4SYE6BP.js → archive-run-plan-AOKNYQIO.js} +4 -4
  8. package/dist/{archive-scenario-FXEYQNEH.js → archive-scenario-2CWJW2VD.js} +4 -4
  9. package/dist/{archive-scenario-A6QV5LOW.js → archive-scenario-5IJQESHH.js} +4 -4
  10. package/dist/{archive-test-suite-NKZDZY3D.js → archive-test-suite-OPB7NFI7.js} +4 -4
  11. package/dist/{archive-test-suite-5ADQ3KPQ.js → archive-test-suite-ZC3TN6VH.js} +4 -4
  12. package/dist/{assign-prompt-tag-5IUZXJ2T.js → assign-prompt-tag-6DDE6ZZ5.js} +3 -3
  13. package/dist/{assign-prompt-tag-HBZLBIFD.js → assign-prompt-tag-D7O23MJM.js} +3 -3
  14. package/dist/{chunk-HGELNIVY.js → chunk-4RX3G62A.js} +3 -3
  15. package/dist/{chunk-UWLE5T2F.js → chunk-7CZQDZ2K.js} +10 -3
  16. package/dist/{chunk-I7ATIZED.js → chunk-7GETGE6B.js} +2 -2
  17. package/dist/{chunk-3OCG3QPU.js → chunk-AASW2TO2.js} +2 -2
  18. package/dist/{chunk-UTJCWXPZ.js → chunk-B4RFWIUP.js} +2 -2
  19. package/dist/{chunk-B4J3PJLX.js → chunk-D2HS73VI.js} +2 -6
  20. package/dist/{chunk-H6WGMG2T.js → chunk-DULFP3MK.js} +1 -1
  21. package/dist/{chunk-YCARO42Z.js → chunk-EYPJBL7P.js} +3 -3
  22. package/dist/{chunk-SUPUUC4W.js → chunk-GA5JUSPT.js} +2 -2
  23. package/dist/{chunk-Y34DHR5K.js → chunk-HLQJXUR6.js} +2 -2
  24. package/dist/{chunk-SXFC3FNH.js → chunk-KILVK3FS.js} +2 -2
  25. package/dist/chunk-MOCU5XWF.js +79 -0
  26. package/dist/chunk-O2WGVCED.js +41 -0
  27. package/dist/{chunk-NKMTIHIJ.js → chunk-QXLMHLRC.js} +2 -2
  28. package/dist/{chunk-J7PQKBLD.js → chunk-R5YJIYPF.js} +512 -402
  29. package/dist/{chunk-JRJPH75H.js → chunk-RFC2SBEX.js} +2 -2
  30. package/dist/{chunk-UNJM3BIL.js → chunk-SHSVN3SE.js} +2 -2
  31. package/dist/{chunk-PTDR56Z3.js → chunk-VOUGDY2O.js} +2 -2
  32. package/dist/chunk-WCKZDOGF.js +31 -0
  33. package/dist/{chunk-7VNSRCXO.js → chunk-XQYH52SI.js} +2 -2
  34. package/dist/{chunk-VMWJD732.js → chunk-YCIUEZVK.js} +2 -2
  35. package/dist/{config-EAKW6F26.js → config-2WQGMAEN.js} +2 -2
  36. package/dist/config.js +1 -1
  37. package/dist/{create-agent-AYZ3LB3V.js → create-agent-6JNLMYQD.js} +4 -4
  38. package/dist/{create-agent-S5ZBCEFT.js → create-agent-IRZOU4R5.js} +4 -4
  39. package/dist/create-analytics-report-N4L4V5QL.js +19 -0
  40. package/dist/create-analytics-report-QEHXG7FU.js +18 -0
  41. package/dist/{create-annotation-VUSXULQK.js → create-annotation-CCEGIZ67.js} +4 -4
  42. package/dist/{create-annotation-LHNCLHYP.js → create-annotation-DTHCMWHB.js} +4 -4
  43. package/dist/{create-api-key-NNYKARMG.js → create-api-key-JKM2DSZO.js} +4 -4
  44. package/dist/{create-api-key-T4KSNPKB.js → create-api-key-JPEUIXGM.js} +4 -4
  45. package/dist/{create-dataset-LUP5PVDM.js → create-dataset-DJNXYJ5B.js} +4 -4
  46. package/dist/{create-dataset-2MC4SD4O.js → create-dataset-WON4SOTC.js} +4 -4
  47. package/dist/{create-dataset-records-NSKBZP3G.js → create-dataset-records-TMEOTLTO.js} +4 -4
  48. package/dist/{create-dataset-records-W4GLN2FV.js → create-dataset-records-UJBW3C7C.js} +4 -4
  49. package/dist/{create-evaluator-HMTYO5SS.js → create-evaluator-N5AEHI4K.js} +4 -4
  50. package/dist/{create-evaluator-643G6LXL.js → create-evaluator-XYNY2YFY.js} +4 -4
  51. package/dist/create-mcp-server.cjs +769 -570
  52. package/dist/create-mcp-server.js +502 -392
  53. package/dist/{create-project-KAIC46UY.js → create-project-EY4XZ7TH.js} +4 -4
  54. package/dist/{create-project-6N7PIYRY.js → create-project-YL345T5L.js} +4 -4
  55. package/dist/{create-prompt-E67LXIYT.js → create-prompt-JZQNQ7I3.js} +3 -3
  56. package/dist/{create-prompt-PKJ7EDRR.js → create-prompt-ZUMQHHX7.js} +3 -3
  57. package/dist/{create-prompt-tag-4YO3FSJ3.js → create-prompt-tag-CJ5FZ436.js} +3 -3
  58. package/dist/{create-prompt-tag-OPQUEXWB.js → create-prompt-tag-JFP2Q3PO.js} +3 -3
  59. package/dist/{create-scenario-5PJBMAXO.js → create-scenario-CQU2SSFB.js} +4 -4
  60. package/dist/{create-scenario-UEM77OE7.js → create-scenario-S6OWWKJO.js} +4 -4
  61. package/dist/{create-test-suite-SZEPVXSE.js → create-test-suite-OLGCAGJA.js} +4 -4
  62. package/dist/{create-test-suite-4IPXVSFQ.js → create-test-suite-Y7P2RI4L.js} +4 -4
  63. package/dist/{create-trigger-PRELMT6J.js → create-trigger-4CNBTISJ.js} +4 -4
  64. package/dist/{create-trigger-5HZSCRAN.js → create-trigger-RQ653WYF.js} +4 -4
  65. package/dist/dashboards-BA7M6CMO.js +90 -0
  66. package/dist/dashboards-U663GUIB.js +91 -0
  67. package/dist/{delete-agent-QMEK3XHK.js → delete-agent-J2Q4DRZ2.js} +4 -4
  68. package/dist/{delete-agent-JUIZWAXG.js → delete-agent-ZAU4LTXB.js} +4 -4
  69. package/dist/delete-analytics-report-QK6X7P4S.js +19 -0
  70. package/dist/delete-analytics-report-YUYLDHLL.js +18 -0
  71. package/dist/{delete-annotation-HY3O2OGR.js → delete-annotation-7X4NYXXM.js} +4 -4
  72. package/dist/{delete-annotation-VKIQWUYW.js → delete-annotation-KJOCDLV3.js} +4 -4
  73. package/dist/{delete-dataset-WKRUW4FP.js → delete-dataset-NXP7ZPPV.js} +4 -4
  74. package/dist/{delete-dataset-HQCR66MG.js → delete-dataset-RUTZBBVD.js} +4 -4
  75. package/dist/{delete-dataset-records-C2IQFFVQ.js → delete-dataset-records-4Z7DZCDW.js} +4 -4
  76. package/dist/{delete-dataset-records-SDUHQLLM.js → delete-dataset-records-75UAR5IS.js} +4 -4
  77. package/dist/{delete-evaluator-4SNSCLEE.js → delete-evaluator-E3CUNGTQ.js} +4 -4
  78. package/dist/{delete-evaluator-QP3QHTLN.js → delete-evaluator-RI4GALGX.js} +4 -4
  79. package/dist/{delete-prompt-tag-NZ4JQMYG.js → delete-prompt-tag-LE3WJPKS.js} +3 -3
  80. package/dist/{delete-prompt-tag-YYQ4VMAD.js → delete-prompt-tag-S4KBZTNG.js} +3 -3
  81. package/dist/{delete-workflow-JSWABL5F.js → delete-workflow-4CZFIQCQ.js} +4 -4
  82. package/dist/{delete-workflow-5J46T73T.js → delete-workflow-PWQPDW6H.js} +4 -4
  83. package/dist/{discover-schema-A33SLMXW.js → discover-schema-7WHIIATI.js} +4 -4
  84. package/dist/{discover-schema-55YJBFGQ.js → discover-schema-J2ANOBKO.js} +4 -4
  85. package/dist/{get-agent-LJQX7OF4.js → get-agent-5T3CXQOR.js} +4 -4
  86. package/dist/{get-agent-OTIYUFZA.js → get-agent-ZKYQJUQ7.js} +4 -4
  87. package/dist/{get-analytics-IQZKJHLW.js → get-analytics-4MPEK4KV.js} +3 -3
  88. package/dist/{get-analytics-DCS72353.js → get-analytics-ZLI3A4F5.js} +3 -3
  89. package/dist/get-analytics-report-JCKYMA2S.js +29 -0
  90. package/dist/get-analytics-report-SKIP2JWH.js +30 -0
  91. package/dist/{get-dataset-ALSP7RTX.js → get-dataset-APGZBYMH.js} +4 -4
  92. package/dist/{get-dataset-X4B5JDG2.js → get-dataset-LWXDVMVE.js} +4 -4
  93. package/dist/{get-evaluator-XEUZGZCH.js → get-evaluator-3A7BJBAB.js} +4 -4
  94. package/dist/{get-evaluator-ISMC4LLI.js → get-evaluator-IWNJINRY.js} +4 -4
  95. package/dist/{get-project-RM6FRCBK.js → get-project-EQVB4LEL.js} +4 -4
  96. package/dist/{get-project-5VKROSDH.js → get-project-RK6AJTEP.js} +4 -4
  97. package/dist/{get-prompt-OWXJZHQQ.js → get-prompt-TLG2T2DS.js} +3 -3
  98. package/dist/{get-prompt-W52DY36E.js → get-prompt-ZER557X3.js} +3 -3
  99. package/dist/{get-run-plan-RUXQ6PAX.js → get-run-plan-5X7DDJRN.js} +4 -4
  100. package/dist/{get-run-plan-BE3M2AUX.js → get-run-plan-PEHRO5M3.js} +4 -4
  101. package/dist/{get-scenario-YM4ODWW6.js → get-scenario-375W5D6I.js} +4 -4
  102. package/dist/{get-scenario-RNM7BAX2.js → get-scenario-UQX45ZZO.js} +4 -4
  103. package/dist/{get-simulation-run-LCFSMPGQ.js → get-simulation-run-2NBXJADG.js} +4 -4
  104. package/dist/{get-simulation-run-6GIATQE5.js → get-simulation-run-QZTLGL7W.js} +4 -4
  105. package/dist/{get-test-suite-GC2O7YH6.js → get-test-suite-GVIBDG7K.js} +4 -4
  106. package/dist/{get-test-suite-P5LJ6VLF.js → get-test-suite-OODIR3RI.js} +4 -4
  107. package/dist/{get-trace-SEF3FMR5.js → get-trace-AGCHVPJK.js} +3 -3
  108. package/dist/{get-trace-KBRVV4NN.js → get-trace-KJLYAZRC.js} +3 -3
  109. package/dist/{get-workflow-7PVED7JE.js → get-workflow-3TV2YYC5.js} +4 -4
  110. package/dist/{get-workflow-YXULW4GC.js → get-workflow-7LZSVPP2.js} +4 -4
  111. package/dist/{http-server-IR4QOS43.js → http-server-7CCN3EHJ.js} +245 -45
  112. package/dist/index.js +1750 -870
  113. package/dist/langwatch-api-analytics-reports-6CF6KUET.js +17 -0
  114. package/dist/langwatch-api-analytics-reports-RPFB5AO5.js +18 -0
  115. package/dist/{langwatch-api-annotations-TBHLCQ5R.js → langwatch-api-annotations-H4AI4TKG.js} +4 -4
  116. package/dist/{langwatch-api-annotations-6SA4OB4C.js → langwatch-api-annotations-QSJNUQQS.js} +4 -4
  117. package/dist/{langwatch-api-monitors-CBF3FGIM.js → langwatch-api-monitors-ENHLOL3S.js} +3 -3
  118. package/dist/{langwatch-api-monitors-YNWA2M5Y.js → langwatch-api-monitors-OHSGADTH.js} +3 -3
  119. package/dist/{langwatch-api-secrets-RNFO4LF2.js → langwatch-api-secrets-AGW6UUMD.js} +3 -3
  120. package/dist/{langwatch-api-secrets-ADTOJELP.js → langwatch-api-secrets-CLTS766Q.js} +3 -3
  121. package/dist/{langwatch-api-triggers-KQDQC6L5.js → langwatch-api-triggers-G5UWFNN2.js} +4 -4
  122. package/dist/{langwatch-api-triggers-QS7HDIVW.js → langwatch-api-triggers-QMR7KEXW.js} +4 -4
  123. package/dist/langwatch-api-workflows-HKTBIKKY.js +15 -0
  124. package/dist/{langwatch-api-workflows-OKC4FXIF.js → langwatch-api-workflows-OMROZH2O.js} +4 -4
  125. package/dist/{list-agents-HVYWEQMI.js → list-agents-BYWDNAHT.js} +4 -4
  126. package/dist/{list-agents-RBAOCF53.js → list-agents-MG24MHZE.js} +4 -4
  127. package/dist/list-analytics-reports-G3EPWGSQ.js +32 -0
  128. package/dist/list-analytics-reports-PPWIFRES.js +33 -0
  129. package/dist/{list-annotations-HJH4NBLD.js → list-annotations-QCLGEK5A.js} +4 -4
  130. package/dist/{list-annotations-J4UAHSUN.js → list-annotations-Y4EUBJHG.js} +4 -4
  131. package/dist/{list-api-keys-A2PMV435.js → list-api-keys-DAVOBPFK.js} +4 -4
  132. package/dist/{list-api-keys-7UTJRZDG.js → list-api-keys-JMW5WRXX.js} +4 -4
  133. package/dist/list-dashboards-2P3VJFRS.js +29 -0
  134. package/dist/list-dashboards-MW5O3MKH.js +30 -0
  135. package/dist/{list-dataset-records-WFM7F33C.js → list-dataset-records-KEHT7G6Q.js} +4 -4
  136. package/dist/{list-dataset-records-M5TKA6LK.js → list-dataset-records-KMLLMZAZ.js} +4 -4
  137. package/dist/{list-datasets-B5X4P7BQ.js → list-datasets-P3JK2ZHS.js} +4 -4
  138. package/dist/{list-datasets-THUKQHPX.js → list-datasets-Z7OOE4KI.js} +4 -4
  139. package/dist/{list-evaluators-MYH2OVCI.js → list-evaluators-7RRESBOU.js} +4 -4
  140. package/dist/{list-evaluators-NLVWF6K7.js → list-evaluators-VATJVOHR.js} +4 -4
  141. package/dist/{list-model-providers-3JUGP4YI.js → list-model-providers-OXDRPUCJ.js} +4 -4
  142. package/dist/{list-model-providers-H3XKORFO.js → list-model-providers-VXQJWDXU.js} +4 -4
  143. package/dist/{list-projects-6EJ5YYEW.js → list-projects-HUVK7L3W.js} +4 -4
  144. package/dist/{list-projects-YNNSRMLC.js → list-projects-X72ZXVY5.js} +4 -4
  145. package/dist/{list-prompt-tags-NVFQO6WX.js → list-prompt-tags-3I3LWFIR.js} +3 -3
  146. package/dist/{list-prompt-tags-XUQTTAH4.js → list-prompt-tags-DRHUH2ND.js} +3 -3
  147. package/dist/{list-prompts-IRI6AIXO.js → list-prompts-6DX3QECJ.js} +3 -3
  148. package/dist/{list-prompts-HSIMMHTF.js → list-prompts-PS423RU3.js} +3 -3
  149. package/dist/{list-run-plans-QALLCN2K.js → list-run-plans-5SXPOV3X.js} +4 -4
  150. package/dist/{list-run-plans-PX2XI6EK.js → list-run-plans-6VNHINPY.js} +4 -4
  151. package/dist/{list-scenarios-SSJQEMJP.js → list-scenarios-EQWCW7Q4.js} +4 -4
  152. package/dist/{list-scenarios-QZRPVHS4.js → list-scenarios-GKNH3YND.js} +4 -4
  153. package/dist/{list-simulation-runs-OEADLLQR.js → list-simulation-runs-KHY7KALI.js} +4 -4
  154. package/dist/{list-simulation-runs-KNOLGMDV.js → list-simulation-runs-PUDK32C2.js} +4 -4
  155. package/dist/{list-test-suites-ANAQBLDG.js → list-test-suites-7H2DRILK.js} +4 -4
  156. package/dist/{list-test-suites-N4WVLBKK.js → list-test-suites-GY56LGLY.js} +4 -4
  157. package/dist/{list-trigger-fires-JV3WFYYG.js → list-trigger-fires-7RZUP54Y.js} +4 -4
  158. package/dist/{list-trigger-fires-WTW4DVIW.js → list-trigger-fires-OZUF65LI.js} +4 -4
  159. package/dist/{list-triggers-SQNIG35Q.js → list-triggers-BGUCUXTJ.js} +4 -4
  160. package/dist/{list-triggers-V4Y356AK.js → list-triggers-XC5KMX4C.js} +4 -4
  161. package/dist/{list-workflows-ZHTX5LCL.js → list-workflows-55NYC3PC.js} +4 -4
  162. package/dist/{list-workflows-IMSX7SXU.js → list-workflows-HV7FUWZA.js} +4 -4
  163. package/dist/{rename-prompt-tag-IQI7MHOI.js → rename-prompt-tag-2I7Z5FCY.js} +3 -3
  164. package/dist/{rename-prompt-tag-PA2BRIE6.js → rename-prompt-tag-SZYTOWDX.js} +3 -3
  165. package/dist/{rename-test-suite-4J7UX5S2.js → rename-test-suite-27AYY33K.js} +4 -4
  166. package/dist/{rename-test-suite-NNVLMLKY.js → rename-test-suite-CLIEPZDO.js} +4 -4
  167. package/dist/{report-issue-AS34ZMJF.js → report-issue-5HSL7CNB.js} +28 -2
  168. package/dist/{report-issue-DCZFLGDO.js → report-issue-N7ND5TM6.js} +28 -2
  169. package/dist/{rerun-run-plan-TG2V4WM4.js → rerun-run-plan-O3VUZ6CG.js} +4 -4
  170. package/dist/{rerun-run-plan-ZI5OY3VA.js → rerun-run-plan-OJTVVGJI.js} +4 -4
  171. package/dist/{revoke-api-key-SFMEFWJC.js → revoke-api-key-BU6BKGCG.js} +4 -4
  172. package/dist/{revoke-api-key-3J3ZA4UB.js → revoke-api-key-NZNCFOIR.js} +4 -4
  173. package/dist/{run-agent-W4VJP72Z.js → run-agent-244O4Y5M.js} +4 -4
  174. package/dist/{run-agent-YNV6ZHW4.js → run-agent-HPCGZGYW.js} +4 -4
  175. package/dist/{run-plan-6C77GWG4.js → run-plan-2ZPGGZ4H.js} +4 -4
  176. package/dist/{run-plan-PAARQSI4.js → run-plan-KSXUYQT3.js} +4 -4
  177. package/dist/{run-query-KJDH544C.js → run-query-4LMOQ5UW.js} +4 -4
  178. package/dist/{run-query-T4QW2Z5O.js → run-query-BQUHIUC2.js} +4 -4
  179. package/dist/{run-test-suite-SQJELEZX.js → run-test-suite-P3WLVPXC.js} +4 -4
  180. package/dist/{run-test-suite-STB6NUJM.js → run-test-suite-UEOMCON6.js} +4 -4
  181. package/dist/{run-workflow-SP32SO5M.js → run-workflow-EFZ6HG5B.js} +4 -4
  182. package/dist/{run-workflow-D6PQNBI6.js → run-workflow-I4IHEN54.js} +4 -4
  183. package/dist/{search-traces-HCBGOG6R.js → search-traces-6IR7PR4L.js} +3 -3
  184. package/dist/{search-traces-HSTQ6WTQ.js → search-traces-BYML2NQ4.js} +3 -3
  185. package/dist/{set-model-provider-KDQ7C4EZ.js → set-model-provider-RBNGWFVI.js} +4 -4
  186. package/dist/{set-model-provider-GF7NXUJA.js → set-model-provider-SHEVKWRC.js} +4 -4
  187. package/dist/{update-agent-DWG43T2P.js → update-agent-PTKTM2B5.js} +4 -4
  188. package/dist/{update-agent-MXNOBS4H.js → update-agent-ZPXWRMS2.js} +4 -4
  189. package/dist/update-dashboard-widget-HKCBXH7X.js +62 -0
  190. package/dist/update-dashboard-widget-IP2TTQ5G.js +63 -0
  191. package/dist/{update-dataset-DQH3OHOU.js → update-dataset-GHIN6JR3.js} +4 -4
  192. package/dist/{update-dataset-SQZ6T4WX.js → update-dataset-IRVMY5PF.js} +4 -4
  193. package/dist/{update-dataset-record-7PLDGTMR.js → update-dataset-record-6VI7K2CL.js} +4 -4
  194. package/dist/{update-dataset-record-3AT4IPBC.js → update-dataset-record-Z3L7ACNF.js} +4 -4
  195. package/dist/{update-evaluator-4LFTKFPT.js → update-evaluator-5NLNE6VY.js} +4 -4
  196. package/dist/{update-evaluator-IGTX6PX4.js → update-evaluator-FEH7H6NS.js} +4 -4
  197. package/dist/{update-project-QVHSJRUP.js → update-project-75H3LDQT.js} +4 -4
  198. package/dist/{update-project-PLJIOZS6.js → update-project-QPR3QX55.js} +4 -4
  199. package/dist/{update-prompt-GDKRYJI3.js → update-prompt-BCDFTNLK.js} +3 -3
  200. package/dist/{update-prompt-MY263DYF.js → update-prompt-NPRXYSWA.js} +3 -3
  201. package/dist/{update-scenario-7KA3JDXA.js → update-scenario-BNOMDCMV.js} +4 -4
  202. package/dist/{update-scenario-MOHRQKAQ.js → update-scenario-EM5XGMB7.js} +4 -4
  203. package/package.json +2 -2
  204. package/pyproject.toml +17 -2
  205. package/src/config.d.ts +2 -0
  206. package/src/config.ts +2 -0
  207. package/src/create-mcp-server.ts +148 -41
  208. package/src/langwatch-api-analytics-reports.ts +62 -0
  209. package/src/langwatch-api-dashboard-widgets.ts +3 -68
  210. package/src/langwatch-api-dashboards.ts +110 -28
  211. package/src/langwatch-api-projects.ts +0 -17
  212. package/src/langwatch-api.ts +10 -0
  213. package/src/schemas/widget-sources.ts +33 -0
  214. package/src/tools/add-dashboard-widget.ts +20 -32
  215. package/src/tools/create-analytics-report.ts +7 -0
  216. package/src/tools/dashboard-widget-queries.ts +13 -0
  217. package/src/tools/dashboards.ts +104 -0
  218. package/src/tools/delete-analytics-report.ts +7 -0
  219. package/src/tools/get-analytics-report.ts +23 -0
  220. package/src/tools/list-analytics-reports.ts +27 -0
  221. package/src/tools/list-dashboards.ts +20 -21
  222. package/src/tools/report-issue.ts +2 -0
  223. package/src/tools/run-experiment.ts +5 -1
  224. package/src/tools/update-dashboard-widget.ts +29 -40
  225. package/uv.lock +667 -341
  226. package/dist/add-dashboard-widget-4ZC5UN73.js +0 -50
  227. package/dist/add-dashboard-widget-ACC6QYBG.js +0 -49
  228. package/dist/chunk-5FNCQRCX.js +0 -91
  229. package/dist/chunk-ILZDO25L.js +0 -36
  230. package/dist/chunk-K2I7Z3LZ.js +0 -28
  231. package/dist/create-dashboard-DHVFMEU4.js +0 -18
  232. package/dist/create-dashboard-WTKKS5Z6.js +0 -19
  233. package/dist/delete-dashboard-76N66XXL.js +0 -18
  234. package/dist/delete-dashboard-JVIVHNJM.js +0 -19
  235. package/dist/get-dashboard-5NYJEIX2.js +0 -29
  236. package/dist/get-dashboard-QMTYDQAZ.js +0 -30
  237. package/dist/langwatch-api-dashboards-6EO2VVZW.js +0 -17
  238. package/dist/langwatch-api-dashboards-NHU5BZD7.js +0 -18
  239. package/dist/langwatch-api-workflows-XGJE6SR5.js +0 -15
  240. package/dist/list-dashboard-boards-OPWROHMG.js +0 -33
  241. package/dist/list-dashboard-boards-U2GJ7GC5.js +0 -34
  242. package/dist/list-dashboards-ROSYFLDQ.js +0 -33
  243. package/dist/list-dashboards-RQ635ZU7.js +0 -32
  244. package/dist/update-dashboard-widget-CJKJLCDY.js +0 -71
  245. package/dist/update-dashboard-widget-CYQDS2NR.js +0 -70
  246. package/src/langwatch-api-boards.ts +0 -46
  247. package/src/tools/create-dashboard.ts +0 -7
  248. package/src/tools/dashboard-exists.ts +0 -25
  249. package/src/tools/delete-dashboard.ts +0 -7
  250. package/src/tools/get-dashboard.ts +0 -22
  251. package/src/tools/list-dashboard-boards.ts +0 -28
@@ -31,7 +31,7 @@ var init_package = __esm({
31
31
  "package.json"() {
32
32
  package_default = {
33
33
  name: "@langwatch/mcp-server",
34
- version: "2.2.0",
34
+ version: "3.0.0",
35
35
  description: "An MCP server for Langwatch.",
36
36
  license: "MIT",
37
37
  author: "",
@@ -590,11 +590,15 @@ async function makeRequest(method, path, body) {
590
590
  const url = config.endpoint + path;
591
591
  const headers = {
592
592
  ...MCP_IDENTITY_HEADERS,
593
+ "X-API-Version": LANGWATCH_API_VERSION,
593
594
  "X-Auth-Token": requireApiKey()
594
595
  };
595
596
  if (config.projectId) {
596
597
  headers["X-Project-Id"] = config.projectId;
597
598
  }
599
+ if (config.hosted) {
600
+ headers[HOSTED_MCP_HEADER] = "hosted";
601
+ }
598
602
  if (body !== void 0) {
599
603
  headers["Content-Type"] = "application/json";
600
604
  }
@@ -705,7 +709,7 @@ async function renamePromptTag({
705
709
  async function deletePromptTag(tag) {
706
710
  return makeRequest("DELETE", `/api/v1/prompts/tags/${encodeURIComponent(tag)}`);
707
711
  }
708
- var MCP_IDENTITY_HEADERS, LangWatchApiError, VALID_FAULTS;
712
+ var MCP_IDENTITY_HEADERS, LANGWATCH_API_VERSION, HOSTED_MCP_HEADER, LangWatchApiError, VALID_FAULTS;
709
713
  var init_langwatch_api = __esm({
710
714
  "src/langwatch-api.ts"() {
711
715
  "use strict";
@@ -717,6 +721,8 @@ var init_langwatch_api = __esm({
717
721
  "X-LangWatch-SDK-Language": "typescript",
718
722
  "X-LangWatch-SDK-Version": package_default.version
719
723
  };
724
+ LANGWATCH_API_VERSION = "2026-10-26";
725
+ HOSTED_MCP_HEADER = "X-LangWatch-MCP-Host";
720
726
  LangWatchApiError = class extends Error {
721
727
  constructor(message, status, responseBody, options = {}) {
722
728
  super(message);
@@ -1287,16 +1293,16 @@ async function runAgent({
1287
1293
  async function deleteAgent(id) {
1288
1294
  return makeRequest("DELETE", `/api/v1/agents/${encodeURIComponent(id)}`);
1289
1295
  }
1290
- var import_zod5, agentCallParamsSchema, isMessageList;
1296
+ var import_zod6, agentCallParamsSchema, isMessageList;
1291
1297
  var init_langwatch_api_agents = __esm({
1292
1298
  "src/langwatch-api-agents.ts"() {
1293
1299
  "use strict";
1294
- import_zod5 = require("zod");
1300
+ import_zod6 = require("zod");
1295
1301
  init_langwatch_api();
1296
1302
  init_public_http_request();
1297
- agentCallParamsSchema = import_zod5.z.record(
1298
- import_zod5.z.string(),
1299
- import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()])
1303
+ agentCallParamsSchema = import_zod6.z.record(
1304
+ import_zod6.z.string(),
1305
+ import_zod6.z.union([import_zod6.z.string(), import_zod6.z.number(), import_zod6.z.boolean()])
1300
1306
  );
1301
1307
  isMessageList = (value) => Array.isArray(value) && value.every(
1302
1308
  (item) => typeof item === "object" && item !== null && typeof item.role === "string"
@@ -1509,8 +1515,23 @@ function isKeyShapedBody(body) {
1509
1515
  }
1510
1516
  const { lower, upper, digit } = countCharClasses(body);
1511
1517
  if (lower < 2 || upper < 2 || digit < 2) return false;
1518
+ if (isWordSlug(body)) return false;
1512
1519
  return shannonEntropyBits(body) >= SHAPED_TOKEN_MIN_ENTROPY;
1513
1520
  }
1521
+ function isWordSlug(body) {
1522
+ const segments = body.split(/[-_]/);
1523
+ if (segments.length < SLUG_MIN_SEGMENTS) return false;
1524
+ let words = 0;
1525
+ let randomLooking = 0;
1526
+ for (const segment of segments) {
1527
+ if (!SLUG_LETTERS_SEGMENT.test(segment) && !SLUG_TAG_SEGMENT.test(segment)) {
1528
+ return false;
1529
+ }
1530
+ if (SLUG_WORD_SEGMENT.test(segment)) words += 1;
1531
+ if (SLUG_RANDOM_SEGMENT.test(segment)) randomLooking += 1;
1532
+ }
1533
+ return words >= SLUG_MIN_WORDS && randomLooking <= SLUG_MAX_RANDOM_SEGMENTS;
1534
+ }
1514
1535
  function isNonCredentialPrefix(prefix) {
1515
1536
  const lower = prefix.toLowerCase();
1516
1537
  return DIGEST_PREFIXES.has(lower) || IDENTIFIER_PREFIXES.has(lower) || RECORD_ID_PREFIXES.has(lower) || PUBLIC_KEY_PREFIXES.has(lower);
@@ -1649,7 +1670,7 @@ function redactOneSlice(text, customPatterns, skipped) {
1649
1670
  }
1650
1671
  return { text: result, redactedCount };
1651
1672
  }
1652
- var SECRETS_REDACTION_MARKER, REPLACEMENT, MAX_SCAN_LENGTH, ENTROPY_SAMPLE_LENGTH, TOKEN_START, TOKEN_END, VENDOR_KEY_PATTERNS, VENDOR_KEY_REGEX, SHAPED_TOKEN_MIN_BODY, SHAPED_TOKEN_MAX_BODY, SHAPED_TOKEN_MIN_ENTROPY, DIGEST_PREFIXES, HEX_BODY_CREDENTIAL_SEGMENTS, IDENTIFIER_PREFIXES, RECORD_ID_PREFIXES, PUBLIC_KEY_PREFIXES, HEX_BODY_MIN, HEX_BODY_MAX, PLACEHOLDER_VALUE_REGEX, ENV_REFERENCE_REGEX, CODE_EXPRESSION_REGEX, PATH_LIKE_REGEX, CONTEXT_VALUE_MIN_LENGTH, CONTEXT_VALUE_MIN_ENTROPY, VERSION_STRING_REGEX, LOOSE_VALUE_MIN_LENGTH, LOOSE_VALUE_MIN_ENTROPY, CREDENTIAL_QUALIFIERS, QUALIFIER_ALTERNATION, CREDENTIAL_KEYWORD, VALUE_RULES, BUILTIN_SECRET_RULES, SENSITIVE_KEY_REGEX, CREDENTIAL_NOUNS, VALUE_BOUNDARY, CUSTOM_VALUE_BOUNDARY, SAFE_CUT_LOOKAHEAD, PEM_BEGIN, PEM_END;
1673
+ var SECRETS_REDACTION_MARKER, REPLACEMENT, MAX_SCAN_LENGTH, ENTROPY_SAMPLE_LENGTH, TOKEN_START, TOKEN_END, VENDOR_KEY_PATTERNS, VENDOR_KEY_REGEX, SHAPED_TOKEN_MIN_BODY, SHAPED_TOKEN_MAX_BODY, SHAPED_TOKEN_MIN_ENTROPY, SLUG_MIN_SEGMENTS, SLUG_LETTERS_SEGMENT, SLUG_TAG_SEGMENT, SLUG_WORD_SEGMENT, SLUG_RANDOM_SEGMENT, SLUG_MAX_RANDOM_SEGMENTS, SLUG_MIN_WORDS, DIGEST_PREFIXES, HEX_BODY_CREDENTIAL_SEGMENTS, IDENTIFIER_PREFIXES, RECORD_ID_PREFIXES, PUBLIC_KEY_PREFIXES, HEX_BODY_MIN, HEX_BODY_MAX, PLACEHOLDER_VALUE_REGEX, ENV_REFERENCE_REGEX, CODE_EXPRESSION_REGEX, PATH_LIKE_REGEX, CONTEXT_VALUE_MIN_LENGTH, CONTEXT_VALUE_MIN_ENTROPY, VERSION_STRING_REGEX, LOOSE_VALUE_MIN_LENGTH, LOOSE_VALUE_MIN_ENTROPY, CREDENTIAL_QUALIFIERS, QUALIFIER_ALTERNATION, CREDENTIAL_KEYWORD, VALUE_RULES, BUILTIN_SECRET_RULES, SENSITIVE_KEY_REGEX, CREDENTIAL_NOUNS, VALUE_BOUNDARY, CUSTOM_VALUE_BOUNDARY, SAFE_CUT_LOOKAHEAD, PEM_BEGIN, PEM_END;
1653
1674
  var init_secrets = __esm({
1654
1675
  "../../packages/redaction/src/secrets.ts"() {
1655
1676
  "use strict";
@@ -1715,6 +1736,13 @@ var init_secrets = __esm({
1715
1736
  SHAPED_TOKEN_MIN_BODY = 26;
1716
1737
  SHAPED_TOKEN_MAX_BODY = 120;
1717
1738
  SHAPED_TOKEN_MIN_ENTROPY = 3.9;
1739
+ SLUG_MIN_SEGMENTS = 4;
1740
+ SLUG_LETTERS_SEGMENT = /^[A-Za-z]{1,12}$/;
1741
+ SLUG_TAG_SEGMENT = /^[A-Za-z0-9]{1,6}$/;
1742
+ SLUG_WORD_SEGMENT = /^(?:[a-z]{4,}|[A-Z]{4,}|[A-Z][a-z]{3,})$/;
1743
+ SLUG_RANDOM_SEGMENT = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/;
1744
+ SLUG_MAX_RANDOM_SEGMENTS = 1;
1745
+ SLUG_MIN_WORDS = 2;
1718
1746
  DIGEST_PREFIXES = /* @__PURE__ */ new Set([
1719
1747
  "sha1",
1720
1748
  "sha224",
@@ -2290,6 +2318,7 @@ async function deliverReport(report, params) {
2290
2318
  method: "POST",
2291
2319
  headers: {
2292
2320
  "content-type": "application/json",
2321
+ "x-api-version": LANGWATCH_API_VERSION,
2293
2322
  ...config.apiKey ? { authorization: `Bearer ${config.apiKey}` } : {}
2294
2323
  },
2295
2324
  body: JSON.stringify({
@@ -2342,6 +2371,7 @@ var init_report_issue = __esm({
2342
2371
  "use strict";
2343
2372
  init_src();
2344
2373
  init_config();
2374
+ init_langwatch_api();
2345
2375
  MAX_SESSION_BYTES = 8 * 1024 * 1024;
2346
2376
  REQUEST_TIMEOUT_MS2 = 6e4;
2347
2377
  }
@@ -5240,318 +5270,268 @@ async function handleRunAgent({
5240
5270
  }
5241
5271
  return lines.join("\n");
5242
5272
  }
5243
- var import_zod6, jsonObjectSchema;
5273
+ var import_zod7, jsonObjectSchema;
5244
5274
  var init_run_agent = __esm({
5245
5275
  "src/tools/run-agent.ts"() {
5246
5276
  "use strict";
5247
- import_zod6 = require("zod");
5277
+ import_zod7 = require("zod");
5248
5278
  init_langwatch_api_agents();
5249
- jsonObjectSchema = import_zod6.z.looseObject({});
5279
+ jsonObjectSchema = import_zod7.z.looseObject({});
5250
5280
  }
5251
5281
  });
5252
5282
 
5253
- // src/langwatch-api-dashboards.ts
5254
- var langwatch_api_dashboards_exports = {};
5255
- __export(langwatch_api_dashboards_exports, {
5256
- createDashboard: () => createDashboard,
5257
- deleteDashboard: () => deleteDashboard,
5258
- getDashboard: () => getDashboard,
5259
- listDashboards: () => listDashboards,
5260
- renameDashboard: () => renameDashboard
5283
+ // src/langwatch-api-analytics-reports.ts
5284
+ var langwatch_api_analytics_reports_exports = {};
5285
+ __export(langwatch_api_analytics_reports_exports, {
5286
+ createAnalyticsReport: () => createAnalyticsReport,
5287
+ deleteAnalyticsReport: () => deleteAnalyticsReport,
5288
+ getAnalyticsReport: () => getAnalyticsReport,
5289
+ listAnalyticsReports: () => listAnalyticsReports,
5290
+ renameAnalyticsReport: () => renameAnalyticsReport
5261
5291
  });
5262
- async function listDashboards() {
5263
- return makeRequest("GET", "/api/v1/dashboards");
5292
+ async function listAnalyticsReports() {
5293
+ return makeRequest("GET", "/api/v1/analytics/reports");
5264
5294
  }
5265
- async function getDashboard(id) {
5266
- return makeRequest(
5267
- "GET",
5268
- `/api/v1/dashboards/${encodeURIComponent(id)}`
5269
- );
5295
+ async function getAnalyticsReport({
5296
+ reportId
5297
+ }) {
5298
+ return makeRequest("GET", reportPath(reportId));
5270
5299
  }
5271
- async function createDashboard(data) {
5272
- return makeRequest("POST", "/api/v1/dashboards", data);
5300
+ async function createAnalyticsReport({
5301
+ name
5302
+ }) {
5303
+ return makeRequest("POST", "/api/v1/analytics/reports", {
5304
+ name
5305
+ });
5273
5306
  }
5274
- async function renameDashboard(id, data) {
5275
- return makeRequest(
5276
- "PATCH",
5277
- `/api/v1/dashboards/${encodeURIComponent(id)}`,
5278
- data
5279
- );
5307
+ async function renameAnalyticsReport({
5308
+ reportId,
5309
+ name
5310
+ }) {
5311
+ return makeRequest("PATCH", reportPath(reportId), { name });
5280
5312
  }
5281
- async function deleteDashboard(id) {
5282
- return makeRequest("DELETE", `/api/v1/dashboards/${encodeURIComponent(id)}`);
5313
+ async function deleteAnalyticsReport({
5314
+ reportId
5315
+ }) {
5316
+ return makeRequest("DELETE", reportPath(reportId));
5283
5317
  }
5284
- var init_langwatch_api_dashboards = __esm({
5285
- "src/langwatch-api-dashboards.ts"() {
5318
+ var reportPath;
5319
+ var init_langwatch_api_analytics_reports = __esm({
5320
+ "src/langwatch-api-analytics-reports.ts"() {
5286
5321
  "use strict";
5287
5322
  init_langwatch_api();
5323
+ reportPath = (reportId) => `/api/v1/analytics/reports/${encodeURIComponent(reportId)}`;
5288
5324
  }
5289
5325
  });
5290
5326
 
5291
- // src/tools/list-dashboards.ts
5292
- var list_dashboards_exports = {};
5293
- __export(list_dashboards_exports, {
5294
- handleListDashboards: () => handleListDashboards
5327
+ // src/tools/list-analytics-reports.ts
5328
+ var list_analytics_reports_exports = {};
5329
+ __export(list_analytics_reports_exports, {
5330
+ handleListAnalyticsReports: () => handleListAnalyticsReports
5295
5331
  });
5296
- async function handleListDashboards() {
5297
- const result = await listDashboards();
5298
- const dashboards = result.data;
5299
- if (!Array.isArray(dashboards) || dashboards.length === 0) {
5300
- return "No dashboards found in this project.\n\n> Tip: Use `platform_create_dashboard` to create a new dashboard.";
5332
+ async function handleListAnalyticsReports() {
5333
+ const result = await listAnalyticsReports();
5334
+ const reports = result.data;
5335
+ if (!Array.isArray(reports) || reports.length === 0) {
5336
+ return "No Analytics Reports found in this project.\n\n> Tip: Use `platform_create_analytics_report` to create a new Analytics Report.";
5301
5337
  }
5302
5338
  const lines = [];
5303
- lines.push(`# Dashboards (${dashboards.length} total)
5339
+ lines.push(`# Analytics Reports (${reports.length} total)
5304
5340
  `);
5305
- for (const d of dashboards) {
5306
- lines.push(`## ${d.name}`);
5307
- lines.push(`**ID**: ${d.id}`);
5308
- lines.push(`**Graphs**: ${d.graphCount}`);
5309
- lines.push(`**Updated**: ${d.updatedAt}`);
5341
+ for (const report of reports) {
5342
+ lines.push(`## ${report.name}`);
5343
+ lines.push(`**ID**: ${report.id}`);
5344
+ lines.push(`**Graphs**: ${report.graphCount}`);
5345
+ lines.push(`**Updated**: ${report.updatedAt}`);
5310
5346
  lines.push("");
5311
5347
  }
5312
5348
  lines.push(
5313
- "> Use `platform_get_dashboard` with the ID to see dashboard details including graphs."
5349
+ "> Use `platform_get_analytics_report` with the ID to see the Analytics Report's details including graphs."
5314
5350
  );
5315
5351
  return lines.join("\n");
5316
5352
  }
5317
- var init_list_dashboards = __esm({
5318
- "src/tools/list-dashboards.ts"() {
5353
+ var init_list_analytics_reports = __esm({
5354
+ "src/tools/list-analytics-reports.ts"() {
5319
5355
  "use strict";
5320
- init_langwatch_api_dashboards();
5356
+ init_langwatch_api_analytics_reports();
5321
5357
  }
5322
5358
  });
5323
5359
 
5324
- // src/tools/get-dashboard.ts
5325
- var get_dashboard_exports = {};
5326
- __export(get_dashboard_exports, {
5327
- handleGetDashboard: () => handleGetDashboard
5360
+ // src/tools/get-analytics-report.ts
5361
+ var get_analytics_report_exports = {};
5362
+ __export(get_analytics_report_exports, {
5363
+ handleGetAnalyticsReport: () => handleGetAnalyticsReport
5328
5364
  });
5329
- async function handleGetDashboard(params) {
5330
- const dashboard = await getDashboard(params.id);
5365
+ async function handleGetAnalyticsReport(params) {
5366
+ const report = await getAnalyticsReport({ reportId: params.reportId });
5331
5367
  const lines = [];
5332
- lines.push(`# ${dashboard.name}
5368
+ lines.push(`# ${report.name}
5333
5369
  `);
5334
- lines.push(`**ID**: ${dashboard.id}`);
5335
- lines.push(`**Order**: ${dashboard.order}`);
5336
- lines.push(`**Graphs**: ${Array.isArray(dashboard.graphs) ? dashboard.graphs.length : 0}`);
5337
- lines.push(`**Created**: ${dashboard.createdAt}`);
5338
- lines.push(`**Updated**: ${dashboard.updatedAt}`);
5339
- if (Array.isArray(dashboard.graphs) && dashboard.graphs.length > 0) {
5370
+ lines.push(`**ID**: ${report.id}`);
5371
+ lines.push(`**Order**: ${report.order}`);
5372
+ lines.push(`**Graphs**: ${Array.isArray(report.graphs) ? report.graphs.length : 0}`);
5373
+ lines.push(`**Created**: ${report.createdAt}`);
5374
+ lines.push(`**Updated**: ${report.updatedAt}`);
5375
+ if (Array.isArray(report.graphs) && report.graphs.length > 0) {
5340
5376
  lines.push("\n## Graphs\n");
5341
5377
  lines.push("```json");
5342
- lines.push(JSON.stringify(dashboard.graphs, null, 2));
5378
+ lines.push(JSON.stringify(report.graphs, null, 2));
5343
5379
  lines.push("```");
5344
5380
  }
5345
5381
  return lines.join("\n");
5346
5382
  }
5347
- var init_get_dashboard = __esm({
5348
- "src/tools/get-dashboard.ts"() {
5383
+ var init_get_analytics_report = __esm({
5384
+ "src/tools/get-analytics-report.ts"() {
5349
5385
  "use strict";
5350
- init_langwatch_api_dashboards();
5386
+ init_langwatch_api_analytics_reports();
5351
5387
  }
5352
5388
  });
5353
5389
 
5354
- // src/tools/create-dashboard.ts
5355
- var create_dashboard_exports = {};
5356
- __export(create_dashboard_exports, {
5357
- handleCreateDashboard: () => handleCreateDashboard
5390
+ // src/tools/create-analytics-report.ts
5391
+ var create_analytics_report_exports = {};
5392
+ __export(create_analytics_report_exports, {
5393
+ handleCreateAnalyticsReport: () => handleCreateAnalyticsReport
5358
5394
  });
5359
- async function handleCreateDashboard(params) {
5360
- const dashboard = await createDashboard({ name: params.name });
5361
- return `Dashboard created successfully!
5395
+ async function handleCreateAnalyticsReport(params) {
5396
+ const report = await createAnalyticsReport({ name: params.name });
5397
+ return `Analytics Report created successfully!
5362
5398
 
5363
- **Name**: ${dashboard.name}
5364
- **ID**: ${dashboard.id}`;
5399
+ **Name**: ${report.name}
5400
+ **ID**: ${report.id}`;
5365
5401
  }
5366
- var init_create_dashboard = __esm({
5367
- "src/tools/create-dashboard.ts"() {
5402
+ var init_create_analytics_report = __esm({
5403
+ "src/tools/create-analytics-report.ts"() {
5368
5404
  "use strict";
5369
- init_langwatch_api_dashboards();
5405
+ init_langwatch_api_analytics_reports();
5370
5406
  }
5371
5407
  });
5372
5408
 
5373
- // src/tools/delete-dashboard.ts
5374
- var delete_dashboard_exports = {};
5375
- __export(delete_dashboard_exports, {
5376
- handleDeleteDashboard: () => handleDeleteDashboard
5409
+ // src/tools/delete-analytics-report.ts
5410
+ var delete_analytics_report_exports = {};
5411
+ __export(delete_analytics_report_exports, {
5412
+ handleDeleteAnalyticsReport: () => handleDeleteAnalyticsReport
5377
5413
  });
5378
- async function handleDeleteDashboard(params) {
5379
- const result = await deleteDashboard(params.id);
5380
- return `Dashboard deleted successfully!
5414
+ async function handleDeleteAnalyticsReport(params) {
5415
+ const result = await deleteAnalyticsReport({ reportId: params.reportId });
5416
+ return `Analytics Report deleted successfully!
5381
5417
 
5382
5418
  **Name**: ${result.name}
5383
5419
  **ID**: ${result.id}`;
5384
5420
  }
5385
- var init_delete_dashboard = __esm({
5386
- "src/tools/delete-dashboard.ts"() {
5421
+ var init_delete_analytics_report = __esm({
5422
+ "src/tools/delete-analytics-report.ts"() {
5387
5423
  "use strict";
5388
- init_langwatch_api_dashboards();
5424
+ init_langwatch_api_analytics_reports();
5389
5425
  }
5390
5426
  });
5391
5427
 
5392
- // src/langwatch-api-boards.ts
5393
- async function listBoards({
5394
- projectId: projectId2
5428
+ // src/langwatch-api-dashboards.ts
5429
+ async function listDashboards() {
5430
+ return makeRequest("GET", "/api/v1/dashboards");
5431
+ }
5432
+ async function getDashboard({ dashboardId }) {
5433
+ return makeRequest("GET", dashboardPath(dashboardId));
5434
+ }
5435
+ async function createDashboard({ name }) {
5436
+ return makeRequest("POST", "/api/v1/dashboards", { name });
5437
+ }
5438
+ async function updateDashboard({
5439
+ dashboardId,
5440
+ ...changes
5395
5441
  }) {
5396
- return makeRequest(
5397
- "GET",
5398
- `/api/v1/projects/${encodeURIComponent(projectId2)}/analytics/boards`
5399
- );
5442
+ return makeRequest("PATCH", dashboardPath(dashboardId), changes);
5400
5443
  }
5401
- async function getBoard({
5402
- projectId: projectId2,
5403
- boardId
5444
+ async function deleteDashboard({
5445
+ dashboardId
5404
5446
  }) {
5405
- return makeRequest(
5406
- "GET",
5407
- `/api/v1/projects/${encodeURIComponent(projectId2)}/analytics/boards/${encodeURIComponent(boardId)}`
5408
- );
5447
+ return makeRequest("DELETE", dashboardPath(dashboardId));
5409
5448
  }
5410
- var init_langwatch_api_boards = __esm({
5411
- "src/langwatch-api-boards.ts"() {
5412
- "use strict";
5413
- init_langwatch_api();
5414
- }
5415
- });
5416
-
5417
- // src/langwatch-api-projects.ts
5418
- async function listProjects(params) {
5419
- const query = new URLSearchParams();
5420
- if (params?.page) query.set("page", String(params.page));
5421
- if (params?.limit) query.set("limit", String(params.limit));
5422
- const qs = query.toString() ? `?${query}` : "";
5423
- return makeRequest("GET", `/api/v1/projects${qs}`);
5449
+ async function listWidgetsOnDashboard({
5450
+ dashboardId
5451
+ }) {
5452
+ return makeRequest("GET", `${dashboardPath(dashboardId)}/widgets`);
5424
5453
  }
5425
- async function getProject(id) {
5454
+ async function createWidgetOnDashboard({
5455
+ dashboardId,
5456
+ ...data
5457
+ }) {
5426
5458
  return makeRequest(
5427
- "GET",
5428
- `/api/v1/projects/${encodeURIComponent(id)}`
5459
+ "POST",
5460
+ `${dashboardPath(dashboardId)}/widgets`,
5461
+ data
5429
5462
  );
5430
5463
  }
5431
- async function getCurrentProject() {
5432
- return makeRequest("GET", "/api/v1/me/project");
5433
- }
5434
- async function createProject(data) {
5435
- return makeRequest("POST", "/api/v1/projects", data);
5464
+ async function getWidgetOnDashboard({
5465
+ dashboardId,
5466
+ widgetId
5467
+ }) {
5468
+ return makeRequest("GET", widgetPath(dashboardId, widgetId));
5436
5469
  }
5437
- async function updateProject(params) {
5438
- const { id, ...data } = params;
5470
+ async function updateWidgetOnDashboard({
5471
+ dashboardId,
5472
+ widgetId,
5473
+ ...changes
5474
+ }) {
5439
5475
  return makeRequest(
5440
5476
  "PATCH",
5441
- `/api/v1/projects/${encodeURIComponent(id)}`,
5442
- data
5477
+ widgetPath(dashboardId, widgetId),
5478
+ changes
5443
5479
  );
5444
5480
  }
5445
- async function archiveProject(id) {
5446
- return makeRequest("DELETE", `/api/v1/projects/${encodeURIComponent(id)}`);
5481
+ async function deleteWidgetOnDashboard({
5482
+ dashboardId,
5483
+ widgetId
5484
+ }) {
5485
+ await makeRequest("DELETE", widgetPath(dashboardId, widgetId));
5447
5486
  }
5448
- var init_langwatch_api_projects = __esm({
5449
- "src/langwatch-api-projects.ts"() {
5487
+ var dashboardPath, widgetPath;
5488
+ var init_langwatch_api_dashboards = __esm({
5489
+ "src/langwatch-api-dashboards.ts"() {
5450
5490
  "use strict";
5451
5491
  init_langwatch_api();
5492
+ dashboardPath = (dashboardId) => `/api/v1/dashboards/${encodeURIComponent(dashboardId)}`;
5493
+ widgetPath = (dashboardId, widgetId) => `${dashboardPath(dashboardId)}/widgets/${encodeURIComponent(widgetId)}`;
5452
5494
  }
5453
5495
  });
5454
5496
 
5455
- // src/tools/list-dashboard-boards.ts
5456
- var list_dashboard_boards_exports = {};
5457
- __export(list_dashboard_boards_exports, {
5458
- handleListDashboardBoards: () => handleListDashboardBoards
5497
+ // src/tools/list-dashboards.ts
5498
+ var list_dashboards_exports = {};
5499
+ __export(list_dashboards_exports, {
5500
+ handleListDashboards: () => handleListDashboards
5459
5501
  });
5460
- async function handleListDashboardBoards() {
5461
- const project = await getCurrentProject();
5462
- const { data: boards } = await listBoards({ projectId: project.id });
5463
- if (boards.length === 0) {
5502
+ async function handleListDashboards() {
5503
+ const { data: dashboards } = await listDashboards();
5504
+ if (dashboards.length === 0) {
5464
5505
  return "No dashboards found in this project. Create one in the Dashboards area first.";
5465
5506
  }
5466
5507
  return [
5467
- `# Dashboards (${boards.length} total)
5508
+ `# Dashboards (${dashboards.length} total)
5468
5509
  `,
5469
- ...boards.flatMap((board) => [
5470
- `## ${board.name}`,
5471
- `**ID**: ${board.id}`,
5472
- `**Widgets**: ${board.widgetCount}`,
5473
- `**URL**: ${board.platformUrl}`,
5510
+ ...dashboards.flatMap((dashboard) => [
5511
+ `## ${dashboard.name}`,
5512
+ `**ID**: ${dashboard.id}`,
5513
+ `**Widgets**: ${dashboard.widgetCount}`,
5514
+ `**URL**: ${dashboard.platformUrl}`,
5474
5515
  ""
5475
5516
  ]),
5476
5517
  "> Pass the ID to `add_dashboard_widget` to add a widget to that dashboard."
5477
5518
  ].join("\n");
5478
5519
  }
5479
- var init_list_dashboard_boards = __esm({
5480
- "src/tools/list-dashboard-boards.ts"() {
5481
- "use strict";
5482
- init_langwatch_api_boards();
5483
- init_langwatch_api_projects();
5484
- }
5485
- });
5486
-
5487
- // src/langwatch-api-dashboard-widgets.ts
5488
- async function createDashboardWidget(params) {
5489
- const { projectId: projectId2, ...data } = params;
5490
- return makeRequest(
5491
- "POST",
5492
- `/api/v1/projects/${encodeURIComponent(projectId2)}/analytics/dashboard-widgets`,
5493
- data
5494
- );
5495
- }
5496
- async function getDashboardWidget(params) {
5497
- return makeRequest(
5498
- "GET",
5499
- `/api/v1/projects/${encodeURIComponent(params.projectId)}/analytics/dashboard-widgets/${encodeURIComponent(params.widgetId)}`
5500
- );
5501
- }
5502
- async function updateDashboardWidget(params) {
5503
- const { projectId: projectId2, widgetId, ...data } = params;
5504
- return makeRequest(
5505
- "PATCH",
5506
- `/api/v1/projects/${encodeURIComponent(projectId2)}/analytics/dashboard-widgets/${encodeURIComponent(widgetId)}`,
5507
- data
5508
- );
5509
- }
5510
- async function assignDashboardWidgetToDashboard(params) {
5511
- return makeRequest(
5512
- "POST",
5513
- `/api/v1/projects/${encodeURIComponent(params.projectId)}/analytics/dashboard-widgets/${encodeURIComponent(params.widgetId)}/dashboard`,
5514
- { dashboardId: params.dashboardId }
5515
- );
5516
- }
5517
- async function deleteDashboardWidget(params) {
5518
- await makeRequest(
5519
- "DELETE",
5520
- `/api/v1/projects/${encodeURIComponent(params.projectId)}/analytics/dashboard-widgets/${encodeURIComponent(params.widgetId)}`
5521
- );
5522
- }
5523
- var init_langwatch_api_dashboard_widgets = __esm({
5524
- "src/langwatch-api-dashboard-widgets.ts"() {
5520
+ var init_list_dashboards = __esm({
5521
+ "src/tools/list-dashboards.ts"() {
5525
5522
  "use strict";
5526
- init_langwatch_api();
5523
+ init_langwatch_api_dashboards();
5527
5524
  }
5528
5525
  });
5529
5526
 
5530
- // src/tools/dashboard-exists.ts
5531
- async function assertDashboardExists({
5532
- projectId: projectId2,
5533
- dashboardId
5527
+ // src/tools/dashboard-widget-queries.ts
5528
+ function withSources({
5529
+ queries,
5530
+ sources
5534
5531
  }) {
5535
- try {
5536
- await getBoard({ projectId: projectId2, boardId: dashboardId });
5537
- } catch (error) {
5538
- if (error instanceof LangWatchApiError && error.status === 404) {
5539
- throw new Error(
5540
- `No dashboard with ID "${dashboardId}" was found in this project. Use list_dashboard_boards to find a valid dashboard ID.`
5541
- );
5542
- }
5543
- throw error;
5544
- }
5532
+ if (sources === void 0) return [...queries];
5533
+ return queries.map((query) => ({ ...query, sources }));
5545
5534
  }
5546
- var init_dashboard_exists = __esm({
5547
- "src/tools/dashboard-exists.ts"() {
5548
- "use strict";
5549
- init_langwatch_api_boards();
5550
- init_langwatch_api();
5551
- }
5552
- });
5553
-
5554
- // src/tools/dashboard-widget-queries.ts
5555
5535
  function normalizeDashboardWidgetQueries({
5556
5536
  queries
5557
5537
  }) {
@@ -5582,27 +5562,24 @@ __export(add_dashboard_widget_exports, {
5582
5562
  handleAddDashboardWidget: () => handleAddDashboardWidget
5583
5563
  });
5584
5564
  async function handleAddDashboardWidget(params) {
5585
- const queries = normalizeDashboardWidgetQueries({ queries: params.queries });
5586
- const project = await getCurrentProject();
5587
- await assertDashboardExists({ projectId: project.id, dashboardId: params.dashboardId });
5588
- const widget = await createDashboardWidget({
5589
- projectId: project.id,
5590
- name: params.name,
5591
- code: params.code,
5592
- queries
5565
+ const queries = withSources({
5566
+ queries: normalizeDashboardWidgetQueries({ queries: params.queries }),
5567
+ sources: params.sources
5593
5568
  });
5569
+ let widget;
5594
5570
  try {
5595
- await assignDashboardWidgetToDashboard({
5596
- projectId: project.id,
5597
- widgetId: widget.id,
5598
- dashboardId: params.dashboardId
5571
+ widget = await createWidgetOnDashboard({
5572
+ dashboardId: params.dashboardId,
5573
+ name: params.name,
5574
+ code: params.code,
5575
+ queries
5599
5576
  });
5600
5577
  } catch (error) {
5601
- await deleteDashboardWidget({
5602
- projectId: project.id,
5603
- widgetId: widget.id
5604
- }).catch(() => {
5605
- });
5578
+ if (error instanceof LangWatchApiError && error.status === 404) {
5579
+ throw new Error(
5580
+ `No dashboard with ID "${params.dashboardId}" was found in this project. Use list_dashboards to find a valid dashboard ID.`
5581
+ );
5582
+ }
5606
5583
  throw error;
5607
5584
  }
5608
5585
  return [
@@ -5614,9 +5591,8 @@ async function handleAddDashboardWidget(params) {
5614
5591
  var init_add_dashboard_widget = __esm({
5615
5592
  "src/tools/add-dashboard-widget.ts"() {
5616
5593
  "use strict";
5617
- init_langwatch_api_dashboard_widgets();
5618
- init_langwatch_api_projects();
5619
- init_dashboard_exists();
5594
+ init_langwatch_api_dashboards();
5595
+ init_langwatch_api();
5620
5596
  init_dashboard_widget_queries();
5621
5597
  }
5622
5598
  });
@@ -5627,22 +5603,24 @@ __export(update_dashboard_widget_exports, {
5627
5603
  handleUpdateDashboardWidget: () => handleUpdateDashboardWidget
5628
5604
  });
5629
5605
  async function handleUpdateDashboardWidget(params) {
5630
- const { dashboardId, widgetId, name, code, description } = params;
5631
- if (name === void 0 && code === void 0 && params.queries === void 0 && description === void 0) {
5632
- throw new Error("Provide at least one of name, code, queries or description to change.");
5633
- }
5634
- const queries = params.queries === void 0 ? void 0 : normalizeDashboardWidgetQueries({ queries: params.queries });
5635
- const project = await getCurrentProject();
5636
- await assertDashboardExists({ projectId: project.id, dashboardId });
5637
- const current = await getWidgetOnDashboard({ projectId: project.id, widgetId, dashboardId });
5638
- const widget = await updateDashboardWidget({
5639
- projectId: project.id,
5640
- widgetId: current.id,
5606
+ const { dashboardId, widgetId, name, code, description, sources } = params;
5607
+ const fields = [name, code, params.queries, description, sources];
5608
+ if (fields.every((field) => field === void 0)) {
5609
+ throw new Error(
5610
+ "Provide at least one of name, code, queries, description or sources to change."
5611
+ );
5612
+ }
5613
+ const current = await widgetOnDashboardOrRefused({ widgetId, dashboardId });
5614
+ const given = params.queries === void 0 ? void 0 : normalizeDashboardWidgetQueries({ queries: params.queries });
5615
+ const base = given ?? (sources === void 0 ? void 0 : current.definition.queries);
5616
+ const queries = base === void 0 ? void 0 : withSources({ queries: base, sources });
5617
+ const changes = {
5641
5618
  ...name === void 0 ? {} : { name },
5642
5619
  ...code === void 0 ? {} : { code },
5643
5620
  ...queries === void 0 ? {} : { queries },
5644
5621
  ...description === void 0 ? {} : { description }
5645
- });
5622
+ };
5623
+ const widget = await updateWidgetOnDashboard({ dashboardId, widgetId: current.id, ...changes });
5646
5624
  return [
5647
5625
  `Widget "${widget.name}" updated on dashboard "${dashboardId}".`,
5648
5626
  `**Widget ID**: ${widget.id}`,
@@ -5653,40 +5631,116 @@ async function handleUpdateDashboardWidget(params) {
5653
5631
  "```"
5654
5632
  ].join("\n");
5655
5633
  }
5656
- async function getWidgetOnDashboard({
5657
- projectId: projectId2,
5634
+ async function widgetOnDashboardOrRefused({
5658
5635
  widgetId,
5659
5636
  dashboardId
5660
5637
  }) {
5661
- let widget;
5662
5638
  try {
5663
- widget = await getDashboardWidget({ projectId: projectId2, widgetId });
5639
+ return await getWidgetOnDashboard({ dashboardId, widgetId });
5664
5640
  } catch (error) {
5665
5641
  if (error instanceof LangWatchApiError && error.status === 404) {
5666
5642
  throw new Error(
5667
- `No widget with ID "${widgetId}" was found in this project. Use the widget ID add_dashboard_widget returned.`
5643
+ `No widget with ID "${widgetId}" was found on dashboard "${dashboardId}". Use the widget ID add_dashboard_widget returned, and the dashboard it was added to.`
5668
5644
  );
5669
5645
  }
5670
5646
  throw error;
5671
5647
  }
5672
- if (widget.dashboardId !== dashboardId) {
5673
- throw new Error(
5674
- `Widget "${widgetId}" is not on dashboard "${dashboardId}". Pass the dashboard the widget was added to.`
5675
- );
5676
- }
5677
- return widget;
5678
5648
  }
5679
5649
  var init_update_dashboard_widget = __esm({
5680
5650
  "src/tools/update-dashboard-widget.ts"() {
5681
5651
  "use strict";
5682
- init_langwatch_api_dashboard_widgets();
5683
- init_langwatch_api_projects();
5652
+ init_langwatch_api_dashboards();
5684
5653
  init_langwatch_api();
5685
- init_dashboard_exists();
5686
5654
  init_dashboard_widget_queries();
5687
5655
  }
5688
5656
  });
5689
5657
 
5658
+ // src/tools/dashboards.ts
5659
+ var dashboards_exports = {};
5660
+ __export(dashboards_exports, {
5661
+ handleCreateDashboard: () => handleCreateDashboard,
5662
+ handleDeleteDashboard: () => handleDeleteDashboard,
5663
+ handleDeleteDashboardWidget: () => handleDeleteDashboardWidget,
5664
+ handleGetDashboard: () => handleGetDashboard,
5665
+ handleListDashboardWidgets: () => handleListDashboardWidgets,
5666
+ handleRenameDashboard: () => handleRenameDashboard
5667
+ });
5668
+ function describeDashboard(dashboard) {
5669
+ return [
5670
+ `**Name**: ${dashboard.name}`,
5671
+ `**ID**: ${dashboard.id}`,
5672
+ `**Scope**: ${dashboard.scope}`,
5673
+ ...dashboard.description ? [`**Description**: ${dashboard.description}`] : [],
5674
+ `**URL**: ${dashboard.platformUrl}`
5675
+ ];
5676
+ }
5677
+ async function handleGetDashboard({
5678
+ dashboardId
5679
+ }) {
5680
+ const dashboard = await getDashboard({ dashboardId });
5681
+ return [`# ${dashboard.name}
5682
+ `, ...describeDashboard(dashboard)].join("\n");
5683
+ }
5684
+ async function handleCreateDashboard({ name }) {
5685
+ const dashboard = await createDashboard({ name });
5686
+ return [
5687
+ "Dashboard created.\n",
5688
+ ...describeDashboard(dashboard),
5689
+ "",
5690
+ "> Pass the ID to `add_dashboard_widget` to add a widget to it."
5691
+ ].join("\n");
5692
+ }
5693
+ async function handleRenameDashboard({
5694
+ dashboardId,
5695
+ name,
5696
+ description
5697
+ }) {
5698
+ if (name === void 0 && description === void 0) {
5699
+ throw new Error("Provide at least one of name or description to change.");
5700
+ }
5701
+ const dashboard = await updateDashboard({
5702
+ dashboardId,
5703
+ ...name === void 0 ? {} : { name },
5704
+ ...description === void 0 ? {} : { description }
5705
+ });
5706
+ return ["Dashboard updated.\n", ...describeDashboard(dashboard)].join("\n");
5707
+ }
5708
+ async function handleDeleteDashboard({
5709
+ dashboardId
5710
+ }) {
5711
+ const deleted = await deleteDashboard({ dashboardId });
5712
+ return `Dashboard "${deleted.name}" deleted with its widgets (ID: ${deleted.id}).`;
5713
+ }
5714
+ async function handleListDashboardWidgets({
5715
+ dashboardId
5716
+ }) {
5717
+ const { data: widgets } = await listWidgetsOnDashboard({ dashboardId });
5718
+ if (widgets.length === 0) return `Dashboard "${dashboardId}" has no widgets.`;
5719
+ return [
5720
+ `# Widgets on dashboard ${dashboardId} (${widgets.length} total)
5721
+ `,
5722
+ ...widgets.flatMap((widget) => [
5723
+ `## ${widget.name}`,
5724
+ `**ID**: ${widget.id}`,
5725
+ `**Queries**: ${widget.definition.queries.map((query) => query.name).join(", ") || "(none)"}`,
5726
+ ""
5727
+ ])
5728
+ ].join("\n");
5729
+ }
5730
+ async function handleDeleteDashboardWidget({
5731
+ dashboardId,
5732
+ widgetId
5733
+ }) {
5734
+ await deleteWidgetOnDashboard({ dashboardId, widgetId });
5735
+ return `Widget "${widgetId}" deleted from dashboard "${dashboardId}".`;
5736
+ }
5737
+ var init_dashboards = __esm({
5738
+ "src/tools/dashboards.ts"() {
5739
+ "use strict";
5740
+ init_langwatch_api_dashboards();
5741
+ }
5742
+ });
5743
+
5690
5744
  // src/tools/list-workflows.ts
5691
5745
  var list_workflows_exports = {};
5692
5746
  __export(list_workflows_exports, {
@@ -5938,7 +5992,7 @@ __export(langwatch_api_triggers_exports, {
5938
5992
  updateTrigger: () => updateTrigger
5939
5993
  });
5940
5994
  async function listTriggers() {
5941
- return import_zod7.z.array(triggerSchema).parse(await makeRequest("GET", "/api/v1/triggers"));
5995
+ return import_zod8.z.array(triggerSchema).parse(await makeRequest("GET", "/api/v1/triggers"));
5942
5996
  }
5943
5997
  async function getTrigger(id) {
5944
5998
  return triggerSchema.parse(
@@ -5981,11 +6035,11 @@ async function deleteTrigger(id) {
5981
6035
  await makeRequest("DELETE", `/api/v1/triggers/${encodeURIComponent(id)}`)
5982
6036
  );
5983
6037
  }
5984
- var import_zod7;
6038
+ var import_zod8;
5985
6039
  var init_langwatch_api_triggers = __esm({
5986
6040
  "src/langwatch-api-triggers.ts"() {
5987
6041
  "use strict";
5988
- import_zod7 = require("zod");
6042
+ import_zod8 = require("zod");
5989
6043
  init_langwatch_api();
5990
6044
  init_triggers();
5991
6045
  }
@@ -6620,6 +6674,41 @@ var init_delete_dataset_records = __esm({
6620
6674
  }
6621
6675
  });
6622
6676
 
6677
+ // src/langwatch-api-projects.ts
6678
+ async function listProjects(params) {
6679
+ const query = new URLSearchParams();
6680
+ if (params?.page) query.set("page", String(params.page));
6681
+ if (params?.limit) query.set("limit", String(params.limit));
6682
+ const qs = query.toString() ? `?${query}` : "";
6683
+ return makeRequest("GET", `/api/v1/projects${qs}`);
6684
+ }
6685
+ async function getProject(id) {
6686
+ return makeRequest(
6687
+ "GET",
6688
+ `/api/v1/projects/${encodeURIComponent(id)}`
6689
+ );
6690
+ }
6691
+ async function createProject(data) {
6692
+ return makeRequest("POST", "/api/v1/projects", data);
6693
+ }
6694
+ async function updateProject(params) {
6695
+ const { id, ...data } = params;
6696
+ return makeRequest(
6697
+ "PATCH",
6698
+ `/api/v1/projects/${encodeURIComponent(id)}`,
6699
+ data
6700
+ );
6701
+ }
6702
+ async function archiveProject(id) {
6703
+ return makeRequest("DELETE", `/api/v1/projects/${encodeURIComponent(id)}`);
6704
+ }
6705
+ var init_langwatch_api_projects = __esm({
6706
+ "src/langwatch-api-projects.ts"() {
6707
+ "use strict";
6708
+ init_langwatch_api();
6709
+ }
6710
+ });
6711
+
6623
6712
  // src/tools/list-projects.ts
6624
6713
  var list_projects_exports = {};
6625
6714
  __export(list_projects_exports, {
@@ -6886,7 +6975,7 @@ __export(create_mcp_server_exports, {
6886
6975
  });
6887
6976
  module.exports = __toCommonJS(create_mcp_server_exports);
6888
6977
  var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
6889
- var import_zod8 = require("zod");
6978
+ var import_zod9 = require("zod");
6890
6979
  init_package();
6891
6980
  init_config();
6892
6981
 
@@ -7008,6 +7097,25 @@ init_run_plan();
7008
7097
  init_suite_fields();
7009
7098
  init_triggers();
7010
7099
 
7100
+ // src/schemas/widget-sources.ts
7101
+ var import_zod5 = require("zod");
7102
+ var WIDGET_SOURCES = [
7103
+ "application",
7104
+ "simulation",
7105
+ "evaluation",
7106
+ "sample",
7107
+ "coding_agent",
7108
+ "ai_tool",
7109
+ "gateway",
7110
+ "workflow",
7111
+ "playground",
7112
+ "langy",
7113
+ "other"
7114
+ ];
7115
+ var widgetSourcesInput = import_zod5.z.array(import_zod5.z.enum(WIDGET_SOURCES)).max(WIDGET_SOURCES.length).nullable().optional().describe(
7116
+ `The trace origins every query of the widget counts: any of ${WIDGET_SOURCES.join(", ")} (other = any origin not listed). A new widget counts ["application"]; add "langy" to count your own conversations, as a widget about Langy's requests needs. null makes it unset again, counting the default.`
7117
+ );
7118
+
7011
7119
  // src/tools/get-experiment-results.ts
7012
7120
  init_langwatch_api();
7013
7121
 
@@ -7393,7 +7501,8 @@ init_langwatch_api();
7393
7501
  async function handleRunExperiment(params) {
7394
7502
  const result = await makeRequest(
7395
7503
  "POST",
7396
- `/api/v1/experiments/${encodeURIComponent(params.slug)}/run`
7504
+ `/api/v1/experiments/${encodeURIComponent(params.slug)}/run`,
7505
+ params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
7397
7506
  );
7398
7507
  const lines = [];
7399
7508
  lines.push(`Evaluation started!
@@ -7548,8 +7657,8 @@ async function handleUpdateTestSuite(params) {
7548
7657
  }
7549
7658
 
7550
7659
  // src/create-mcp-server.ts
7551
- var modelSchema = import_zod8.z.string().describe(
7552
- 'Model in "provider/model-name" format, e.g., "openai/gpt-4o", "anthropic/claude-sonnet-4-5-20250929"'
7660
+ var modelSchema = import_zod9.z.string().describe(
7661
+ 'Model in "provider/model-name" format, e.g., "openai/gpt-6-luna", "anthropic/claude-sonnet-4-5-20250929"'
7553
7662
  );
7554
7663
  function createMcpServer() {
7555
7664
  const server = new import_mcp.McpServer({
@@ -7584,6 +7693,7 @@ function registerTools(server) {
7584
7693
  registerEvaluatorTools(server);
7585
7694
  registerModelProviderTools(server);
7586
7695
  registerAgentTools(server);
7696
+ registerAnalyticsReportTools(server);
7587
7697
  registerDashboardTools(server);
7588
7698
  registerWorkflowTools(server);
7589
7699
  registerAnnotationTools(server);
@@ -7600,7 +7710,7 @@ function registerDocsTools(server) {
7600
7710
  "fetch_langwatch_docs",
7601
7711
  "Fetches the LangWatch docs for understanding how to implement LangWatch in your codebase. Always use this tool when the user asks for help with LangWatch. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension",
7602
7712
  {
7603
- url: import_zod8.z.string().optional().describe(
7713
+ url: import_zod9.z.string().optional().describe(
7604
7714
  "The full url of the specific doc page. If not provided, the docs index will be fetched."
7605
7715
  )
7606
7716
  },
@@ -7613,18 +7723,18 @@ function registerDocsTools(server) {
7613
7723
  "report_issue",
7614
7724
  "Report an issue to the LangWatch team: anything that did not work, confused you, or took trial and error while using LangWatch (docs, MCP tools, CLI, SDKs, the platform). Use it whenever you struggled, it is how rough edges get fixed for every agent. Ask the user for permission first, then call with user_approved=true. Works without an API key. Put VERBATIM error messages in the summary; optionally attach raw session content. Secrets, API keys, emails and phone numbers are redacted locally before anything is sent.",
7615
7725
  {
7616
- user_approved: import_zod8.z.boolean().describe(
7726
+ user_approved: import_zod9.z.boolean().describe(
7617
7727
  "Must be true, and only after the user explicitly agreed to send this report to LangWatch"
7618
7728
  ),
7619
- title: import_zod8.z.string().max(300).describe("One-line description of the issue"),
7620
- summary: import_zod8.z.string().optional().describe(
7729
+ title: import_zod9.z.string().max(300).describe("One-line description of the issue"),
7730
+ summary: import_zod9.z.string().optional().describe(
7621
7731
  "What you were trying to do, what went wrong (verbatim errors), and what you had to figure out the hard way"
7622
7732
  ),
7623
- session_content: import_zod8.z.string().optional().describe(
7733
+ session_content: import_zod9.z.string().optional().describe(
7624
7734
  "Optional raw session transcript or log excerpt (JSONL or plain text); redacted locally before sending"
7625
7735
  ),
7626
- contact_email: import_zod8.z.string().optional().describe("Optional contact email for follow-up"),
7627
- agent: import_zod8.z.string().optional().describe("Which coding agent this is, e.g. claude-code, codex, cursor")
7736
+ contact_email: import_zod9.z.string().optional().describe("Optional contact email for follow-up"),
7737
+ agent: import_zod9.z.string().optional().describe("Which coding agent this is, e.g. claude-code, codex, cursor")
7628
7738
  },
7629
7739
  withToolLogging("report_issue", async (params) => {
7630
7740
  const { handleReportIssue: handleReportIssue2 } = await Promise.resolve().then(() => (init_report_issue(), report_issue_exports));
@@ -7637,7 +7747,7 @@ function registerDocsTools(server) {
7637
7747
  "fetch_scenario_docs",
7638
7748
  "Fetches the Scenario docs for understanding how to implement Scenario agent tests in your codebase. Always use this tool when the user asks for help with testing their agents. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension",
7639
7749
  {
7640
- url: import_zod8.z.string().optional().describe(
7750
+ url: import_zod9.z.string().optional().describe(
7641
7751
  "The full url of the specific doc page. If not provided, the docs index will be fetched."
7642
7752
  )
7643
7753
  },
@@ -7652,7 +7762,7 @@ function registerObservabilityTools(server) {
7652
7762
  "discover_schema",
7653
7763
  "Discover what LangWatch can be queried with: the trace filter fields and syntax, the analytics SQL views and columns, the analytics metrics, aggregation types, group-by options, scenario schema and evaluator types. Call this before using search_traces, run_query, get_analytics, scenario tools or evaluator tools, so you never guess a field, a column or a value.",
7654
7764
  {
7655
- category: import_zod8.z.enum([
7765
+ category: import_zod9.z.enum([
7656
7766
  "filters",
7657
7767
  "lwql",
7658
7768
  "metrics",
@@ -7664,7 +7774,7 @@ function registerObservabilityTools(server) {
7664
7774
  ]).describe(
7665
7775
  "Which schema category to discover. 'filters' is the trace filter language, 'lwql' the analytics SQL views; both are read from the platform and need the API key"
7666
7776
  ),
7667
- evaluatorType: import_zod8.z.string().optional().describe(
7777
+ evaluatorType: import_zod9.z.string().optional().describe(
7668
7778
  "When category is 'evaluators', provide a specific evaluator type (e.g. 'langevals/llm_boolean') to get its full schema details"
7669
7779
  )
7670
7780
  },
@@ -7697,10 +7807,10 @@ function registerObservabilityTools(server) {
7697
7807
  "run_query",
7698
7808
  "Run one read-only analytics SQL statement (LangWatchQL) over this project's traces, spans, evaluations and metrics, and get the rows back as a table. This is the tool for a count, a rate, a sum, a percentile or any of them grouped or over time \u2014 questions search_traces would need many calls to answer. The statement runs exactly as written. Call discover_schema with category 'lwql' first for the views, columns and worked statements.",
7699
7809
  {
7700
- sql: import_zod8.z.string().describe(
7810
+ sql: import_zod9.z.string().describe(
7701
7811
  "The SELECT to run. Filter on the dataset's time column so the read is bounded, and never select a whole attribute map"
7702
7812
  ),
7703
- parameters: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.union([import_zod8.z.string(), import_zod8.z.number(), import_zod8.z.boolean(), import_zod8.z.null()])).optional().describe(
7813
+ parameters: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.union([import_zod9.z.string(), import_zod9.z.number(), import_zod9.z.boolean(), import_zod9.z.null()])).optional().describe(
7704
7814
  'Values for the parameters the statement declares, e.g. {"days": 7} for {days:UInt32}'
7705
7815
  )
7706
7816
  },
@@ -7716,25 +7826,25 @@ function registerObservabilityTools(server) {
7716
7826
  "search_traces",
7717
7827
  "Search LangWatch traces by content, with filters and a date range. Returns AI-readable trace digests by default. Use format: 'json' for full raw data. To fetch a trace you already have the ID for, use get_trace instead \u2014 free text does not match trace IDs.",
7718
7828
  {
7719
- query: import_zod8.z.string().optional().describe(
7829
+ query: import_zod9.z.string().optional().describe(
7720
7830
  "Text search query. Matches captured input/output, the trace name and span names ONLY. It does not match trace IDs \u2014 to fetch a known trace ID use get_trace, or pass traceIds here for several at once."
7721
7831
  ),
7722
- traceIds: import_zod8.z.array(import_zod8.z.string().min(1)).min(1).max(1e3).optional().describe(
7832
+ traceIds: import_zod9.z.array(import_zod9.z.string().min(1)).min(1).max(1e3).optional().describe(
7723
7833
  "Exact trace IDs to fetch (1\u20131000). Use instead of query when you already know the IDs. When set and no startDate is given, the window defaults to the last 90 days rather than 24 hours."
7724
7834
  ),
7725
- filters: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.array(import_zod8.z.string())).optional().describe(
7835
+ filters: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.array(import_zod9.z.string())).optional().describe(
7726
7836
  'Filter traces by the older per-field map. Format: {"field": ["value"]}. Use discover_schema for field names.'
7727
7837
  ),
7728
- filter: import_zod8.z.string().optional().describe(
7838
+ filter: import_zod9.z.string().optional().describe(
7729
7839
  'Filter traces with the Trace Explorer\'s own query language: "status:error AND model:gpt-*", "trace.attribute.langwatch.user_id:alice", "evaluatorVerdict:fail", a quoted phrase for free text. Reaches attribute keys, span events and evaluator verdicts that the `filters` map cannot. Combined with `filters` and `query` when you send more than one. Call discover_schema with category \'filters\' for every field and the syntax.'
7730
7840
  ),
7731
- startDate: import_zod8.z.string().min(1).optional().describe(
7841
+ startDate: import_zod9.z.string().min(1).optional().describe(
7732
7842
  'Start of the window: ISO date, or relative like "24h", "7d", "4w", "3m" \u2014 units are h (hours), d (days), w (weeks), m (30-day months). Defaults to 24h ago for a text search, or 90d when traceIds is set. Widen this when a search comes back empty.'
7733
7843
  ),
7734
- endDate: import_zod8.z.string().min(1).optional().describe("End of the window: ISO date or relative. Default: now"),
7735
- pageSize: import_zod8.z.number().optional().describe("Results per page (default: 25, max: 1000)"),
7736
- scrollId: import_zod8.z.string().optional().describe("Pagination token from previous search"),
7737
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7844
+ endDate: import_zod9.z.string().min(1).optional().describe("End of the window: ISO date or relative. Default: now"),
7845
+ pageSize: import_zod9.z.number().optional().describe("Results per page (default: 25, max: 1000)"),
7846
+ scrollId: import_zod9.z.string().optional().describe("Pagination token from previous search"),
7847
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7738
7848
  },
7739
7849
  withToolLogging("search_traces", async (params) => {
7740
7850
  requireApiKey();
@@ -7748,10 +7858,10 @@ function registerObservabilityTools(server) {
7748
7858
  "get_trace",
7749
7859
  "Get full details of a single trace by ID. This is the right tool whenever you have a trace ID \u2014 search_traces does not match IDs. A full ID resolves at any age; a unique 8\u201331 character hex prefix resolves within the last 90 days. Returns AI-readable trace digest by default. Use format: 'json' for full raw data including all spans.",
7750
7860
  {
7751
- traceId: import_zod8.z.string().describe(
7861
+ traceId: import_zod9.z.string().describe(
7752
7862
  "The trace ID to retrieve. A full ID resolves at any age; a unique 8\u201331 character hex prefix also resolves, git-style, within the last 90 days."
7753
7863
  ),
7754
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7864
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7755
7865
  },
7756
7866
  withToolLogging("get_trace", async (params) => {
7757
7867
  requireApiKey();
@@ -7765,17 +7875,17 @@ function registerObservabilityTools(server) {
7765
7875
  "get_analytics",
7766
7876
  'Query analytics timeseries from LangWatch. Metrics use "category.name" format (e.g., "performance.completion_time"). Use discover_schema to see available metrics.',
7767
7877
  {
7768
- metric: import_zod8.z.string().describe(
7878
+ metric: import_zod9.z.string().describe(
7769
7879
  'Metric in "category.name" format, e.g., "metadata.trace_id", "performance.total_cost"'
7770
7880
  ),
7771
- aggregation: import_zod8.z.string().optional().describe(
7881
+ aggregation: import_zod9.z.string().optional().describe(
7772
7882
  "Aggregation type: avg, sum, min, max, median, p90, p95, p99, cardinality, terms. Default: avg"
7773
7883
  ),
7774
- startDate: import_zod8.z.string().optional().describe('Start date: ISO or relative ("7d", "30d"). Default: 7 days ago'),
7775
- endDate: import_zod8.z.string().optional().describe("End date. Default: now"),
7776
- timeZone: import_zod8.z.string().optional().describe("Timezone. Default: UTC"),
7777
- groupBy: import_zod8.z.string().optional().describe("Group results by field. Use discover_schema for options."),
7778
- filters: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.array(import_zod8.z.string())).optional().describe("Filters to apply")
7884
+ startDate: import_zod9.z.string().optional().describe('Start date: ISO or relative ("7d", "30d"). Default: 7 days ago'),
7885
+ endDate: import_zod9.z.string().optional().describe("End date. Default: now"),
7886
+ timeZone: import_zod9.z.string().optional().describe("Timezone. Default: UTC"),
7887
+ groupBy: import_zod9.z.string().optional().describe("Group results by field. Use discover_schema for options."),
7888
+ filters: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.array(import_zod9.z.string())).optional().describe("Filters to apply")
7779
7889
  },
7780
7890
  withToolLogging("get_analytics", async (params) => {
7781
7891
  requireApiKey();
@@ -7798,16 +7908,16 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7798
7908
  2. Platform-based (LangWatch UI): If the user wants to manage prompts directly on the LangWatch platform, use the \`platform_\` MCP tools (\`platform_create_prompt\`, \`platform_update_prompt\`, etc.).
7799
7909
  `,
7800
7910
  {
7801
- name: import_zod8.z.string().describe("Prompt display name"),
7802
- handle: import_zod8.z.string().optional().describe("URL-friendly handle (auto-generated from name if omitted)"),
7803
- messages: import_zod8.z.array(
7804
- import_zod8.z.object({
7805
- role: import_zod8.z.enum(["system", "user", "assistant"]).describe("Message role"),
7806
- content: import_zod8.z.string().describe("Message content")
7911
+ name: import_zod9.z.string().describe("Prompt display name"),
7912
+ handle: import_zod9.z.string().optional().describe("URL-friendly handle (auto-generated from name if omitted)"),
7913
+ messages: import_zod9.z.array(
7914
+ import_zod9.z.object({
7915
+ role: import_zod9.z.enum(["system", "user", "assistant"]).describe("Message role"),
7916
+ content: import_zod9.z.string().describe("Message content")
7807
7917
  })
7808
7918
  ).describe("Prompt messages"),
7809
7919
  model: modelSchema,
7810
- tags: import_zod8.z.array(import_zod8.z.string()).optional().describe(
7920
+ tags: import_zod9.z.array(import_zod9.z.string()).optional().describe(
7811
7921
  'Tags to assign to the initial version (e.g., ["production", "staging"]). Built-in tags: "latest" (auto-assigned), "production", "staging". Custom tags must be created first.'
7812
7922
  )
7813
7923
  },
@@ -7835,12 +7945,12 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7835
7945
  "platform_get_prompt",
7836
7946
  "Get a specific prompt from the LangWatch platform by ID or handle, including messages, model config, and version history. Use format: 'json' for the full raw API payload, or 'digest' (default) for a formatted summary.",
7837
7947
  {
7838
- idOrHandle: import_zod8.z.string().describe("Prompt ID or handle"),
7839
- version: import_zod8.z.number().optional().describe("Specific version number (default: latest)"),
7840
- tag: import_zod8.z.string().optional().describe(
7948
+ idOrHandle: import_zod9.z.string().describe("Prompt ID or handle"),
7949
+ version: import_zod9.z.number().optional().describe("Specific version number (default: latest)"),
7950
+ tag: import_zod9.z.string().optional().describe(
7841
7951
  'Fetch the version pointed to by this tag (e.g., "production", "staging"). Alternatively, use shorthand in idOrHandle: "pizza-prompt:production"'
7842
7952
  ),
7843
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7953
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7844
7954
  },
7845
7955
  withToolLogging("platform_get_prompt", async (params) => {
7846
7956
  if (params.version != null && params.tag) {
@@ -7860,16 +7970,16 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7860
7970
  "platform_update_prompt",
7861
7971
  "Update an existing prompt on the LangWatch platform. Every update creates a new version.",
7862
7972
  {
7863
- idOrHandle: import_zod8.z.string().describe("Prompt ID or handle to update"),
7864
- messages: import_zod8.z.array(
7865
- import_zod8.z.object({
7866
- role: import_zod8.z.enum(["system", "user", "assistant"]),
7867
- content: import_zod8.z.string()
7973
+ idOrHandle: import_zod9.z.string().describe("Prompt ID or handle to update"),
7974
+ messages: import_zod9.z.array(
7975
+ import_zod9.z.object({
7976
+ role: import_zod9.z.enum(["system", "user", "assistant"]),
7977
+ content: import_zod9.z.string()
7868
7978
  })
7869
7979
  ).optional().describe("Updated messages"),
7870
7980
  model: modelSchema.optional(),
7871
- commitMessage: import_zod8.z.string().describe("Commit message describing the change"),
7872
- tags: import_zod8.z.array(import_zod8.z.string()).optional().describe("Tags to assign to the new version created by this update.")
7981
+ commitMessage: import_zod9.z.string().describe("Commit message describing the change"),
7982
+ tags: import_zod9.z.array(import_zod9.z.string()).optional().describe("Tags to assign to the new version created by this update.")
7873
7983
  },
7874
7984
  withToolLogging("platform_update_prompt", async (params) => {
7875
7985
  requireApiKey();
@@ -7883,9 +7993,9 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7883
7993
  "platform_assign_prompt_tag",
7884
7994
  'Assign a tag (e.g. "production") to a specific version of a prompt. Use this to "deploy" a version by promoting it to the production tag.',
7885
7995
  {
7886
- idOrHandle: import_zod8.z.string().describe("Prompt ID or handle"),
7887
- tag: import_zod8.z.string().describe('Tag name (e.g., "production", "staging")'),
7888
- versionId: import_zod8.z.string().describe("The version ID to assign the tag to")
7996
+ idOrHandle: import_zod9.z.string().describe("Prompt ID or handle"),
7997
+ tag: import_zod9.z.string().describe('Tag name (e.g., "production", "staging")'),
7998
+ versionId: import_zod9.z.string().describe("The version ID to assign the tag to")
7889
7999
  },
7890
8000
  withToolLogging("platform_assign_prompt_tag", async (params) => {
7891
8001
  requireApiKey();
@@ -7911,7 +8021,7 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7911
8021
  "platform_create_prompt_tag",
7912
8022
  'Create a custom prompt tag definition for the organization. Tag names must be non-numeric and not "latest".',
7913
8023
  {
7914
- name: import_zod8.z.string().describe("Tag name to create")
8024
+ name: import_zod9.z.string().describe("Tag name to create")
7915
8025
  },
7916
8026
  withToolLogging("platform_create_prompt_tag", async (params) => {
7917
8027
  requireApiKey();
@@ -7925,8 +8035,8 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7925
8035
  "platform_rename_prompt_tag",
7926
8036
  'Rename an existing prompt tag. The "latest" tag cannot be renamed.',
7927
8037
  {
7928
- tag: import_zod8.z.string().describe("Current tag name to rename"),
7929
- name: import_zod8.z.string().describe("New tag name")
8038
+ tag: import_zod9.z.string().describe("Current tag name to rename"),
8039
+ name: import_zod9.z.string().describe("New tag name")
7930
8040
  },
7931
8041
  withToolLogging("platform_rename_prompt_tag", async (params) => {
7932
8042
  requireApiKey();
@@ -7940,7 +8050,7 @@ NOTE: Prompts can be managed two ways. Determine which approach the user needs:
7940
8050
  "platform_delete_prompt_tag",
7941
8051
  'Delete a prompt tag and all its assignments. The "latest" tag cannot be deleted.',
7942
8052
  {
7943
- tag: import_zod8.z.string().describe("Tag name to delete")
8053
+ tag: import_zod9.z.string().describe("Tag name to delete")
7944
8054
  },
7945
8055
  withToolLogging("platform_delete_prompt_tag", async (params) => {
7946
8056
  requireApiKey();
@@ -7963,11 +8073,11 @@ NOTE: Scenarios can be created two ways. Determine which approach the user needs
7963
8073
  2. Platform-based (LangWatch UI): If the user wants to manage scenarios directly on the LangWatch platform, use the \`platform_\` MCP tools (\`platform_create_scenario\`, \`platform_update_scenario\`, etc.).
7964
8074
  `,
7965
8075
  {
7966
- name: import_zod8.z.string().describe("Scenario name"),
7967
- situation: import_zod8.z.string().describe("The context or setup describing what the user/agent is doing"),
7968
- criteria: import_zod8.z.array(import_zod8.z.string()).optional().describe("Pass/fail conditions the agent's response must satisfy"),
7969
- labels: import_zod8.z.array(import_zod8.z.string()).optional().describe("Tags for organizing and filtering scenarios"),
7970
- testSuiteId: import_zod8.z.string().nullish().describe(
8076
+ name: import_zod9.z.string().describe("Scenario name"),
8077
+ situation: import_zod9.z.string().describe("The context or setup describing what the user/agent is doing"),
8078
+ criteria: import_zod9.z.array(import_zod9.z.string()).optional().describe("Pass/fail conditions the agent's response must satisfy"),
8079
+ labels: import_zod9.z.array(import_zod9.z.string()).optional().describe("Tags for organizing and filtering scenarios"),
8080
+ testSuiteId: import_zod9.z.string().nullish().describe(
7971
8081
  "The test suite to file this scenario in. Pass a test suite ID, or null to unfile it."
7972
8082
  ),
7973
8083
  fields: scenarioFieldValuesSchema.optional()
@@ -7984,8 +8094,8 @@ NOTE: Scenarios can be created two ways. Determine which approach the user needs
7984
8094
  "platform_list_scenarios",
7985
8095
  "List all scenarios on the LangWatch platform. Returns AI-readable digest by default.",
7986
8096
  {
7987
- testSuiteId: import_zod8.z.string().optional().describe("Only the scenarios filed in this test suite"),
7988
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
8097
+ testSuiteId: import_zod9.z.string().optional().describe("Only the scenarios filed in this test suite"),
8098
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
7989
8099
  },
7990
8100
  withToolLogging("platform_list_scenarios", async (params) => {
7991
8101
  requireApiKey();
@@ -7999,8 +8109,8 @@ NOTE: Scenarios can be created two ways. Determine which approach the user needs
7999
8109
  "platform_get_scenario",
8000
8110
  "Get full details of a scenario on the LangWatch platform by ID, including situation, criteria, and labels.",
8001
8111
  {
8002
- scenarioId: import_zod8.z.string().describe("The scenario ID to retrieve"),
8003
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
8112
+ scenarioId: import_zod9.z.string().describe("The scenario ID to retrieve"),
8113
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
8004
8114
  },
8005
8115
  withToolLogging("platform_get_scenario", async (params) => {
8006
8116
  requireApiKey();
@@ -8014,12 +8124,12 @@ NOTE: Scenarios can be created two ways. Determine which approach the user needs
8014
8124
  "platform_update_scenario",
8015
8125
  "Update an existing scenario on the LangWatch platform.",
8016
8126
  {
8017
- scenarioId: import_zod8.z.string().describe("The scenario ID to update"),
8018
- name: import_zod8.z.string().optional().describe("Updated scenario name"),
8019
- situation: import_zod8.z.string().optional().describe("Updated situation"),
8020
- criteria: import_zod8.z.array(import_zod8.z.string()).optional().describe("Updated criteria"),
8021
- labels: import_zod8.z.array(import_zod8.z.string()).optional().describe("Updated labels"),
8022
- testSuiteId: import_zod8.z.string().nullish().describe(
8127
+ scenarioId: import_zod9.z.string().describe("The scenario ID to update"),
8128
+ name: import_zod9.z.string().optional().describe("Updated scenario name"),
8129
+ situation: import_zod9.z.string().optional().describe("Updated situation"),
8130
+ criteria: import_zod9.z.array(import_zod9.z.string()).optional().describe("Updated criteria"),
8131
+ labels: import_zod9.z.array(import_zod9.z.string()).optional().describe("Updated labels"),
8132
+ testSuiteId: import_zod9.z.string().nullish().describe(
8023
8133
  "The test suite to file this scenario in. Pass a test suite ID, or null to unfile it."
8024
8134
  ),
8025
8135
  fields: scenarioFieldValuesSchema.optional()
@@ -8036,7 +8146,7 @@ NOTE: Scenarios can be created two ways. Determine which approach the user needs
8036
8146
  "platform_archive_scenario",
8037
8147
  "Archive (soft-delete) a scenario on the LangWatch platform.",
8038
8148
  {
8039
- scenarioId: import_zod8.z.string().describe("The scenario ID to archive")
8149
+ scenarioId: import_zod9.z.string().describe("The scenario ID to archive")
8040
8150
  },
8041
8151
  withToolLogging("platform_archive_scenario", async (params) => {
8042
8152
  requireApiKey();
@@ -8052,27 +8162,27 @@ function registerRunPlanTools(server) {
8052
8162
  "platform_run_plan",
8053
8163
  "Run scenarios against targets. The plan name identifies the run plan: an existing name is re-run with the configuration you send here, a new name creates the plan. Configuration is the scope, the targets, the repeat count and the models; parameters, the note and the idempotency key belong to this run alone. Send more than one target to compare them in the same run, and give a target its own parameters to compare one agent on two models.",
8054
8164
  {
8055
- name: import_zod8.z.string().optional().describe(
8165
+ name: import_zod9.z.string().optional().describe(
8056
8166
  "The run plan to run. An existing name is replaced with this configuration, a new name creates the plan. Omit to let the server name it after the suite and the target."
8057
8167
  ),
8058
8168
  scope: runPlanScopeSchema.describe(
8059
8169
  "What the plan covers: every scenario in the project, the scenarios filed in given test suites, the scenarios carrying given labels, or the hand-picked list in scenarioIds."
8060
8170
  ),
8061
- scenarioIds: import_zod8.z.array(import_zod8.z.string()).optional().describe("The scenarios to run. Read only when scope.mode is 'scenarios'."),
8062
- targets: import_zod8.z.array(runPlanTargetSchema).describe(
8171
+ scenarioIds: import_zod9.z.array(import_zod9.z.string()).optional().describe("The scenarios to run. Read only when scope.mode is 'scenarios'."),
8172
+ targets: import_zod9.z.array(runPlanTargetSchema).describe(
8063
8173
  "What to run the scenarios against. Every target runs every scenario, and the results show one column for each, so this is how one run compares two agents or one agent on two models."
8064
8174
  ),
8065
- repeatCount: import_zod8.z.number().int().min(1).max(5).optional().describe("How many times to run each scenario against each target (1 to 5, default 1)"),
8066
- simulatorModel: import_zod8.z.string().optional().describe("Model that plays the user. Omit for the project default."),
8067
- judgeModel: import_zod8.z.string().optional().describe("Model that judges the criteria. Omit for the project default."),
8175
+ repeatCount: import_zod9.z.number().int().min(1).max(5).optional().describe("How many times to run each scenario against each target (1 to 5, default 1)"),
8176
+ simulatorModel: import_zod9.z.string().optional().describe("Model that plays the user. Omit for the project default."),
8177
+ judgeModel: import_zod9.z.string().optional().describe("Model that judges the criteria. Omit for the project default."),
8068
8178
  evaluators: evaluatorAttachmentsSchema.optional().describe(
8069
8179
  "The plan's own evaluators, run beside the ones attached to the test suites its scenarios belong to. A plan evaluator reads the conversation and the trace, never a scenario field. Omit to keep what the plan already holds. See discover_schema({ category: 'scenarios' }) for the mapping paths."
8070
8180
  ),
8071
8181
  parameters: runParametersSchema.optional().describe(
8072
8182
  "Values for the parameters the scenarios declare, by name. They apply to every target; a target that names the same parameter overrides them for itself."
8073
8183
  ),
8074
- note: import_zod8.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)"),
8075
- idempotencyKey: import_zod8.z.string().optional().describe(
8184
+ note: import_zod9.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)"),
8185
+ idempotencyKey: import_zod9.z.string().optional().describe(
8076
8186
  "Send the same key to make a retry join the run it already started instead of starting a second one."
8077
8187
  )
8078
8188
  },
@@ -8088,8 +8198,8 @@ function registerRunPlanTools(server) {
8088
8198
  "platform_list_run_plans",
8089
8199
  "List the run plans of the project. A run plan holds the configuration a run used, keyed by its name.",
8090
8200
  {
8091
- includeArchived: import_zod8.z.boolean().optional().describe("Include archived plans (default false)"),
8092
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json' (raw data)")
8201
+ includeArchived: import_zod9.z.boolean().optional().describe("Include archived plans (default false)"),
8202
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json' (raw data)")
8093
8203
  },
8094
8204
  withToolLogging("platform_list_run_plans", async (params) => {
8095
8205
  requireApiKey();
@@ -8103,8 +8213,8 @@ function registerRunPlanTools(server) {
8103
8213
  "platform_get_run_plan",
8104
8214
  "Get the full configuration of a run plan: what it covers, its targets, its repeat count and its models.",
8105
8215
  {
8106
- id: import_zod8.z.string().describe("The run plan ID"),
8107
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json'")
8216
+ id: import_zod9.z.string().describe("The run plan ID"),
8217
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json'")
8108
8218
  },
8109
8219
  withToolLogging("platform_get_run_plan", async (params) => {
8110
8220
  requireApiKey();
@@ -8118,9 +8228,9 @@ function registerRunPlanTools(server) {
8118
8228
  "platform_rerun_run_plan",
8119
8229
  "Run a plan again with the configuration it already holds. Only the parameters and the note belong to the new run.",
8120
8230
  {
8121
- id: import_zod8.z.string().describe("The run plan ID to run again"),
8231
+ id: import_zod9.z.string().describe("The run plan ID to run again"),
8122
8232
  parameters: runParametersSchema.optional().describe("Values for the parameters the scenarios declare, by name."),
8123
- note: import_zod8.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)")
8233
+ note: import_zod9.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)")
8124
8234
  },
8125
8235
  withToolLogging("platform_rerun_run_plan", async (params) => {
8126
8236
  requireApiKey();
@@ -8134,7 +8244,7 @@ function registerRunPlanTools(server) {
8134
8244
  "platform_archive_run_plan",
8135
8245
  "Archive a run plan. Its past runs stay readable and the name is free for a new plan.",
8136
8246
  {
8137
- id: import_zod8.z.string().describe("The run plan ID to archive")
8247
+ id: import_zod9.z.string().describe("The run plan ID to archive")
8138
8248
  },
8139
8249
  withToolLogging("platform_archive_run_plan", async (params) => {
8140
8250
  requireApiKey();
@@ -8150,7 +8260,7 @@ function registerTestSuiteTools(server) {
8150
8260
  "platform_list_test_suites",
8151
8261
  "List the test suites of the project. A test suite groups scenarios.",
8152
8262
  {
8153
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json' (raw data)")
8263
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json' (raw data)")
8154
8264
  },
8155
8265
  withToolLogging("platform_list_test_suites", async (params) => {
8156
8266
  requireApiKey();
@@ -8164,7 +8274,7 @@ function registerTestSuiteTools(server) {
8164
8274
  "platform_create_test_suite",
8165
8275
  "Create a test suite. A test suite groups scenarios: file a scenario in it by passing the suite ID as testSuiteId on platform_create_scenario or platform_update_scenario. A suite can declare typed fields every scenario carries a value for, and attach saved evaluators that run after every scenario run with mappings from their inputs to the conversation, the scenario's fields or the trace. Call discover_schema({ category: 'scenarios' }) first for the field rules and the mapping paths.",
8166
8276
  {
8167
- name: import_zod8.z.string().describe("Test suite name"),
8277
+ name: import_zod9.z.string().describe("Test suite name"),
8168
8278
  fields: suiteFieldsSchema.optional(),
8169
8279
  evaluators: evaluatorAttachmentsSchema.optional()
8170
8280
  },
@@ -8180,8 +8290,8 @@ function registerTestSuiteTools(server) {
8180
8290
  "platform_get_test_suite",
8181
8291
  "Get a test suite and the scenarios filed in it.",
8182
8292
  {
8183
- id: import_zod8.z.string().describe("The test suite ID"),
8184
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json'")
8293
+ id: import_zod9.z.string().describe("The test suite ID"),
8294
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default) or 'json'")
8185
8295
  },
8186
8296
  withToolLogging("platform_get_test_suite", async (params) => {
8187
8297
  requireApiKey();
@@ -8195,8 +8305,8 @@ function registerTestSuiteTools(server) {
8195
8305
  "platform_update_test_suite",
8196
8306
  "Edit a test suite: any of its name, its fields and its evaluators. A field list or an evaluator list replaces the one the suite holds; a key left out keeps what the suite has. A field an attached evaluator still reads cannot be removed. Call discover_schema({ category: 'scenarios' }) first for the field rules and the mapping paths.",
8197
8307
  {
8198
- id: import_zod8.z.string().describe("The test suite ID"),
8199
- name: import_zod8.z.string().optional().describe("The new name. The slug is kept."),
8308
+ id: import_zod9.z.string().describe("The test suite ID"),
8309
+ name: import_zod9.z.string().optional().describe("The new name. The slug is kept."),
8200
8310
  fields: suiteFieldsSchema.optional().describe(
8201
8311
  "The full list of fields the suite declares. It replaces the list the suite holds."
8202
8312
  ),
@@ -8215,8 +8325,8 @@ function registerTestSuiteTools(server) {
8215
8325
  "platform_rename_test_suite",
8216
8326
  "Rename a test suite.",
8217
8327
  {
8218
- id: import_zod8.z.string().describe("The test suite ID"),
8219
- name: import_zod8.z.string().describe("The new name")
8328
+ id: import_zod9.z.string().describe("The test suite ID"),
8329
+ name: import_zod9.z.string().describe("The new name")
8220
8330
  },
8221
8331
  withToolLogging("platform_rename_test_suite", async (params) => {
8222
8332
  requireApiKey();
@@ -8230,7 +8340,7 @@ function registerTestSuiteTools(server) {
8230
8340
  "platform_archive_test_suite",
8231
8341
  "Archive a test suite. The scenarios filed in it are archived with it.",
8232
8342
  {
8233
- id: import_zod8.z.string().describe("The test suite ID to archive")
8343
+ id: import_zod9.z.string().describe("The test suite ID to archive")
8234
8344
  },
8235
8345
  withToolLogging("platform_archive_test_suite", async (params) => {
8236
8346
  requireApiKey();
@@ -8244,20 +8354,20 @@ function registerTestSuiteTools(server) {
8244
8354
  "platform_run_test_suite",
8245
8355
  "Run every scenario of a test suite against targets. This creates or joins the run plan named '<suite name> <target name>' unless you send a name of your own. Send more than one target to compare them in the same run, and give a target its own parameters to compare one agent on two models.",
8246
8356
  {
8247
- id: import_zod8.z.string().describe("The test suite ID to run"),
8248
- targets: import_zod8.z.array(runPlanTargetSchema).describe(
8357
+ id: import_zod9.z.string().describe("The test suite ID to run"),
8358
+ targets: import_zod9.z.array(runPlanTargetSchema).describe(
8249
8359
  "What to run the scenarios against. Every target runs every scenario, and the results show one column for each."
8250
8360
  ),
8251
- name: import_zod8.z.string().optional().describe(
8361
+ name: import_zod9.z.string().optional().describe(
8252
8362
  "The run plan to run. Omit to let the server name it after the suite and the target."
8253
8363
  ),
8254
- repeatCount: import_zod8.z.number().int().min(1).max(5).optional().describe("How many times to run each scenario against each target (1 to 5, default 1)"),
8255
- simulatorModel: import_zod8.z.string().optional().describe("Model that plays the user. Omit for the project default."),
8256
- judgeModel: import_zod8.z.string().optional().describe("Model that judges the criteria. Omit for the project default."),
8364
+ repeatCount: import_zod9.z.number().int().min(1).max(5).optional().describe("How many times to run each scenario against each target (1 to 5, default 1)"),
8365
+ simulatorModel: import_zod9.z.string().optional().describe("Model that plays the user. Omit for the project default."),
8366
+ judgeModel: import_zod9.z.string().optional().describe("Model that judges the criteria. Omit for the project default."),
8257
8367
  parameters: runParametersSchema.optional().describe(
8258
8368
  "Values for the parameters the scenarios declare, by name. They apply to every target; a target that names the same parameter overrides them for itself."
8259
8369
  ),
8260
- note: import_zod8.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)")
8370
+ note: import_zod9.z.string().max(200).optional().describe("One short line saying why this run was started (max 200 characters)")
8261
8371
  },
8262
8372
  withToolLogging("platform_run_test_suite", async (params) => {
8263
8373
  requireApiKey();
@@ -8273,10 +8383,10 @@ function registerSimulationRunTools(server) {
8273
8383
  "platform_list_simulation_runs",
8274
8384
  "List simulation run results. Filter by scenario set or batch run ID to see specific results.",
8275
8385
  {
8276
- scenarioSetId: import_zod8.z.string().optional().describe("Filter by scenario set ID"),
8277
- batchRunId: import_zod8.z.string().optional().describe("Filter by batch run ID"),
8278
- limit: import_zod8.z.number().optional().describe("Max results to return (default: 20)"),
8279
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format")
8386
+ scenarioSetId: import_zod9.z.string().optional().describe("Filter by scenario set ID"),
8387
+ batchRunId: import_zod9.z.string().optional().describe("Filter by batch run ID"),
8388
+ limit: import_zod9.z.number().optional().describe("Max results to return (default: 20)"),
8389
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format")
8280
8390
  },
8281
8391
  withToolLogging("platform_list_simulation_runs", async (params) => {
8282
8392
  requireApiKey();
@@ -8290,8 +8400,8 @@ function registerSimulationRunTools(server) {
8290
8400
  "platform_get_simulation_run",
8291
8401
  "Get full details of a simulation run including conversation messages, results, costs, the verdict and the result of every evaluator attached to its test suite or run plan.",
8292
8402
  {
8293
- scenarioRunId: import_zod8.z.string().describe("The simulation run ID"),
8294
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format")
8403
+ scenarioRunId: import_zod9.z.string().describe("The simulation run ID"),
8404
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format")
8295
8405
  },
8296
8406
  withToolLogging("platform_get_simulation_run", async (params) => {
8297
8407
  requireApiKey();
@@ -8307,8 +8417,8 @@ function registerEvaluatorTools(server) {
8307
8417
  "platform_create_evaluator",
8308
8418
  `Create an evaluator on the LangWatch platform. Useful for setting up LLM-as-judge and other evaluators to use in evaluation notebooks. Call discover_schema({ category: 'evaluators' }) first to see available evaluator types and their settings.`,
8309
8419
  {
8310
- name: import_zod8.z.string().describe("Evaluator name"),
8311
- config: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).describe(
8420
+ name: import_zod9.z.string().describe("Evaluator name"),
8421
+ config: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown()).describe(
8312
8422
  'Evaluator config object. Must include "evaluatorType" (e.g. "langevals/llm_boolean") and optional "settings" overrides.'
8313
8423
  )
8314
8424
  },
@@ -8336,7 +8446,7 @@ function registerEvaluatorTools(server) {
8336
8446
  "platform_get_evaluator",
8337
8447
  "Get full details of an evaluator on the LangWatch platform by ID or slug, including config, input fields, and output fields.",
8338
8448
  {
8339
- idOrSlug: import_zod8.z.string().describe("The evaluator ID or slug to retrieve")
8449
+ idOrSlug: import_zod9.z.string().describe("The evaluator ID or slug to retrieve")
8340
8450
  },
8341
8451
  withToolLogging("platform_get_evaluator", async (params) => {
8342
8452
  requireApiKey();
@@ -8350,9 +8460,9 @@ function registerEvaluatorTools(server) {
8350
8460
  "platform_update_evaluator",
8351
8461
  "Update an existing evaluator on the LangWatch platform. The evaluatorType in config cannot be changed after creation.",
8352
8462
  {
8353
- evaluatorId: import_zod8.z.string().describe("The evaluator ID to update"),
8354
- name: import_zod8.z.string().optional().describe("Updated evaluator name"),
8355
- config: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).optional().describe("Updated config settings. Note: evaluatorType cannot be changed after creation.")
8463
+ evaluatorId: import_zod9.z.string().describe("The evaluator ID to update"),
8464
+ name: import_zod9.z.string().optional().describe("Updated evaluator name"),
8465
+ config: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown()).optional().describe("Updated config settings. Note: evaluatorType cannot be changed after creation.")
8356
8466
  },
8357
8467
  withToolLogging("platform_update_evaluator", async (params) => {
8358
8468
  requireApiKey();
@@ -8366,7 +8476,7 @@ function registerEvaluatorTools(server) {
8366
8476
  "platform_delete_evaluator",
8367
8477
  "Archive (soft-delete) an evaluator by ID or slug.",
8368
8478
  {
8369
- idOrSlug: import_zod8.z.string().describe("The evaluator ID or slug to archive")
8479
+ idOrSlug: import_zod9.z.string().describe("The evaluator ID or slug to archive")
8370
8480
  },
8371
8481
  withToolLogging("platform_delete_evaluator", async (params) => {
8372
8482
  requireApiKey();
@@ -8382,12 +8492,12 @@ function registerModelProviderTools(server) {
8382
8492
  "platform_set_model_provider",
8383
8493
  `Set or update a model provider on the LangWatch platform. Use this to configure API keys (e.g. OPENAI_API_KEY) needed to run evaluators. The API key is stored securely and never returned in responses. Omit customKeys to update other settings without changing existing keys.`,
8384
8494
  {
8385
- provider: import_zod8.z.string().describe('Provider name, e.g., "openai", "anthropic", "azure", "custom"'),
8386
- enabled: import_zod8.z.boolean().describe("Whether the provider is enabled"),
8387
- customKeys: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).optional().describe(
8495
+ provider: import_zod9.z.string().describe('Provider name, e.g., "openai", "anthropic", "azure", "custom"'),
8496
+ enabled: import_zod9.z.boolean().describe("Whether the provider is enabled"),
8497
+ customKeys: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown()).optional().describe(
8388
8498
  'API key configuration, e.g. { "OPENAI_API_KEY": "sk-..." }. Omit to keep existing keys.'
8389
8499
  ),
8390
- defaultModel: import_zod8.z.string().optional().describe("Set as project default model")
8500
+ defaultModel: import_zod9.z.string().optional().describe("Set as project default model")
8391
8501
  },
8392
8502
  withToolLogging("platform_set_model_provider", async (params) => {
8393
8503
  requireApiKey();
@@ -8427,7 +8537,7 @@ function registerAgentTools(server) {
8427
8537
  "platform_get_agent",
8428
8538
  "Get detailed information about a specific agent by its ID, including its configuration. A connected agent also shows its environment, status, the run parameters it declared (with options and defaults) and the instances connected right now.",
8429
8539
  {
8430
- id: import_zod8.z.string().describe("The agent ID")
8540
+ id: import_zod9.z.string().describe("The agent ID")
8431
8541
  },
8432
8542
  withToolLogging("platform_get_agent", async (params) => {
8433
8543
  requireApiKey();
@@ -8441,9 +8551,9 @@ function registerAgentTools(server) {
8441
8551
  "platform_create_agent",
8442
8552
  "Create a new agent. Supported types: 'signature' (LLM prompt), 'code' (Python), 'workflow' (sub-workflow), 'http' (external API). A 'connected' agent is not created here: it registers itself from code, with connectAgent from langwatch/agent in TypeScript or langwatch.connect_agent in Python, and appears in the list once that process runs.",
8443
8553
  {
8444
- name: import_zod8.z.string().describe("Agent name"),
8445
- type: import_zod8.z.enum(["signature", "code", "workflow", "http"]).describe("Agent type"),
8446
- config: import_zod8.z.string().optional().describe("Agent configuration as JSON string (will be parsed)")
8554
+ name: import_zod9.z.string().describe("Agent name"),
8555
+ type: import_zod9.z.enum(["signature", "code", "workflow", "http"]).describe("Agent type"),
8556
+ config: import_zod9.z.string().optional().describe("Agent configuration as JSON string (will be parsed)")
8447
8557
  },
8448
8558
  withToolLogging("platform_create_agent", async (params) => {
8449
8559
  requireApiKey();
@@ -8460,10 +8570,10 @@ function registerAgentTools(server) {
8460
8570
  "platform_update_agent",
8461
8571
  "Update an existing agent's name, type, or configuration.",
8462
8572
  {
8463
- id: import_zod8.z.string().describe("The agent ID"),
8464
- name: import_zod8.z.string().optional().describe("New agent name"),
8465
- type: import_zod8.z.string().optional().describe("New agent type: signature, code, workflow, or http"),
8466
- config: import_zod8.z.string().optional().describe("Updated configuration as JSON string (will be parsed)")
8573
+ id: import_zod9.z.string().describe("The agent ID"),
8574
+ name: import_zod9.z.string().optional().describe("New agent name"),
8575
+ type: import_zod9.z.string().optional().describe("New agent type: signature, code, workflow, or http"),
8576
+ config: import_zod9.z.string().optional().describe("Updated configuration as JSON string (will be parsed)")
8467
8577
  },
8468
8578
  withToolLogging("platform_update_agent", async (params) => {
8469
8579
  requireApiKey();
@@ -8480,7 +8590,7 @@ function registerAgentTools(server) {
8480
8590
  "platform_delete_agent",
8481
8591
  "Archive (soft-delete) an agent by its ID.",
8482
8592
  {
8483
- id: import_zod8.z.string().describe("The agent ID to archive")
8593
+ id: import_zod9.z.string().describe("The agent ID to archive")
8484
8594
  },
8485
8595
  withToolLogging("platform_delete_agent", async (params) => {
8486
8596
  requireApiKey();
@@ -8494,13 +8604,13 @@ function registerAgentTools(server) {
8494
8604
  "platform_run_agent",
8495
8605
  "Run one turn of an agent. A connected agent runs through the platform relay on a live instance: give `message` (one user turn) or `input` with a `messages` list, plus `parameters` and `threadId` to continue a conversation. HTTP agents call their configured URL directly; workflow-linked agents execute via the workflow engine.",
8496
8606
  {
8497
- id: import_zod8.z.string().describe("The agent ID to run"),
8498
- input: import_zod8.z.string().optional().describe(
8607
+ id: import_zod9.z.string().describe("The agent ID to run"),
8608
+ input: import_zod9.z.string().optional().describe(
8499
8609
  "Input data as a JSON object string. For a connected agent it is the relay body: messages (OpenAI style), and optionally threadId, session and params."
8500
8610
  ),
8501
- message: import_zod8.z.string().optional().describe("One user message to send to a connected agent, instead of input"),
8502
- parameters: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.union([import_zod8.z.string(), import_zod8.z.number(), import_zod8.z.boolean()])).optional().describe("Run parameter values for a connected agent, by name"),
8503
- threadId: import_zod8.z.string().optional().describe("Continue a conversation on a connected agent")
8611
+ message: import_zod9.z.string().optional().describe("One user message to send to a connected agent, instead of input"),
8612
+ parameters: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.union([import_zod9.z.string(), import_zod9.z.number(), import_zod9.z.boolean()])).optional().describe("Run parameter values for a connected agent, by name"),
8613
+ threadId: import_zod9.z.string().optional().describe("Continue a conversation on a connected agent")
8504
8614
  },
8505
8615
  withToolLogging("platform_run_agent", async (params) => {
8506
8616
  requireApiKey();
@@ -8514,7 +8624,7 @@ function registerAgentTools(server) {
8514
8624
  "platform_test_agent",
8515
8625
  'Test an agent with one scripted scenario run: the user sends "ping", the agent answers, and the run succeeds when the answer arrives. No model is used, and no scenario, run plan or test suite is added to the project. Answers at once with the scenario run id to follow with platform_get_simulation_run; the run itself is asynchronous.',
8516
8626
  {
8517
- id: import_zod8.z.string().describe("The agent ID to test")
8627
+ id: import_zod9.z.string().describe("The agent ID to test")
8518
8628
  },
8519
8629
  withToolLogging("platform_test_agent", async (params) => {
8520
8630
  requireApiKey();
@@ -8524,91 +8634,103 @@ function registerAgentTools(server) {
8524
8634
  })
8525
8635
  );
8526
8636
  }
8527
- function registerDashboardTools(server) {
8637
+ function registerAnalyticsReportTools(server) {
8528
8638
  server.tool(
8529
- "platform_list_dashboards",
8530
- "List all analytics dashboards in the LangWatch project.",
8639
+ "platform_list_analytics_reports",
8640
+ "List the Analytics Reports in the LangWatch project (/api/v1/analytics/reports). Dashboards, which hold widgets, are listed by list_dashboards.",
8531
8641
  {},
8532
- withToolLogging("platform_list_dashboards", async () => {
8642
+ withToolLogging("platform_list_analytics_reports", async () => {
8533
8643
  requireApiKey();
8534
- const { handleListDashboards: handleListDashboards2 } = await Promise.resolve().then(() => (init_list_dashboards(), list_dashboards_exports));
8644
+ const { handleListAnalyticsReports: handleListAnalyticsReports2 } = await Promise.resolve().then(() => (init_list_analytics_reports(), list_analytics_reports_exports));
8535
8645
  return {
8536
- content: [{ type: "text", text: await handleListDashboards2() }]
8646
+ content: [{ type: "text", text: await handleListAnalyticsReports2() }]
8537
8647
  };
8538
8648
  })
8539
8649
  );
8540
8650
  server.tool(
8541
- "platform_get_dashboard",
8542
- "Get a dashboard by its ID, including its graphs.",
8651
+ "platform_get_analytics_report",
8652
+ "Get an Analytics Report by its ID, including its graphs. A Dashboards dashboard's ID is not found here; read it with get_dashboard.",
8543
8653
  {
8544
- id: import_zod8.z.string().describe("The dashboard ID")
8654
+ reportId: import_zod9.z.string().describe("The Analytics Report ID")
8545
8655
  },
8546
- withToolLogging("platform_get_dashboard", async (params) => {
8656
+ withToolLogging("platform_get_analytics_report", async (params) => {
8547
8657
  requireApiKey();
8548
- const { handleGetDashboard: handleGetDashboard2 } = await Promise.resolve().then(() => (init_get_dashboard(), get_dashboard_exports));
8658
+ const { handleGetAnalyticsReport: handleGetAnalyticsReport2 } = await Promise.resolve().then(() => (init_get_analytics_report(), get_analytics_report_exports));
8549
8659
  return {
8550
- content: [{ type: "text", text: await handleGetDashboard2(params) }]
8660
+ content: [{ type: "text", text: await handleGetAnalyticsReport2(params) }]
8551
8661
  };
8552
8662
  })
8553
8663
  );
8554
8664
  server.tool(
8555
- "platform_create_dashboard",
8556
- "Create a new analytics dashboard.",
8665
+ "platform_create_analytics_report",
8666
+ "Create a new Analytics Report.",
8557
8667
  {
8558
- name: import_zod8.z.string().describe("Dashboard name")
8668
+ name: import_zod9.z.string().describe("Analytics Report name")
8559
8669
  },
8560
- withToolLogging("platform_create_dashboard", async (params) => {
8670
+ withToolLogging("platform_create_analytics_report", async (params) => {
8561
8671
  requireApiKey();
8562
- const { handleCreateDashboard: handleCreateDashboard2 } = await Promise.resolve().then(() => (init_create_dashboard(), create_dashboard_exports));
8672
+ const { handleCreateAnalyticsReport: handleCreateAnalyticsReport2 } = await Promise.resolve().then(() => (init_create_analytics_report(), create_analytics_report_exports));
8563
8673
  return {
8564
- content: [{ type: "text", text: await handleCreateDashboard2(params) }]
8674
+ content: [
8675
+ {
8676
+ type: "text",
8677
+ text: await handleCreateAnalyticsReport2(params)
8678
+ }
8679
+ ]
8565
8680
  };
8566
8681
  })
8567
8682
  );
8568
8683
  server.tool(
8569
- "platform_delete_dashboard",
8570
- "Delete a dashboard and all its graphs.",
8684
+ "platform_delete_analytics_report",
8685
+ "Delete an Analytics Report and all its graphs.",
8571
8686
  {
8572
- id: import_zod8.z.string().describe("The dashboard ID to delete")
8687
+ reportId: import_zod9.z.string().describe("The Analytics Report ID to delete")
8573
8688
  },
8574
- withToolLogging("platform_delete_dashboard", async (params) => {
8689
+ withToolLogging("platform_delete_analytics_report", async (params) => {
8575
8690
  requireApiKey();
8576
- const { handleDeleteDashboard: handleDeleteDashboard2 } = await Promise.resolve().then(() => (init_delete_dashboard(), delete_dashboard_exports));
8691
+ const { handleDeleteAnalyticsReport: handleDeleteAnalyticsReport2 } = await Promise.resolve().then(() => (init_delete_analytics_report(), delete_analytics_report_exports));
8577
8692
  return {
8578
- content: [{ type: "text", text: await handleDeleteDashboard2(params) }]
8693
+ content: [
8694
+ {
8695
+ type: "text",
8696
+ text: await handleDeleteAnalyticsReport2(params)
8697
+ }
8698
+ ]
8579
8699
  };
8580
8700
  })
8581
8701
  );
8582
8702
  server.tool(
8583
- "platform_rename_dashboard",
8584
- "Rename a dashboard.",
8703
+ "platform_rename_analytics_report",
8704
+ "Rename an Analytics Report.",
8585
8705
  {
8586
- id: import_zod8.z.string().describe("The dashboard ID to rename"),
8587
- name: import_zod8.z.string().describe("The new name for the dashboard")
8706
+ reportId: import_zod9.z.string().describe("The Analytics Report ID to rename"),
8707
+ name: import_zod9.z.string().describe("The new name for the Analytics Report")
8588
8708
  },
8589
- withToolLogging("platform_rename_dashboard", async (params) => {
8709
+ withToolLogging("platform_rename_analytics_report", async (params) => {
8590
8710
  requireApiKey();
8591
- const { renameDashboard: renameDashboard2 } = await Promise.resolve().then(() => (init_langwatch_api_dashboards(), langwatch_api_dashboards_exports));
8592
- const result = await renameDashboard2(params.id, { name: params.name });
8711
+ const { renameAnalyticsReport: renameAnalyticsReport2 } = await Promise.resolve().then(() => (init_langwatch_api_analytics_reports(), langwatch_api_analytics_reports_exports));
8712
+ const result = await renameAnalyticsReport2({ reportId: params.reportId, name: params.name });
8593
8713
  return {
8594
8714
  content: [
8595
8715
  {
8596
8716
  type: "text",
8597
- text: `Dashboard "${result.name}" renamed successfully (ID: ${result.id}).`
8717
+ text: `Analytics Report "${result.name}" renamed successfully (ID: ${result.id}).`
8598
8718
  }
8599
8719
  ]
8600
8720
  };
8601
8721
  })
8602
8722
  );
8723
+ }
8724
+ function registerDashboardTools(server) {
8603
8725
  server.tool(
8604
- "list_dashboard_boards",
8605
- "Lists the project's boards in the Dashboards area, with each one's ID and widget count. Use an ID from here as the dashboardId of add_dashboard_widget and update_dashboard_widget; the analytics dashboards platform_list_dashboards lists hold no widgets.",
8726
+ "list_dashboards",
8727
+ "Lists the project's dashboards in the Dashboards area, with each one's ID and widget count. Use an ID from here as the dashboardId of add_dashboard_widget and update_dashboard_widget; the Analytics Reports platform_list_analytics_reports lists hold no widgets.",
8606
8728
  {},
8607
- withToolLogging("list_dashboard_boards", async () => {
8729
+ withToolLogging("list_dashboards", async () => {
8608
8730
  requireApiKey();
8609
- const { handleListDashboardBoards: handleListDashboardBoards2 } = await Promise.resolve().then(() => (init_list_dashboard_boards(), list_dashboard_boards_exports));
8731
+ const { handleListDashboards: handleListDashboards2 } = await Promise.resolve().then(() => (init_list_dashboards(), list_dashboards_exports));
8610
8732
  return {
8611
- content: [{ type: "text", text: await handleListDashboardBoards2() }]
8733
+ content: [{ type: "text", text: await handleListDashboards2() }]
8612
8734
  };
8613
8735
  })
8614
8736
  );
@@ -8616,22 +8738,23 @@ function registerDashboardTools(server) {
8616
8738
  "add_dashboard_widget",
8617
8739
  "Creates a custom dashboard widget and places it on the given dashboard. A widget's `code` is a TSX file run in a sandbox: it receives a global `LW` with `LW.useChartQuery(name)` (reads one of the widget's own named queries), `LW.navigate` and `LW.theme`. `queries` are named LangWatchQL SQL statements the code can read by name \u2014 validate each statement's SQL first with run_query before calling this tool, since a query only runs inside the sandbox at render time and a mistake surfaces there, not here. Up to 8 queries per widget.",
8618
8740
  {
8619
- dashboardId: import_zod8.z.string().describe("The Dashboards board to add the widget to, as list_dashboard_boards lists it"),
8620
- name: import_zod8.z.string().describe("The widget's display name"),
8621
- code: import_zod8.z.string().describe(
8741
+ dashboardId: import_zod9.z.string().describe("The dashboard to add the widget to, as list_dashboards lists it"),
8742
+ name: import_zod9.z.string().describe("The widget's display name"),
8743
+ code: import_zod9.z.string().describe(
8622
8744
  "The widget's TSX source. Runs sandboxed with a global LW (LW.useChartQuery(name), LW.navigate, LW.theme) in scope."
8623
8745
  ),
8624
- queries: import_zod8.z.union([
8625
- import_zod8.z.record(import_zod8.z.string(), import_zod8.z.string()).describe('{"<name>": "<LWQL SQL>"}'),
8626
- import_zod8.z.array(
8627
- import_zod8.z.object({
8628
- name: import_zod8.z.string().describe('Referenced from code as LW.useChartQuery("name")'),
8629
- sql: import_zod8.z.string().describe("The LangWatchQL statement")
8746
+ queries: import_zod9.z.union([
8747
+ import_zod9.z.record(import_zod9.z.string(), import_zod9.z.string()).describe('{"<name>": "<LWQL SQL>"}'),
8748
+ import_zod9.z.array(
8749
+ import_zod9.z.object({
8750
+ name: import_zod9.z.string().describe('Referenced from code as LW.useChartQuery("name")'),
8751
+ sql: import_zod9.z.string().describe("The LangWatchQL statement")
8630
8752
  })
8631
8753
  ).describe("Named LWQL queries, array form")
8632
8754
  ]).describe(
8633
8755
  "The widget's named LangWatchQL queries: either {name: sql} or an array of {name, sql}. Max 8. Validate each statement with run_query first."
8634
- )
8756
+ ),
8757
+ sources: widgetSourcesInput
8635
8758
  },
8636
8759
  withToolLogging("add_dashboard_widget", async (params) => {
8637
8760
  requireApiKey();
@@ -8643,26 +8766,27 @@ function registerDashboardTools(server) {
8643
8766
  );
8644
8767
  server.tool(
8645
8768
  "update_dashboard_widget",
8646
- "Changes one custom widget on a dashboard: its name, its TSX `code`, its named LangWatchQL `queries` or its `description`. Pass only the fields to change; every field left out keeps its stored value. Validate any new query's SQL with run_query first. Returns the updated widget.",
8769
+ "Changes one custom widget on a dashboard: its name, its TSX `code`, its named LangWatchQL `queries`, its `description` or the `sources` its queries count. Pass only the fields to change; every field left out keeps its stored value. Validate any new query's SQL with run_query first. Returns the updated widget.",
8647
8770
  {
8648
- dashboardId: import_zod8.z.string().describe("The dashboard the widget is on"),
8649
- widgetId: import_zod8.z.string().describe("The widget to change, as add_dashboard_widget returned it"),
8650
- name: import_zod8.z.string().optional().describe("The widget's new display name"),
8651
- code: import_zod8.z.string().optional().describe(
8771
+ dashboardId: import_zod9.z.string().describe("The dashboard the widget is on"),
8772
+ widgetId: import_zod9.z.string().describe("The widget to change, as add_dashboard_widget returned it"),
8773
+ name: import_zod9.z.string().optional().describe("The widget's new display name"),
8774
+ code: import_zod9.z.string().optional().describe(
8652
8775
  "The widget's new TSX source. Runs sandboxed with a global LW (LW.useChartQuery(name), LW.navigate, LW.theme) in scope."
8653
8776
  ),
8654
- queries: import_zod8.z.union([
8655
- import_zod8.z.record(import_zod8.z.string(), import_zod8.z.string()).describe('{"<name>": "<LWQL SQL>"}'),
8656
- import_zod8.z.array(
8657
- import_zod8.z.object({
8658
- name: import_zod8.z.string().describe('Referenced from code as LW.useChartQuery("name")'),
8659
- sql: import_zod8.z.string().describe("The LangWatchQL statement")
8777
+ queries: import_zod9.z.union([
8778
+ import_zod9.z.record(import_zod9.z.string(), import_zod9.z.string()).describe('{"<name>": "<LWQL SQL>"}'),
8779
+ import_zod9.z.array(
8780
+ import_zod9.z.object({
8781
+ name: import_zod9.z.string().describe('Referenced from code as LW.useChartQuery("name")'),
8782
+ sql: import_zod9.z.string().describe("The LangWatchQL statement")
8660
8783
  })
8661
8784
  ).describe("Named LWQL queries, array form")
8662
8785
  ]).optional().describe(
8663
8786
  "The widget's new named LangWatchQL queries, replacing the stored set: either {name: sql} or an array of {name, sql}. Max 8."
8664
8787
  ),
8665
- description: import_zod8.z.string().optional().describe("What the widget's info tip says: a sentence or two")
8788
+ description: import_zod9.z.string().optional().describe("What the widget's info tip says: a sentence or two"),
8789
+ sources: widgetSourcesInput
8666
8790
  },
8667
8791
  withToolLogging("update_dashboard_widget", async (params) => {
8668
8792
  requireApiKey();
@@ -8672,6 +8796,78 @@ function registerDashboardTools(server) {
8672
8796
  };
8673
8797
  })
8674
8798
  );
8799
+ registerDashboardCrudTools(server);
8800
+ }
8801
+ function registerDashboardCrudTools(server) {
8802
+ const dashboardId = import_zod9.z.string().describe("The dashboard's ID, as list_dashboards lists it");
8803
+ const text = (value) => ({ content: [{ type: "text", text: value }] });
8804
+ server.tool(
8805
+ "get_dashboard",
8806
+ "Reads one dashboard in the Dashboards area: its name, scope, description and address. An Analytics Report's ID is not found here; read it with platform_get_analytics_report.",
8807
+ { dashboardId },
8808
+ withToolLogging("get_dashboard", async (params) => {
8809
+ requireApiKey();
8810
+ const { handleGetDashboard: handleGetDashboard2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8811
+ return text(await handleGetDashboard2(params));
8812
+ })
8813
+ );
8814
+ server.tool(
8815
+ "create_dashboard",
8816
+ "Creates an empty dashboard in the Dashboards area. Add widgets to it with add_dashboard_widget.",
8817
+ { name: import_zod9.z.string().describe("The dashboard's name") },
8818
+ withToolLogging("create_dashboard", async (params) => {
8819
+ requireApiKey();
8820
+ const { handleCreateDashboard: handleCreateDashboard2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8821
+ return text(await handleCreateDashboard2(params));
8822
+ })
8823
+ );
8824
+ server.tool(
8825
+ "rename_dashboard",
8826
+ "Changes a dashboard's name and/or description; a field left out keeps its value.",
8827
+ {
8828
+ dashboardId,
8829
+ name: import_zod9.z.string().optional().describe("The dashboard's new name"),
8830
+ description: import_zod9.z.string().optional().describe("The dashboard's new description")
8831
+ },
8832
+ withToolLogging("rename_dashboard", async (params) => {
8833
+ requireApiKey();
8834
+ const { handleRenameDashboard: handleRenameDashboard2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8835
+ return text(await handleRenameDashboard2(params));
8836
+ })
8837
+ );
8838
+ server.tool(
8839
+ "delete_dashboard",
8840
+ "Deletes a dashboard together with the widgets on it. This cannot be undone.",
8841
+ { dashboardId },
8842
+ withToolLogging("delete_dashboard", async (params) => {
8843
+ requireApiKey();
8844
+ const { handleDeleteDashboard: handleDeleteDashboard2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8845
+ return text(await handleDeleteDashboard2(params));
8846
+ })
8847
+ );
8848
+ server.tool(
8849
+ "list_dashboard_widgets",
8850
+ "Lists the custom widgets on one dashboard, with each widget's ID and query names.",
8851
+ { dashboardId },
8852
+ withToolLogging("list_dashboard_widgets", async (params) => {
8853
+ requireApiKey();
8854
+ const { handleListDashboardWidgets: handleListDashboardWidgets2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8855
+ return text(await handleListDashboardWidgets2(params));
8856
+ })
8857
+ );
8858
+ server.tool(
8859
+ "delete_dashboard_widget",
8860
+ "Deletes one custom widget from a dashboard. A widget on another dashboard is not found.",
8861
+ {
8862
+ dashboardId,
8863
+ widgetId: import_zod9.z.string().describe("The widget's ID, as list_dashboard_widgets lists it")
8864
+ },
8865
+ withToolLogging("delete_dashboard_widget", async (params) => {
8866
+ requireApiKey();
8867
+ const { handleDeleteDashboardWidget: handleDeleteDashboardWidget2 } = await Promise.resolve().then(() => (init_dashboards(), dashboards_exports));
8868
+ return text(await handleDeleteDashboardWidget2(params));
8869
+ })
8870
+ );
8675
8871
  }
8676
8872
  function registerWorkflowTools(server) {
8677
8873
  server.tool(
@@ -8690,7 +8886,7 @@ function registerWorkflowTools(server) {
8690
8886
  "platform_get_workflow",
8691
8887
  "Get a workflow by its ID.",
8692
8888
  {
8693
- id: import_zod8.z.string().describe("The workflow ID")
8889
+ id: import_zod9.z.string().describe("The workflow ID")
8694
8890
  },
8695
8891
  withToolLogging("platform_get_workflow", async (params) => {
8696
8892
  requireApiKey();
@@ -8704,7 +8900,7 @@ function registerWorkflowTools(server) {
8704
8900
  "platform_delete_workflow",
8705
8901
  "Archive (soft-delete) a workflow by its ID.",
8706
8902
  {
8707
- id: import_zod8.z.string().describe("The workflow ID to archive")
8903
+ id: import_zod9.z.string().describe("The workflow ID to archive")
8708
8904
  },
8709
8905
  withToolLogging("platform_delete_workflow", async (params) => {
8710
8906
  requireApiKey();
@@ -8718,8 +8914,8 @@ function registerWorkflowTools(server) {
8718
8914
  "platform_run_workflow",
8719
8915
  "Execute a workflow with JSON input. Returns the workflow output.",
8720
8916
  {
8721
- id: import_zod8.z.string().describe("The workflow ID to run"),
8722
- input: import_zod8.z.string().optional().describe("Input data as a JSON object string")
8917
+ id: import_zod9.z.string().describe("The workflow ID to run"),
8918
+ input: import_zod9.z.string().optional().describe("Input data as a JSON object string")
8723
8919
  },
8724
8920
  withToolLogging("platform_run_workflow", async (params) => {
8725
8921
  requireApiKey();
@@ -8735,7 +8931,7 @@ function registerAnnotationTools(server) {
8735
8931
  "platform_list_annotations",
8736
8932
  "List all annotations for the project, optionally filtered by trace ID.",
8737
8933
  {
8738
- traceId: import_zod8.z.string().optional().describe("Filter annotations by trace ID")
8934
+ traceId: import_zod9.z.string().optional().describe("Filter annotations by trace ID")
8739
8935
  },
8740
8936
  withToolLogging("platform_list_annotations", async (params) => {
8741
8937
  requireApiKey();
@@ -8749,10 +8945,10 @@ function registerAnnotationTools(server) {
8749
8945
  "platform_create_annotation",
8750
8946
  "Create an annotation (thumbs up/down, comment) for a trace.",
8751
8947
  {
8752
- traceId: import_zod8.z.string().describe("The trace ID to annotate"),
8753
- comment: import_zod8.z.string().optional().describe("Annotation comment"),
8754
- isThumbsUp: import_zod8.z.boolean().optional().describe("True for positive feedback, false for negative"),
8755
- email: import_zod8.z.string().optional().describe("Email of the annotator")
8948
+ traceId: import_zod9.z.string().describe("The trace ID to annotate"),
8949
+ comment: import_zod9.z.string().optional().describe("Annotation comment"),
8950
+ isThumbsUp: import_zod9.z.boolean().optional().describe("True for positive feedback, false for negative"),
8951
+ email: import_zod9.z.string().optional().describe("Email of the annotator")
8756
8952
  },
8757
8953
  withToolLogging("platform_create_annotation", async (params) => {
8758
8954
  requireApiKey();
@@ -8766,7 +8962,7 @@ function registerAnnotationTools(server) {
8766
8962
  "platform_delete_annotation",
8767
8963
  "Delete an annotation by its ID.",
8768
8964
  {
8769
- id: import_zod8.z.string().describe("The annotation ID to delete")
8965
+ id: import_zod9.z.string().describe("The annotation ID to delete")
8770
8966
  },
8771
8967
  withToolLogging("platform_delete_annotation", async (params) => {
8772
8968
  requireApiKey();
@@ -8780,7 +8976,7 @@ function registerAnnotationTools(server) {
8780
8976
  "platform_get_annotation",
8781
8977
  "Get annotation details by ID.",
8782
8978
  {
8783
- id: import_zod8.z.string().describe("The annotation ID")
8979
+ id: import_zod9.z.string().describe("The annotation ID")
8784
8980
  },
8785
8981
  withToolLogging("platform_get_annotation", async (params) => {
8786
8982
  requireApiKey();
@@ -8804,7 +9000,7 @@ function registerTriggerTools(server) {
8804
9000
  "platform_list_triggers",
8805
9001
  "List all triggers (automations) in the project. Triggers automate actions like sending emails, Slack messages, or adding to datasets when conditions are met.",
8806
9002
  {
8807
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format")
9003
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format")
8808
9004
  },
8809
9005
  withToolLogging("platform_list_triggers", async (params) => {
8810
9006
  requireApiKey();
@@ -8816,7 +9012,7 @@ function registerTriggerTools(server) {
8816
9012
  "platform_get_trigger",
8817
9013
  "Read one trigger (automation) by its ID, including its delivery configuration. Credential values come back as [redacted]; sending them back unchanged on an update keeps the stored values.",
8818
9014
  {
8819
- id: import_zod8.z.string().describe("The trigger ID")
9015
+ id: import_zod9.z.string().describe("The trigger ID")
8820
9016
  },
8821
9017
  withToolLogging("platform_get_trigger", async (params) => {
8822
9018
  requireApiKey();
@@ -8837,17 +9033,17 @@ function registerTriggerTools(server) {
8837
9033
  "The delivery channel cannot be changed afterwards."
8838
9034
  ].join("\n"),
8839
9035
  {
8840
- name: import_zod8.z.string().describe("Trigger name"),
9036
+ name: import_zod9.z.string().describe("Trigger name"),
8841
9037
  action: triggerActionSchema.describe("Which channel it delivers on"),
8842
9038
  actionParams: actionParamsSchema.optional().describe("The delivery configuration the channel named in `action` reads. Defaults to {}"),
8843
- filters: import_zod8.z.string().optional().describe(TRIGGER_FILTERS_DESCRIPTION),
8844
- filterQuery: import_zod8.z.string().optional().describe(TRIGGER_FILTER_QUERY_DESCRIPTION),
8845
- customGraphId: import_zod8.z.string().optional().describe("Set to make this an alert on that graph"),
9039
+ filters: import_zod9.z.string().optional().describe(TRIGGER_FILTERS_DESCRIPTION),
9040
+ filterQuery: import_zod9.z.string().optional().describe(TRIGGER_FILTER_QUERY_DESCRIPTION),
9041
+ customGraphId: import_zod9.z.string().optional().describe("Set to make this an alert on that graph"),
8846
9042
  graphAlert: graphAlertSchema.optional(),
8847
9043
  report: reportSchema.optional().describe("Set to make this a scheduled report"),
8848
9044
  templates: templatesSchema.optional(),
8849
9045
  notificationCadence: notificationCadenceSchema.optional(),
8850
- message: import_zod8.z.string().optional().describe("Custom alert message"),
9046
+ message: import_zod9.z.string().optional().describe("Custom alert message"),
8851
9047
  alertType: alertTypeSchema.optional().describe("Alert severity. Required for a graph alert.")
8852
9048
  },
8853
9049
  withToolLogging("platform_create_trigger", async (params) => {
@@ -8865,17 +9061,17 @@ function registerTriggerTools(server) {
8865
9061
  "The delivery channel, the kind of automation and an alert's graph cannot be changed."
8866
9062
  ].join("\n"),
8867
9063
  {
8868
- id: import_zod8.z.string().describe("The trigger ID"),
8869
- name: import_zod8.z.string().optional().describe("New name"),
8870
- active: import_zod8.z.boolean().optional().describe("Resume or pause it"),
9064
+ id: import_zod9.z.string().describe("The trigger ID"),
9065
+ name: import_zod9.z.string().optional().describe("New name"),
9066
+ active: import_zod9.z.boolean().optional().describe("Resume or pause it"),
8871
9067
  actionParams: actionParamsSchema.optional().describe("The delivery configuration this automation should have from now on"),
8872
- filters: import_zod8.z.string().optional().describe(TRIGGER_FILTERS_DESCRIPTION),
8873
- filterQuery: import_zod8.z.string().nullable().optional().describe(`${TRIGGER_FILTER_QUERY_DESCRIPTION} null clears the saved query.`),
9068
+ filters: import_zod9.z.string().optional().describe(TRIGGER_FILTERS_DESCRIPTION),
9069
+ filterQuery: import_zod9.z.string().nullable().optional().describe(`${TRIGGER_FILTER_QUERY_DESCRIPTION} null clears the saved query.`),
8874
9070
  graphAlert: graphAlertSchema.optional().describe("Only for an automation that is already a graph alert"),
8875
9071
  report: reportSchema.optional().describe("Only for an automation that is already a scheduled report"),
8876
9072
  templates: templatesSchema.optional(),
8877
9073
  notificationCadence: notificationCadenceSchema.optional(),
8878
- message: import_zod8.z.string().nullable().optional().describe("New alert message. null removes the custom message"),
9074
+ message: import_zod9.z.string().nullable().optional().describe("New alert message. null removes the custom message"),
8879
9075
  alertType: alertTypeSchema.nullable().optional().describe("New alert severity. null clears it")
8880
9076
  },
8881
9077
  withToolLogging("platform_update_trigger", async (params) => {
@@ -8909,7 +9105,7 @@ function registerTriggerTools(server) {
8909
9105
  "platform_test_fire_trigger",
8910
9106
  "Send a trigger's message to the destination it is configured with, to confirm it arrives. Nothing is recorded as a fire.",
8911
9107
  {
8912
- id: import_zod8.z.string().describe("The trigger ID")
9108
+ id: import_zod9.z.string().describe("The trigger ID")
8913
9109
  },
8914
9110
  withToolLogging("platform_test_fire_trigger", async (params) => {
8915
9111
  requireApiKey();
@@ -8922,9 +9118,9 @@ function registerTriggerTools(server) {
8922
9118
  "platform_list_trigger_fires",
8923
9119
  "What an automation has done, newest first. Metadata only \u2014 no message content. Answers with `nextCursor`; pass it back as `cursor` for the next page (null means there is none).",
8924
9120
  {
8925
- id: import_zod8.z.string().describe("The trigger ID"),
8926
- limit: import_zod8.z.number().int().positive().optional().describe("How many fires to return"),
8927
- cursor: import_zod8.z.string().optional().describe("The `nextCursor` a previous call answered with")
9121
+ id: import_zod9.z.string().describe("The trigger ID"),
9122
+ limit: import_zod9.z.number().int().positive().optional().describe("How many fires to return"),
9123
+ cursor: import_zod9.z.string().optional().describe("The `nextCursor` a previous call answered with")
8928
9124
  },
8929
9125
  withToolLogging("platform_list_trigger_fires", async (params) => {
8930
9126
  requireApiKey();
@@ -8936,7 +9132,7 @@ function registerTriggerTools(server) {
8936
9132
  "platform_delete_trigger",
8937
9133
  "Delete a trigger (automation).",
8938
9134
  {
8939
- id: import_zod8.z.string().describe("The trigger ID to delete")
9135
+ id: import_zod9.z.string().describe("The trigger ID to delete")
8940
9136
  },
8941
9137
  withToolLogging("platform_delete_trigger", async (params) => {
8942
9138
  requireApiKey();
@@ -8976,7 +9172,7 @@ ${lines.join("\n")}`
8976
9172
  "platform_get_monitor",
8977
9173
  "Get details of a specific online evaluation monitor.",
8978
9174
  {
8979
- id: import_zod8.z.string().describe("The monitor ID")
9175
+ id: import_zod9.z.string().describe("The monitor ID")
8980
9176
  },
8981
9177
  withToolLogging("platform_get_monitor", async (params) => {
8982
9178
  requireApiKey();
@@ -8999,11 +9195,11 @@ ${lines.join("\n")}`
8999
9195
  "platform_create_monitor",
9000
9196
  "Create a new online evaluation monitor that runs an evaluator on incoming traces.",
9001
9197
  {
9002
- name: import_zod8.z.string().describe("Monitor name"),
9003
- checkType: import_zod8.z.string().describe("Evaluator check type (e.g. ragas/toxicity, custom/my-eval)"),
9004
- executionMode: import_zod8.z.enum(["ON_MESSAGE", "AS_GUARDRAIL", "MANUALLY"]).optional().describe("When to run: ON_MESSAGE (default), AS_GUARDRAIL, or MANUALLY"),
9005
- sample: import_zod8.z.number().min(0).max(1).optional().describe("Sampling rate 0.0-1.0 (default: 1.0)"),
9006
- evaluatorId: import_zod8.z.string().optional().describe("Link to a saved evaluator by ID")
9198
+ name: import_zod9.z.string().describe("Monitor name"),
9199
+ checkType: import_zod9.z.string().describe("Evaluator check type (e.g. ragas/toxicity, custom/my-eval)"),
9200
+ executionMode: import_zod9.z.enum(["ON_MESSAGE", "AS_GUARDRAIL", "MANUALLY"]).optional().describe("When to run: ON_MESSAGE (default), AS_GUARDRAIL, or MANUALLY"),
9201
+ sample: import_zod9.z.number().min(0).max(1).optional().describe("Sampling rate 0.0-1.0 (default: 1.0)"),
9202
+ evaluatorId: import_zod9.z.string().optional().describe("Link to a saved evaluator by ID")
9007
9203
  },
9008
9204
  withToolLogging("platform_create_monitor", async (params) => {
9009
9205
  requireApiKey();
@@ -9023,11 +9219,11 @@ ${lines.join("\n")}`
9023
9219
  "platform_update_monitor",
9024
9220
  "Update an existing online evaluation monitor.",
9025
9221
  {
9026
- id: import_zod8.z.string().describe("The monitor ID to update"),
9027
- name: import_zod8.z.string().optional().describe("New monitor name"),
9028
- enabled: import_zod8.z.boolean().optional().describe("Enable or disable the monitor"),
9029
- executionMode: import_zod8.z.enum(["ON_MESSAGE", "AS_GUARDRAIL", "MANUALLY"]).optional().describe("New execution mode"),
9030
- sample: import_zod8.z.number().min(0).max(1).optional().describe("New sampling rate")
9222
+ id: import_zod9.z.string().describe("The monitor ID to update"),
9223
+ name: import_zod9.z.string().optional().describe("New monitor name"),
9224
+ enabled: import_zod9.z.boolean().optional().describe("Enable or disable the monitor"),
9225
+ executionMode: import_zod9.z.enum(["ON_MESSAGE", "AS_GUARDRAIL", "MANUALLY"]).optional().describe("New execution mode"),
9226
+ sample: import_zod9.z.number().min(0).max(1).optional().describe("New sampling rate")
9031
9227
  },
9032
9228
  withToolLogging("platform_update_monitor", async (params) => {
9033
9229
  requireApiKey();
@@ -9047,7 +9243,7 @@ ${lines.join("\n")}`
9047
9243
  "platform_delete_monitor",
9048
9244
  "Delete an online evaluation monitor.",
9049
9245
  {
9050
- id: import_zod8.z.string().describe("The monitor ID to delete")
9246
+ id: import_zod9.z.string().describe("The monitor ID to delete")
9051
9247
  },
9052
9248
  withToolLogging("platform_delete_monitor", async (params) => {
9053
9249
  requireApiKey();
@@ -9087,8 +9283,8 @@ ${lines.join("\n")}`
9087
9283
  "platform_create_secret",
9088
9284
  "Create a new encrypted project secret. Name must be UPPER_SNAKE_CASE (e.g. MY_API_KEY).",
9089
9285
  {
9090
- name: import_zod8.z.string().describe("Secret name in UPPER_SNAKE_CASE (e.g. OPENAI_API_KEY)"),
9091
- value: import_zod8.z.string().describe("The secret value (will be encrypted at rest)")
9286
+ name: import_zod9.z.string().describe("Secret name in UPPER_SNAKE_CASE (e.g. OPENAI_API_KEY)"),
9287
+ value: import_zod9.z.string().describe("The secret value (will be encrypted at rest)")
9092
9288
  },
9093
9289
  withToolLogging("platform_create_secret", async (params) => {
9094
9290
  requireApiKey();
@@ -9108,8 +9304,8 @@ ${lines.join("\n")}`
9108
9304
  "platform_update_secret",
9109
9305
  "Update an existing project secret's value.",
9110
9306
  {
9111
- id: import_zod8.z.string().describe("The secret ID to update"),
9112
- value: import_zod8.z.string().describe("The new secret value (will be encrypted at rest)")
9307
+ id: import_zod9.z.string().describe("The secret ID to update"),
9308
+ value: import_zod9.z.string().describe("The new secret value (will be encrypted at rest)")
9113
9309
  },
9114
9310
  withToolLogging("platform_update_secret", async (params) => {
9115
9311
  requireApiKey();
@@ -9129,7 +9325,7 @@ ${lines.join("\n")}`
9129
9325
  "platform_delete_secret",
9130
9326
  "Delete a project secret.",
9131
9327
  {
9132
- id: import_zod8.z.string().describe("The secret ID to delete")
9328
+ id: import_zod9.z.string().describe("The secret ID to delete")
9133
9329
  },
9134
9330
  withToolLogging("platform_delete_secret", async (params) => {
9135
9331
  requireApiKey();
@@ -9144,7 +9340,10 @@ function registerExperimentTools(server) {
9144
9340
  "platform_run_experiment",
9145
9341
  "Start an experiment run by slug. Returns a run ID for polling status.",
9146
9342
  {
9147
- slug: import_zod8.z.string().describe("The experiment slug to run")
9343
+ slug: import_zod9.z.string().describe("The experiment slug to run"),
9344
+ concurrency: import_zod9.z.number().int().min(1).max(24).optional().describe(
9345
+ "Cells (one row against one target) to run at once, for this run only (default: the server's setting). Use 1 to run them one at a time, in order."
9346
+ )
9148
9347
  },
9149
9348
  withToolLogging("platform_run_experiment", async (params) => {
9150
9349
  requireApiKey();
@@ -9157,8 +9356,8 @@ function registerExperimentTools(server) {
9157
9356
  "platform_experiment_status",
9158
9357
  "Check the status of an experiment run (running, completed, stopped, or interrupted) plus its progress. Works for both platform-run and SDK-logged experiments; pass experimentSlug for SDK runs or runs older than 24h.",
9159
9358
  {
9160
- runId: import_zod8.z.string().describe("The run ID returned from platform_run_experiment"),
9161
- experimentSlug: import_zod8.z.string().optional().describe(
9359
+ runId: import_zod9.z.string().describe("The run ID returned from platform_run_experiment"),
9360
+ experimentSlug: import_zod9.z.string().optional().describe(
9162
9361
  "Experiment slug \u2014 required for SDK-logged runs and runs older than 24h (the Redis run-state they would otherwise be read from is absent/expired). Use platform_experiment_list_runs to find the slug."
9163
9362
  )
9164
9363
  },
@@ -9173,7 +9372,7 @@ function registerExperimentTools(server) {
9173
9372
  "platform_experiment_list",
9174
9373
  "List experiments configured in the LangWatch project. Returns a markdown table with each experiment's slug, name, last-run timestamp, and run count. Use this to discover experiment slugs before drilling into runs with platform_experiment_list_runs. Output is capped (default 25, max 100) to protect the agent's context window.",
9175
9374
  {
9176
- limit: import_zod8.z.number().int().positive().max(100).optional().describe("Maximum number of experiments to include (default 25, hard-capped at 100)")
9375
+ limit: import_zod9.z.number().int().positive().max(100).optional().describe("Maximum number of experiments to include (default 25, hard-capped at 100)")
9177
9376
  },
9178
9377
  withToolLogging("platform_experiment_list", async (params) => {
9179
9378
  requireApiKey();
@@ -9186,8 +9385,8 @@ function registerExperimentTools(server) {
9186
9385
  "platform_experiment_list_runs",
9187
9386
  "List experiment runs for a specific experiment slug. Returns a markdown table with each run's id, status, started/finished timestamps, and pass-rate summary. Use this to discover run ids before calling platform_experiment_results. Output is capped (default 25, max 100) to protect the agent's context window.",
9188
9387
  {
9189
- experimentSlug: import_zod8.z.string().describe("Experiment slug from platform_experiment_list (e.g. 'checkout-flow')"),
9190
- limit: import_zod8.z.number().int().positive().max(100).optional().describe("Maximum number of runs to include (default 25, hard-capped at 100)")
9388
+ experimentSlug: import_zod9.z.string().describe("Experiment slug from platform_experiment_list (e.g. 'checkout-flow')"),
9389
+ limit: import_zod9.z.number().int().positive().max(100).optional().describe("Maximum number of runs to include (default 25, hard-capped at 100)")
9191
9390
  },
9192
9391
  withToolLogging("platform_experiment_list_runs", async (params) => {
9193
9392
  requireApiKey();
@@ -9200,15 +9399,15 @@ function registerExperimentTools(server) {
9200
9399
  "platform_experiment_results",
9201
9400
  "Fetch per-row results for an experiment run so you can debug evaluator scores and missed rows. Serves partial results for runs that are still running or were interrupted (it does not require a completed run), with the run status noted in the output. Returns a markdown report: per-evaluator averages plus row-by-row scores and failure details. Output is capped at 50 rows to protect the agent's context window \u2014 narrow with `filter: 'failed'` or `evaluator` to see what matters.",
9202
9401
  {
9203
- runId: import_zod8.z.string().describe("The run ID returned from platform_run_experiment"),
9204
- experimentSlug: import_zod8.z.string().optional().describe(
9402
+ runId: import_zod9.z.string().describe("The run ID returned from platform_run_experiment"),
9403
+ experimentSlug: import_zod9.z.string().optional().describe(
9205
9404
  "Experiment slug \u2014 required when fetching results for runs older than 24h (Redis state may have expired). Use platform_experiment_list_runs to find the slug."
9206
9405
  ),
9207
- filter: import_zod8.z.enum(["all", "failed"]).optional().describe(
9406
+ filter: import_zod9.z.enum(["all", "failed"]).optional().describe(
9208
9407
  "Filter rows: 'failed' shows only rows that errored or failed an evaluation; 'all' (default) shows everything"
9209
9408
  ),
9210
- evaluator: import_zod8.z.string().optional().describe("Show only this evaluator's results (matched on `evaluator` field)"),
9211
- limit: import_zod8.z.number().int().positive().max(50).optional().describe(
9409
+ evaluator: import_zod9.z.string().optional().describe("Show only this evaluator's results (matched on `evaluator` field)"),
9410
+ limit: import_zod9.z.number().int().positive().max(50).optional().describe(
9212
9411
  "Maximum number of rows to include in the markdown output (default 50, hard-capped at 50)."
9213
9412
  )
9214
9413
  },
@@ -9225,7 +9424,7 @@ function registerDatasetTools(server) {
9225
9424
  "platform_list_datasets",
9226
9425
  "List all datasets on the LangWatch platform with their names, slugs, columns, and record counts. Returns AI-readable digest by default.",
9227
9426
  {
9228
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9427
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9229
9428
  },
9230
9429
  async (params) => {
9231
9430
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9240,8 +9439,8 @@ function registerDatasetTools(server) {
9240
9439
  "platform_get_dataset",
9241
9440
  "Get full details of a dataset on the LangWatch platform by slug or ID, including column definitions and a preview of records.",
9242
9441
  {
9243
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID to retrieve"),
9244
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9442
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID to retrieve"),
9443
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9245
9444
  },
9246
9445
  async (params) => {
9247
9446
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9269,9 +9468,9 @@ function registerDatasetTools(server) {
9269
9468
  "platform_update_dataset",
9270
9469
  "Update an existing dataset on the LangWatch platform (name and/or column types).",
9271
9470
  {
9272
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID to update"),
9273
- name: import_zod8.z.string().optional().describe("Updated dataset name"),
9274
- columnTypes: import_zod8.z.array(datasetColumnDefinitionSchema).optional().describe("Updated column definitions")
9471
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID to update"),
9472
+ name: import_zod9.z.string().optional().describe("Updated dataset name"),
9473
+ columnTypes: import_zod9.z.array(datasetColumnDefinitionSchema).optional().describe("Updated column definitions")
9275
9474
  },
9276
9475
  async (params) => {
9277
9476
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9286,7 +9485,7 @@ function registerDatasetTools(server) {
9286
9485
  "platform_delete_dataset",
9287
9486
  "Delete (archive) a dataset on the LangWatch platform.",
9288
9487
  {
9289
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID to delete")
9488
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID to delete")
9290
9489
  },
9291
9490
  async (params) => {
9292
9491
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9301,10 +9500,10 @@ function registerDatasetTools(server) {
9301
9500
  "platform_list_dataset_records",
9302
9501
  "List records in a dataset on the LangWatch platform with pagination.",
9303
9502
  {
9304
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID to list records from"),
9305
- page: import_zod8.z.number().int().min(1).optional().describe("Page number (default: 1)"),
9306
- limit: import_zod8.z.number().int().min(1).max(1e3).optional().describe("Records per page (default: 50, max: 1000)"),
9307
- format: import_zod8.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9503
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID to list records from"),
9504
+ page: import_zod9.z.number().int().min(1).optional().describe("Page number (default: 1)"),
9505
+ limit: import_zod9.z.number().int().min(1).max(1e3).optional().describe("Records per page (default: 50, max: 1000)"),
9506
+ format: import_zod9.z.enum(["digest", "json"]).optional().describe("Output format: 'digest' (default, AI-readable) or 'json' (full raw data)")
9308
9507
  },
9309
9508
  async (params) => {
9310
9509
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9319,8 +9518,8 @@ function registerDatasetTools(server) {
9319
9518
  "platform_create_dataset_records",
9320
9519
  "Add records to a dataset on the LangWatch platform in batch (max 1000 per call).",
9321
9520
  {
9322
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID to add records to"),
9323
- entries: import_zod8.z.array(import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown())).min(1).max(1e3).describe("Array of record entries to create (key-value objects matching dataset columns)")
9521
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID to add records to"),
9522
+ entries: import_zod9.z.array(import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown())).min(1).max(1e3).describe("Array of record entries to create (key-value objects matching dataset columns)")
9324
9523
  },
9325
9524
  async (params) => {
9326
9525
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9335,9 +9534,9 @@ function registerDatasetTools(server) {
9335
9534
  "platform_update_dataset_record",
9336
9535
  "Update a single record in a dataset on the LangWatch platform.",
9337
9536
  {
9338
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID containing the record"),
9339
- recordId: import_zod8.z.string().describe("The record ID to update"),
9340
- entry: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.unknown()).describe("Updated record entry (key-value object)")
9537
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID containing the record"),
9538
+ recordId: import_zod9.z.string().describe("The record ID to update"),
9539
+ entry: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown()).describe("Updated record entry (key-value object)")
9341
9540
  },
9342
9541
  async (params) => {
9343
9542
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9352,8 +9551,8 @@ function registerDatasetTools(server) {
9352
9551
  "platform_delete_dataset_records",
9353
9552
  "Delete records from a dataset on the LangWatch platform by their IDs.",
9354
9553
  {
9355
- slugOrId: import_zod8.z.string().describe("The dataset slug or ID containing the records"),
9356
- recordIds: import_zod8.z.array(import_zod8.z.string()).min(1).max(1e3).describe("Array of record IDs to delete")
9554
+ slugOrId: import_zod9.z.string().describe("The dataset slug or ID containing the records"),
9555
+ recordIds: import_zod9.z.array(import_zod9.z.string()).min(1).max(1e3).describe("Array of record IDs to delete")
9357
9556
  },
9358
9557
  async (params) => {
9359
9558
  const { requireApiKey: requireApiKey2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -9370,8 +9569,8 @@ function registerProjectTools(server) {
9370
9569
  "platform_list_projects",
9371
9570
  "List all projects in your LangWatch organization. Requires an org-level API key.",
9372
9571
  {
9373
- page: import_zod8.z.number().int().positive().optional().describe("Page number (default: 1)"),
9374
- limit: import_zod8.z.number().int().positive().max(1e3).optional().describe("Results per page (default: 100)")
9572
+ page: import_zod9.z.number().int().positive().optional().describe("Page number (default: 1)"),
9573
+ limit: import_zod9.z.number().int().positive().max(1e3).optional().describe("Results per page (default: 100)")
9375
9574
  },
9376
9575
  withToolLogging("platform_list_projects", async (params) => {
9377
9576
  requireApiKey();
@@ -9385,7 +9584,7 @@ function registerProjectTools(server) {
9385
9584
  "platform_get_project",
9386
9585
  "Get details of a specific project by its ID.",
9387
9586
  {
9388
- id: import_zod8.z.string().describe("The project ID")
9587
+ id: import_zod9.z.string().describe("The project ID")
9389
9588
  },
9390
9589
  withToolLogging("platform_get_project", async (params) => {
9391
9590
  requireApiKey();
@@ -9401,11 +9600,11 @@ function registerProjectTools(server) {
9401
9600
 
9402
9601
  You must provide either teamId (to add the project to an existing team) or newTeamName (to create a new team for the project).`,
9403
9602
  {
9404
- name: import_zod8.z.string().describe("Project name"),
9405
- language: import_zod8.z.string().describe('Programming language (e.g. "python", "typescript")'),
9406
- framework: import_zod8.z.string().describe('Framework (e.g. "openai", "langchain", "custom")'),
9407
- teamId: import_zod8.z.string().optional().describe("ID of an existing team to add the project to"),
9408
- newTeamName: import_zod8.z.string().optional().describe("Name for a new team to create for this project")
9603
+ name: import_zod9.z.string().describe("Project name"),
9604
+ language: import_zod9.z.string().describe('Programming language (e.g. "python", "typescript")'),
9605
+ framework: import_zod9.z.string().describe('Framework (e.g. "openai", "langchain", "custom")'),
9606
+ teamId: import_zod9.z.string().optional().describe("ID of an existing team to add the project to"),
9607
+ newTeamName: import_zod9.z.string().optional().describe("Name for a new team to create for this project")
9409
9608
  },
9410
9609
  withToolLogging("platform_create_project", async (params) => {
9411
9610
  requireApiKey();
@@ -9419,11 +9618,11 @@ You must provide either teamId (to add the project to an existing team) or newTe
9419
9618
  "platform_update_project",
9420
9619
  "Update an existing project's name, language, framework, or PII redaction level.",
9421
9620
  {
9422
- id: import_zod8.z.string().describe("The project ID to update"),
9423
- name: import_zod8.z.string().optional().describe("New project name"),
9424
- language: import_zod8.z.string().optional().describe("New programming language"),
9425
- framework: import_zod8.z.string().optional().describe("New framework"),
9426
- piiRedactionLevel: import_zod8.z.enum(["STRICT", "ESSENTIAL", "DISABLED"]).optional().describe("PII redaction level")
9621
+ id: import_zod9.z.string().describe("The project ID to update"),
9622
+ name: import_zod9.z.string().optional().describe("New project name"),
9623
+ language: import_zod9.z.string().optional().describe("New programming language"),
9624
+ framework: import_zod9.z.string().optional().describe("New framework"),
9625
+ piiRedactionLevel: import_zod9.z.enum(["STRICT", "ESSENTIAL", "DISABLED"]).optional().describe("PII redaction level")
9427
9626
  },
9428
9627
  withToolLogging("platform_update_project", async (params) => {
9429
9628
  requireApiKey();
@@ -9437,7 +9636,7 @@ You must provide either teamId (to add the project to an existing team) or newTe
9437
9636
  "platform_archive_project",
9438
9637
  "Archive (soft-delete) a project. The project can be restored later if needed.",
9439
9638
  {
9440
- id: import_zod8.z.string().describe("The project ID to archive")
9639
+ id: import_zod9.z.string().describe("The project ID to archive")
9441
9640
  },
9442
9641
  withToolLogging("platform_archive_project", async (params) => {
9443
9642
  requireApiKey();
@@ -9470,18 +9669,18 @@ function registerApiKeyTools(server) {
9470
9669
 
9471
9670
  The token is returned once and cannot be retrieved again.`,
9472
9671
  {
9473
- keyType: import_zod8.z.enum(["personal", "service"]).describe("Key type: 'personal' (user-tied) or 'service' (headless)"),
9474
- name: import_zod8.z.string().describe("Key name (max 100 chars)"),
9475
- description: import_zod8.z.string().optional().describe("Key description (max 500 chars)"),
9476
- expiresAt: import_zod8.z.string().optional().describe("Expiration date (ISO string)"),
9477
- bindings: import_zod8.z.array(
9478
- import_zod8.z.object({
9479
- role: import_zod8.z.enum(["ADMIN", "MEMBER", "VIEWER"]).describe("Role"),
9480
- scopeType: import_zod8.z.enum(["ORGANIZATION", "TEAM", "PROJECT"]).describe("Scope type"),
9481
- scopeId: import_zod8.z.string().describe("Scope ID (org, team, or project ID)")
9672
+ keyType: import_zod9.z.enum(["personal", "service"]).describe("Key type: 'personal' (user-tied) or 'service' (headless)"),
9673
+ name: import_zod9.z.string().describe("Key name (max 100 chars)"),
9674
+ description: import_zod9.z.string().optional().describe("Key description (max 500 chars)"),
9675
+ expiresAt: import_zod9.z.string().optional().describe("Expiration date (ISO string)"),
9676
+ bindings: import_zod9.z.array(
9677
+ import_zod9.z.object({
9678
+ role: import_zod9.z.enum(["ADMIN", "MEMBER", "VIEWER"]).describe("Role"),
9679
+ scopeType: import_zod9.z.enum(["ORGANIZATION", "TEAM", "PROJECT"]).describe("Scope type"),
9680
+ scopeId: import_zod9.z.string().describe("Scope ID (org, team, or project ID)")
9482
9681
  })
9483
9682
  ).optional().describe("Role bindings (required for personal keys)"),
9484
- projectIds: import_zod8.z.array(import_zod8.z.string()).optional().describe("Project IDs for service keys (creates ADMIN bindings per project)")
9683
+ projectIds: import_zod9.z.array(import_zod9.z.string()).optional().describe("Project IDs for service keys (creates ADMIN bindings per project)")
9485
9684
  },
9486
9685
  withToolLogging("platform_create_api_key", async (params) => {
9487
9686
  requireApiKey();
@@ -9495,7 +9694,7 @@ The token is returned once and cannot be retrieved again.`,
9495
9694
  "platform_revoke_api_key",
9496
9695
  "Revoke an API key. Once revoked, the key can no longer be used for authentication.",
9497
9696
  {
9498
- id: import_zod8.z.string().describe("The API key ID to revoke")
9697
+ id: import_zod9.z.string().describe("The API key ID to revoke")
9499
9698
  },
9500
9699
  withToolLogging("platform_revoke_api_key", async (params) => {
9501
9700
  requireApiKey();