scorecard-ai-mcp 2.6.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 (402) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +76 -194
  3. package/code-tool-types.d.mts +7 -9
  4. package/code-tool-types.d.mts.map +1 -1
  5. package/code-tool-types.d.ts +7 -9
  6. package/code-tool-types.d.ts.map +1 -1
  7. package/code-tool.d.mts +2 -44
  8. package/code-tool.d.mts.map +1 -1
  9. package/code-tool.d.ts +2 -44
  10. package/code-tool.d.ts.map +1 -1
  11. package/code-tool.js +60 -8
  12. package/code-tool.js.map +1 -1
  13. package/code-tool.mjs +61 -9
  14. package/code-tool.mjs.map +1 -1
  15. package/docs-search-tool.d.mts +4 -3
  16. package/docs-search-tool.d.mts.map +1 -1
  17. package/docs-search-tool.d.ts +4 -3
  18. package/docs-search-tool.d.ts.map +1 -1
  19. package/docs-search-tool.js +2 -1
  20. package/docs-search-tool.js.map +1 -1
  21. package/docs-search-tool.mjs +2 -1
  22. package/docs-search-tool.mjs.map +1 -1
  23. package/http.d.mts.map +1 -1
  24. package/http.d.ts.map +1 -1
  25. package/http.js +2 -22
  26. package/http.js.map +1 -1
  27. package/http.mjs +2 -22
  28. package/http.mjs.map +1 -1
  29. package/index.js +4 -40
  30. package/index.js.map +1 -1
  31. package/index.mjs +4 -40
  32. package/index.mjs.map +1 -1
  33. package/options.d.mts +0 -9
  34. package/options.d.mts.map +1 -1
  35. package/options.d.ts +0 -9
  36. package/options.d.ts.map +1 -1
  37. package/options.js +6 -361
  38. package/options.js.map +1 -1
  39. package/options.mjs +6 -361
  40. package/options.mjs.map +1 -1
  41. package/package.json +11 -51
  42. package/server.d.mts +3 -8
  43. package/server.d.mts.map +1 -1
  44. package/server.d.ts +3 -8
  45. package/server.d.ts.map +1 -1
  46. package/server.js +12 -65
  47. package/server.js.map +1 -1
  48. package/server.mjs +11 -62
  49. package/server.mjs.map +1 -1
  50. package/src/code-tool-types.ts +7 -9
  51. package/src/code-tool.ts +66 -12
  52. package/src/docs-search-tool.ts +2 -1
  53. package/src/http.ts +3 -24
  54. package/src/index.ts +5 -52
  55. package/src/options.ts +7 -388
  56. package/src/server.ts +12 -72
  57. package/src/stdio.ts +2 -3
  58. package/src/{tools/types.ts → types.ts} +1 -1
  59. package/stdio.d.mts +1 -2
  60. package/stdio.d.mts.map +1 -1
  61. package/stdio.d.ts +1 -2
  62. package/stdio.d.ts.map +1 -1
  63. package/stdio.js +2 -2
  64. package/stdio.js.map +1 -1
  65. package/stdio.mjs +2 -2
  66. package/stdio.mjs.map +1 -1
  67. package/{tools/types.d.mts → types.d.mts} +1 -1
  68. package/types.d.mts.map +1 -0
  69. package/{tools/types.d.ts → types.d.ts} +1 -1
  70. package/types.d.ts.map +1 -0
  71. package/types.js.map +1 -0
  72. package/types.mjs.map +1 -0
  73. package/compat.d.mts +0 -58
  74. package/compat.d.mts.map +0 -1
  75. package/compat.d.ts +0 -58
  76. package/compat.d.ts.map +0 -1
  77. package/compat.js +0 -387
  78. package/compat.js.map +0 -1
  79. package/compat.mjs +0 -378
  80. package/compat.mjs.map +0 -1
  81. package/dynamic-tools.d.mts +0 -12
  82. package/dynamic-tools.d.mts.map +0 -1
  83. package/dynamic-tools.d.ts +0 -12
  84. package/dynamic-tools.d.ts.map +0 -1
  85. package/dynamic-tools.js +0 -135
  86. package/dynamic-tools.js.map +0 -1
  87. package/dynamic-tools.mjs +0 -132
  88. package/dynamic-tools.mjs.map +0 -1
  89. package/filtering.d.mts +0 -3
  90. package/filtering.d.mts.map +0 -1
  91. package/filtering.d.ts +0 -3
  92. package/filtering.d.ts.map +0 -1
  93. package/filtering.js +0 -24
  94. package/filtering.js.map +0 -1
  95. package/filtering.mjs +0 -16
  96. package/filtering.mjs.map +0 -1
  97. package/src/compat.ts +0 -483
  98. package/src/dynamic-tools.ts +0 -159
  99. package/src/filtering.ts +0 -18
  100. package/src/tools/index.ts +0 -131
  101. package/src/tools/metrics/create-metrics.ts +0 -383
  102. package/src/tools/metrics/delete-metrics.ts +0 -54
  103. package/src/tools/metrics/get-metrics.ts +0 -46
  104. package/src/tools/metrics/list-metrics.ts +0 -58
  105. package/src/tools/metrics/update-metrics.ts +0 -383
  106. package/src/tools/projects/create-projects.ts +0 -57
  107. package/src/tools/projects/list-projects.ts +0 -62
  108. package/src/tools/records/create-records.ts +0 -71
  109. package/src/tools/records/delete-records.ts +0 -54
  110. package/src/tools/records/list-records.ts +0 -65
  111. package/src/tools/runs/create-runs.ts +0 -67
  112. package/src/tools/runs/get-runs.ts +0 -54
  113. package/src/tools/runs/list-runs.ts +0 -65
  114. package/src/tools/scores/upsert-scores.ts +0 -65
  115. package/src/tools/systems/delete-systems.ts +0 -54
  116. package/src/tools/systems/get-systems.ts +0 -54
  117. package/src/tools/systems/list-systems.ts +0 -65
  118. package/src/tools/systems/update-systems.ts +0 -64
  119. package/src/tools/systems/upsert-systems.ts +0 -66
  120. package/src/tools/systems/versions/get-systems-versions.ts +0 -56
  121. package/src/tools/systems/versions/upsert-systems-versions.ts +0 -64
  122. package/src/tools/testcases/create-testcases.ts +0 -67
  123. package/src/tools/testcases/delete-testcases.ts +0 -56
  124. package/src/tools/testcases/get-testcases.ts +0 -54
  125. package/src/tools/testcases/list-testcases.ts +0 -65
  126. package/src/tools/testcases/update-testcases.ts +0 -59
  127. package/src/tools/testsets/create-testsets.ts +0 -94
  128. package/src/tools/testsets/delete-testsets.ts +0 -54
  129. package/src/tools/testsets/get-testsets.ts +0 -54
  130. package/src/tools/testsets/list-testsets.ts +0 -65
  131. package/src/tools/testsets/update-testsets.ts +0 -94
  132. package/src/tools.ts +0 -1
  133. package/tools/index.d.mts +0 -10
  134. package/tools/index.d.mts.map +0 -1
  135. package/tools/index.d.ts +0 -10
  136. package/tools/index.d.ts.map +0 -1
  137. package/tools/index.js +0 -115
  138. package/tools/index.js.map +0 -1
  139. package/tools/index.mjs +0 -108
  140. package/tools/index.mjs.map +0 -1
  141. package/tools/metrics/create-metrics.d.mts +0 -51
  142. package/tools/metrics/create-metrics.d.mts.map +0 -1
  143. package/tools/metrics/create-metrics.d.ts +0 -51
  144. package/tools/metrics/create-metrics.d.ts.map +0 -1
  145. package/tools/metrics/create-metrics.js +0 -381
  146. package/tools/metrics/create-metrics.js.map +0 -1
  147. package/tools/metrics/create-metrics.mjs +0 -374
  148. package/tools/metrics/create-metrics.mjs.map +0 -1
  149. package/tools/metrics/delete-metrics.d.mts +0 -51
  150. package/tools/metrics/delete-metrics.d.mts.map +0 -1
  151. package/tools/metrics/delete-metrics.d.ts +0 -51
  152. package/tools/metrics/delete-metrics.d.ts.map +0 -1
  153. package/tools/metrics/delete-metrics.js +0 -54
  154. package/tools/metrics/delete-metrics.js.map +0 -1
  155. package/tools/metrics/delete-metrics.mjs +0 -47
  156. package/tools/metrics/delete-metrics.mjs.map +0 -1
  157. package/tools/metrics/get-metrics.d.mts +0 -51
  158. package/tools/metrics/get-metrics.d.mts.map +0 -1
  159. package/tools/metrics/get-metrics.d.ts +0 -51
  160. package/tools/metrics/get-metrics.d.ts.map +0 -1
  161. package/tools/metrics/get-metrics.js +0 -48
  162. package/tools/metrics/get-metrics.js.map +0 -1
  163. package/tools/metrics/get-metrics.mjs +0 -41
  164. package/tools/metrics/get-metrics.mjs.map +0 -1
  165. package/tools/metrics/list-metrics.d.mts +0 -51
  166. package/tools/metrics/list-metrics.d.mts.map +0 -1
  167. package/tools/metrics/list-metrics.d.ts +0 -51
  168. package/tools/metrics/list-metrics.d.ts.map +0 -1
  169. package/tools/metrics/list-metrics.js +0 -57
  170. package/tools/metrics/list-metrics.js.map +0 -1
  171. package/tools/metrics/list-metrics.mjs +0 -50
  172. package/tools/metrics/list-metrics.mjs.map +0 -1
  173. package/tools/metrics/update-metrics.d.mts +0 -51
  174. package/tools/metrics/update-metrics.d.mts.map +0 -1
  175. package/tools/metrics/update-metrics.d.ts +0 -51
  176. package/tools/metrics/update-metrics.d.ts.map +0 -1
  177. package/tools/metrics/update-metrics.js +0 -381
  178. package/tools/metrics/update-metrics.js.map +0 -1
  179. package/tools/metrics/update-metrics.mjs +0 -374
  180. package/tools/metrics/update-metrics.mjs.map +0 -1
  181. package/tools/projects/create-projects.d.mts +0 -51
  182. package/tools/projects/create-projects.d.mts.map +0 -1
  183. package/tools/projects/create-projects.d.ts +0 -51
  184. package/tools/projects/create-projects.d.ts.map +0 -1
  185. package/tools/projects/create-projects.js +0 -57
  186. package/tools/projects/create-projects.js.map +0 -1
  187. package/tools/projects/create-projects.mjs +0 -50
  188. package/tools/projects/create-projects.mjs.map +0 -1
  189. package/tools/projects/list-projects.d.mts +0 -51
  190. package/tools/projects/list-projects.d.mts.map +0 -1
  191. package/tools/projects/list-projects.d.ts +0 -51
  192. package/tools/projects/list-projects.d.ts.map +0 -1
  193. package/tools/projects/list-projects.js +0 -60
  194. package/tools/projects/list-projects.js.map +0 -1
  195. package/tools/projects/list-projects.mjs +0 -53
  196. package/tools/projects/list-projects.mjs.map +0 -1
  197. package/tools/records/create-records.d.mts +0 -51
  198. package/tools/records/create-records.d.mts.map +0 -1
  199. package/tools/records/create-records.d.ts +0 -51
  200. package/tools/records/create-records.d.ts.map +0 -1
  201. package/tools/records/create-records.js +0 -71
  202. package/tools/records/create-records.js.map +0 -1
  203. package/tools/records/create-records.mjs +0 -64
  204. package/tools/records/create-records.mjs.map +0 -1
  205. package/tools/records/delete-records.d.mts +0 -51
  206. package/tools/records/delete-records.d.mts.map +0 -1
  207. package/tools/records/delete-records.d.ts +0 -51
  208. package/tools/records/delete-records.d.ts.map +0 -1
  209. package/tools/records/delete-records.js +0 -54
  210. package/tools/records/delete-records.js.map +0 -1
  211. package/tools/records/delete-records.mjs +0 -47
  212. package/tools/records/delete-records.mjs.map +0 -1
  213. package/tools/records/list-records.d.mts +0 -51
  214. package/tools/records/list-records.d.mts.map +0 -1
  215. package/tools/records/list-records.d.ts +0 -51
  216. package/tools/records/list-records.d.ts.map +0 -1
  217. package/tools/records/list-records.js +0 -63
  218. package/tools/records/list-records.js.map +0 -1
  219. package/tools/records/list-records.mjs +0 -56
  220. package/tools/records/list-records.mjs.map +0 -1
  221. package/tools/runs/create-runs.d.mts +0 -51
  222. package/tools/runs/create-runs.d.mts.map +0 -1
  223. package/tools/runs/create-runs.d.ts +0 -51
  224. package/tools/runs/create-runs.d.ts.map +0 -1
  225. package/tools/runs/create-runs.js +0 -67
  226. package/tools/runs/create-runs.js.map +0 -1
  227. package/tools/runs/create-runs.mjs +0 -60
  228. package/tools/runs/create-runs.mjs.map +0 -1
  229. package/tools/runs/get-runs.d.mts +0 -51
  230. package/tools/runs/get-runs.d.mts.map +0 -1
  231. package/tools/runs/get-runs.d.ts +0 -51
  232. package/tools/runs/get-runs.d.ts.map +0 -1
  233. package/tools/runs/get-runs.js +0 -54
  234. package/tools/runs/get-runs.js.map +0 -1
  235. package/tools/runs/get-runs.mjs +0 -47
  236. package/tools/runs/get-runs.mjs.map +0 -1
  237. package/tools/runs/list-runs.d.mts +0 -51
  238. package/tools/runs/list-runs.d.mts.map +0 -1
  239. package/tools/runs/list-runs.d.ts +0 -51
  240. package/tools/runs/list-runs.d.ts.map +0 -1
  241. package/tools/runs/list-runs.js +0 -63
  242. package/tools/runs/list-runs.js.map +0 -1
  243. package/tools/runs/list-runs.mjs +0 -56
  244. package/tools/runs/list-runs.mjs.map +0 -1
  245. package/tools/scores/upsert-scores.d.mts +0 -51
  246. package/tools/scores/upsert-scores.d.mts.map +0 -1
  247. package/tools/scores/upsert-scores.d.ts +0 -51
  248. package/tools/scores/upsert-scores.d.ts.map +0 -1
  249. package/tools/scores/upsert-scores.js +0 -62
  250. package/tools/scores/upsert-scores.js.map +0 -1
  251. package/tools/scores/upsert-scores.mjs +0 -55
  252. package/tools/scores/upsert-scores.mjs.map +0 -1
  253. package/tools/systems/delete-systems.d.mts +0 -51
  254. package/tools/systems/delete-systems.d.mts.map +0 -1
  255. package/tools/systems/delete-systems.d.ts +0 -51
  256. package/tools/systems/delete-systems.d.ts.map +0 -1
  257. package/tools/systems/delete-systems.js +0 -54
  258. package/tools/systems/delete-systems.js.map +0 -1
  259. package/tools/systems/delete-systems.mjs +0 -47
  260. package/tools/systems/delete-systems.mjs.map +0 -1
  261. package/tools/systems/get-systems.d.mts +0 -51
  262. package/tools/systems/get-systems.d.mts.map +0 -1
  263. package/tools/systems/get-systems.d.ts +0 -51
  264. package/tools/systems/get-systems.d.ts.map +0 -1
  265. package/tools/systems/get-systems.js +0 -54
  266. package/tools/systems/get-systems.js.map +0 -1
  267. package/tools/systems/get-systems.mjs +0 -47
  268. package/tools/systems/get-systems.mjs.map +0 -1
  269. package/tools/systems/list-systems.d.mts +0 -51
  270. package/tools/systems/list-systems.d.mts.map +0 -1
  271. package/tools/systems/list-systems.d.ts +0 -51
  272. package/tools/systems/list-systems.d.ts.map +0 -1
  273. package/tools/systems/list-systems.js +0 -63
  274. package/tools/systems/list-systems.js.map +0 -1
  275. package/tools/systems/list-systems.mjs +0 -56
  276. package/tools/systems/list-systems.mjs.map +0 -1
  277. package/tools/systems/update-systems.d.mts +0 -51
  278. package/tools/systems/update-systems.d.mts.map +0 -1
  279. package/tools/systems/update-systems.d.ts +0 -51
  280. package/tools/systems/update-systems.d.ts.map +0 -1
  281. package/tools/systems/update-systems.js +0 -64
  282. package/tools/systems/update-systems.js.map +0 -1
  283. package/tools/systems/update-systems.mjs +0 -57
  284. package/tools/systems/update-systems.mjs.map +0 -1
  285. package/tools/systems/upsert-systems.d.mts +0 -51
  286. package/tools/systems/upsert-systems.d.mts.map +0 -1
  287. package/tools/systems/upsert-systems.d.ts +0 -51
  288. package/tools/systems/upsert-systems.d.ts.map +0 -1
  289. package/tools/systems/upsert-systems.js +0 -65
  290. package/tools/systems/upsert-systems.js.map +0 -1
  291. package/tools/systems/upsert-systems.mjs +0 -58
  292. package/tools/systems/upsert-systems.mjs.map +0 -1
  293. package/tools/systems/versions/get-systems-versions.d.mts +0 -51
  294. package/tools/systems/versions/get-systems-versions.d.mts.map +0 -1
  295. package/tools/systems/versions/get-systems-versions.d.ts +0 -51
  296. package/tools/systems/versions/get-systems-versions.d.ts.map +0 -1
  297. package/tools/systems/versions/get-systems-versions.js +0 -54
  298. package/tools/systems/versions/get-systems-versions.js.map +0 -1
  299. package/tools/systems/versions/get-systems-versions.mjs +0 -47
  300. package/tools/systems/versions/get-systems-versions.mjs.map +0 -1
  301. package/tools/systems/versions/upsert-systems-versions.d.mts +0 -51
  302. package/tools/systems/versions/upsert-systems-versions.d.mts.map +0 -1
  303. package/tools/systems/versions/upsert-systems-versions.d.ts +0 -51
  304. package/tools/systems/versions/upsert-systems-versions.d.ts.map +0 -1
  305. package/tools/systems/versions/upsert-systems-versions.js +0 -61
  306. package/tools/systems/versions/upsert-systems-versions.js.map +0 -1
  307. package/tools/systems/versions/upsert-systems-versions.mjs +0 -54
  308. package/tools/systems/versions/upsert-systems-versions.mjs.map +0 -1
  309. package/tools/testcases/create-testcases.d.mts +0 -51
  310. package/tools/testcases/create-testcases.d.mts.map +0 -1
  311. package/tools/testcases/create-testcases.d.ts +0 -51
  312. package/tools/testcases/create-testcases.d.ts.map +0 -1
  313. package/tools/testcases/create-testcases.js +0 -67
  314. package/tools/testcases/create-testcases.js.map +0 -1
  315. package/tools/testcases/create-testcases.mjs +0 -60
  316. package/tools/testcases/create-testcases.mjs.map +0 -1
  317. package/tools/testcases/delete-testcases.d.mts +0 -51
  318. package/tools/testcases/delete-testcases.d.mts.map +0 -1
  319. package/tools/testcases/delete-testcases.d.ts +0 -51
  320. package/tools/testcases/delete-testcases.d.ts.map +0 -1
  321. package/tools/testcases/delete-testcases.js +0 -56
  322. package/tools/testcases/delete-testcases.js.map +0 -1
  323. package/tools/testcases/delete-testcases.mjs +0 -49
  324. package/tools/testcases/delete-testcases.mjs.map +0 -1
  325. package/tools/testcases/get-testcases.d.mts +0 -51
  326. package/tools/testcases/get-testcases.d.mts.map +0 -1
  327. package/tools/testcases/get-testcases.d.ts +0 -51
  328. package/tools/testcases/get-testcases.d.ts.map +0 -1
  329. package/tools/testcases/get-testcases.js +0 -54
  330. package/tools/testcases/get-testcases.js.map +0 -1
  331. package/tools/testcases/get-testcases.mjs +0 -47
  332. package/tools/testcases/get-testcases.mjs.map +0 -1
  333. package/tools/testcases/list-testcases.d.mts +0 -51
  334. package/tools/testcases/list-testcases.d.mts.map +0 -1
  335. package/tools/testcases/list-testcases.d.ts +0 -51
  336. package/tools/testcases/list-testcases.d.ts.map +0 -1
  337. package/tools/testcases/list-testcases.js +0 -63
  338. package/tools/testcases/list-testcases.js.map +0 -1
  339. package/tools/testcases/list-testcases.mjs +0 -56
  340. package/tools/testcases/list-testcases.mjs.map +0 -1
  341. package/tools/testcases/update-testcases.d.mts +0 -51
  342. package/tools/testcases/update-testcases.d.mts.map +0 -1
  343. package/tools/testcases/update-testcases.d.ts +0 -51
  344. package/tools/testcases/update-testcases.d.ts.map +0 -1
  345. package/tools/testcases/update-testcases.js +0 -59
  346. package/tools/testcases/update-testcases.js.map +0 -1
  347. package/tools/testcases/update-testcases.mjs +0 -52
  348. package/tools/testcases/update-testcases.mjs.map +0 -1
  349. package/tools/testsets/create-testsets.d.mts +0 -51
  350. package/tools/testsets/create-testsets.d.mts.map +0 -1
  351. package/tools/testsets/create-testsets.d.ts +0 -51
  352. package/tools/testsets/create-testsets.d.ts.map +0 -1
  353. package/tools/testsets/create-testsets.js +0 -93
  354. package/tools/testsets/create-testsets.js.map +0 -1
  355. package/tools/testsets/create-testsets.mjs +0 -86
  356. package/tools/testsets/create-testsets.mjs.map +0 -1
  357. package/tools/testsets/delete-testsets.d.mts +0 -51
  358. package/tools/testsets/delete-testsets.d.mts.map +0 -1
  359. package/tools/testsets/delete-testsets.d.ts +0 -51
  360. package/tools/testsets/delete-testsets.d.ts.map +0 -1
  361. package/tools/testsets/delete-testsets.js +0 -54
  362. package/tools/testsets/delete-testsets.js.map +0 -1
  363. package/tools/testsets/delete-testsets.mjs +0 -47
  364. package/tools/testsets/delete-testsets.mjs.map +0 -1
  365. package/tools/testsets/get-testsets.d.mts +0 -51
  366. package/tools/testsets/get-testsets.d.mts.map +0 -1
  367. package/tools/testsets/get-testsets.d.ts +0 -51
  368. package/tools/testsets/get-testsets.d.ts.map +0 -1
  369. package/tools/testsets/get-testsets.js +0 -54
  370. package/tools/testsets/get-testsets.js.map +0 -1
  371. package/tools/testsets/get-testsets.mjs +0 -47
  372. package/tools/testsets/get-testsets.mjs.map +0 -1
  373. package/tools/testsets/list-testsets.d.mts +0 -51
  374. package/tools/testsets/list-testsets.d.mts.map +0 -1
  375. package/tools/testsets/list-testsets.d.ts +0 -51
  376. package/tools/testsets/list-testsets.d.ts.map +0 -1
  377. package/tools/testsets/list-testsets.js +0 -63
  378. package/tools/testsets/list-testsets.js.map +0 -1
  379. package/tools/testsets/list-testsets.mjs +0 -56
  380. package/tools/testsets/list-testsets.mjs.map +0 -1
  381. package/tools/testsets/update-testsets.d.mts +0 -51
  382. package/tools/testsets/update-testsets.d.mts.map +0 -1
  383. package/tools/testsets/update-testsets.d.ts +0 -51
  384. package/tools/testsets/update-testsets.d.ts.map +0 -1
  385. package/tools/testsets/update-testsets.js +0 -93
  386. package/tools/testsets/update-testsets.js.map +0 -1
  387. package/tools/testsets/update-testsets.mjs +0 -86
  388. package/tools/testsets/update-testsets.mjs.map +0 -1
  389. package/tools/types.d.mts.map +0 -1
  390. package/tools/types.d.ts.map +0 -1
  391. package/tools/types.js.map +0 -1
  392. package/tools/types.mjs.map +0 -1
  393. package/tools.d.mts +0 -2
  394. package/tools.d.mts.map +0 -1
  395. package/tools.d.ts +0 -2
  396. package/tools.d.ts.map +0 -1
  397. package/tools.js +0 -18
  398. package/tools.js.map +0 -1
  399. package/tools.mjs +0 -2
  400. package/tools.mjs.map +0 -1
  401. /package/{tools/types.js → types.js} +0 -0
  402. /package/{tools/types.mjs → types.mjs} +0 -0
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2025 Scorecard
189
+ Copyright 2026 Scorecard
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -26,7 +26,7 @@ For clients with a configuration JSON, it might look something like this:
26
26
  "mcpServers": {
27
27
  "scorecard_ai_api": {
28
28
  "command": "npx",
29
- "args": ["-y", "scorecard-ai-mcp", "--client=claude", "--tools=dynamic"],
29
+ "args": ["-y", "scorecard-ai-mcp"],
30
30
  "env": {
31
31
  "SCORECARD_API_KEY": "My API Key",
32
32
  "SCORECARD_ENVIRONMENT": "production"
@@ -56,113 +56,87 @@ If you use Claude Code, you can install the MCP server by running the command be
56
56
  environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
57
57
 
58
58
  ```
59
- claude mcp add --transport stdio scorecard_ai_api --env SCORECARD_API_KEY="Your SCORECARD_API_KEY here." -- npx -y scorecard-ai-mcp
59
+ claude mcp add scorecard_ai_mcp_api --env SCORECARD_API_KEY="Your SCORECARD_API_KEY here." -- npx -y scorecard-ai-mcp
60
60
  ```
61
61
 
62
- ## Exposing endpoints to your MCP Client
62
+ ## Code Mode
63
63
 
64
- There are three ways to expose endpoints as tools in the MCP server:
64
+ This MCP server is built on the "Code Mode" tool scheme. In this MCP Server,
65
+ your agent will write code against the TypeScript SDK, which will then be executed in an
66
+ isolated sandbox. To accomplish this, the server will expose two tools to your agent:
65
67
 
66
- 1. Exposing one tool per endpoint, and filtering as necessary
67
- 2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
68
- 3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
68
+ - The first tool is a docs search tool, which can be used to generically query for
69
+ documentation about your API/SDK.
69
70
 
70
- ### Filtering endpoints and tools
71
+ - The second tool is a code tool, where the agent can write code against the TypeScript SDK.
72
+ The code will be executed in a sandbox environment without web or filesystem access. Then,
73
+ anything the code returns or prints will be returned to the agent as the result of the
74
+ tool call.
71
75
 
72
- You can run the package on the command line to discover and filter the set of tools that are exposed by the
73
- MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
74
- context window.
76
+ Using this scheme, agents are capable of performing very complex tasks deterministically
77
+ and repeatably.
75
78
 
76
- You can filter by multiple aspects:
79
+ ## Usage Examples
77
80
 
78
- - `--tool` includes a specific tool by name
79
- - `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
80
- - `--operation` includes just read (get/list) or just write operations
81
+ Below are examples of prompts you can give to an AI assistant with this MCP server configured.
81
82
 
82
- ### Dynamic tools
83
+ ### Example 1: Search Documentation
83
84
 
84
- If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
85
- expose the following tools:
85
+ **Prompt:**
86
+ > "How do I create a testset using the Scorecard TypeScript SDK?"
86
87
 
87
- 1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
88
- 2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
89
- 3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
90
-
91
- This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
92
- of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
93
- search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
94
- can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
95
- you can opt-in to explicit tools, the dynamic tools, or both.
96
-
97
- See more information with `--help`.
98
-
99
- All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
100
-
101
- Use `--list` to see the list of available tools, or see below.
102
-
103
- ### Code execution
104
-
105
- If you specify `--tools=code` to the MCP server, it will expose just two tools:
106
-
107
- - `search_docs` - Searches the API documentation and returns a list of markdown results
108
- - `execute` - Runs code against the TypeScript client
109
-
110
- This allows the LLM to implement more complex logic by chaining together many API calls without loading
111
- intermediary results into its context window.
112
-
113
- The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
114
-
115
- ### Specifying the MCP Client
116
-
117
- Different clients have varying abilities to handle arbitrary tools and schemas.
118
-
119
- You can specify the client you are using with the `--client` argument, and the MCP server will automatically
120
- serve tools and schemas that are more compatible with that client.
121
-
122
- - `--client=<type>`: Set all capabilities based on a known MCP client
123
-
124
- - Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
125
- - Example: `--client=cursor`
88
+ **Tool Called:** `search_docs`
89
+ ```json
90
+ {
91
+ "query": "create testset",
92
+ "language": "typescript"
93
+ }
94
+ ```
126
95
 
127
- Additionally, if you have a client not on the above list, or the client has gotten better
128
- over time, you can manually enable or disable certain capabilities:
96
+ The assistant searches SDK documentation and returns relevant code examples and API references.
129
97
 
130
- - `--capability=<name>`: Specify individual client capabilities
131
- - Available capabilities:
132
- - `top-level-unions`: Enable support for top-level unions in tool schemas
133
- - `valid-json`: Enable JSON string parsing for arguments
134
- - `refs`: Enable support for $ref pointers in schemas
135
- - `unions`: Enable support for union types (anyOf) in schemas
136
- - `formats`: Enable support for format validations in schemas (e.g. date-time, email)
137
- - `tool-name-length=N`: Set maximum tool name length to N characters
138
- - Example: `--capability=top-level-unions --capability=tool-name-length=40`
139
- - Example: `--capability=top-level-unions,tool-name-length=40`
98
+ ---
140
99
 
141
- ### Examples
100
+ ### Example 2: List Projects and Testsets
142
101
 
143
- 1. Filter for read operations on cards:
102
+ **Prompt:**
103
+ > "List all my Scorecard projects and their testsets."
144
104
 
145
- ```bash
146
- --resource=cards --operation=read
105
+ **Tool Called:** `execute`
106
+ ```javascript
107
+ async function run(client) {
108
+ for await (const project of client.projects.list()) {
109
+ console.log(`Project: ${project.id} - ${project.name}`);
110
+ for await (const testset of client.testsets.list(project.id)) {
111
+ console.log(` Testset: ${testset.id} - ${testset.name}`);
112
+ }
113
+ }
114
+ }
147
115
  ```
148
116
 
149
- 2. Exclude specific tools while including others:
117
+ ---
150
118
 
151
- ```bash
152
- --resource=cards --no-tool=create_cards
153
- ```
119
+ ### Example 3: Create an Evaluation Run
154
120
 
155
- 3. Configure for Cursor client with custom max tool name length:
121
+ **Prompt:**
122
+ > "Create a new evaluation run for project '314' with testset '246' and metrics '789' and '101'."
156
123
 
157
- ```bash
158
- --client=cursor --capability=tool-name-length=40
124
+ **Tool Called:** `execute`
125
+ ```javascript
126
+ async function run(client) {
127
+ const run = await client.runs.create('314', {
128
+ testsetId: '246',
129
+ metricIds: ['789', '101']
130
+ });
131
+ console.log('Run created:', run.id);
132
+ console.log('View at:', run.url);
133
+ return run;
134
+ }
159
135
  ```
160
136
 
161
- 4. Complex filtering with multiple criteria:
137
+ ---
162
138
 
163
- ```bash
164
- --resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
165
- ```
139
+ For more SDK code examples, see the [examples directory](https://github.com/scorecard-ai/scorecard-node/tree/main/examples).
166
140
 
167
141
  ## Running remotely
168
142
 
@@ -190,125 +164,33 @@ A configuration JSON for this server might look like this, assuming the server i
190
164
  }
191
165
  ```
192
166
 
193
- The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
194
- For example, to exclude specific tools while including others, use the URL:
195
-
196
- ```
197
- http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
198
- ```
199
-
200
- Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
201
-
202
- ```
203
- http://localhost:3000?client=cursor&capability=tool-name-length%3D40
204
- ```
205
-
206
- ## Importing the tools and server individually
207
-
208
- ```js
209
- // Import the server, generated endpoints, or the init function
210
- import { server, endpoints, init } from "scorecard-ai-mcp/server";
211
-
212
- // import a specific tool
213
- import createProjects from "scorecard-ai-mcp/tools/projects/create-projects";
214
-
215
- // initialize the server and all endpoints
216
- init({ server, endpoints });
217
-
218
- // manually start server
219
- const transport = new StdioServerTransport();
220
- await server.connect(transport);
221
-
222
- // or initialize your own server with specific tools
223
- const myServer = new McpServer(...);
224
-
225
- // define your own endpoint
226
- const myCustomEndpoint = {
227
- tool: {
228
- name: 'my_custom_tool',
229
- description: 'My custom tool',
230
- inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
231
- },
232
- handler: async (client: client, args: any) => {
233
- return { myResponse: 'Hello world!' };
234
- })
235
- };
236
-
237
- // initialize the server with your custom endpoints
238
- init({ server: myServer, endpoints: [createProjects, myCustomEndpoint] });
239
- ```
240
-
241
- ## Available Tools
242
-
243
- The following tools are available in this MCP server.
244
-
245
- ### Resource `projects`:
246
-
247
- - `create_projects` (`write`): Create a new Project.
248
- - `list_projects` (`read`): Retrieve a paginated list of all Projects. Projects are ordered by creation date, with oldest Projects first.
249
-
250
- ### Resource `testsets`:
251
-
252
- - `create_testsets` (`write`): Create a new Testset for a Project. The Testset will be created in the Project specified in the path.
253
- - `update_testsets` (`write`): Update a Testset. Only the fields provided in the request body will be updated.
254
- If a field is provided, the new content will replace the existing content.
255
- If a field is not provided, the existing content will remain unchanged.
256
-
257
- When updating the schema:
258
-
259
- - If field mappings are not provided and existing mappings reference fields that no longer exist, those mappings will be automatically removed
260
- - To preserve all existing mappings, ensure all referenced fields remain in the updated schema
261
- - For complete control, provide both schema and fieldMapping when updating the schema
262
-
263
- - `list_testsets` (`read`): Retrieve a paginated list of Testsets belonging to a Project.
264
- - `delete_testsets` (`write`): Delete Testset
265
- - `get_testsets` (`read`): Get Testset
266
-
267
- ### Resource `testcases`:
268
-
269
- - `create_testcases` (`write`): Create multiple Testcases in the specified Testset.
270
- - `update_testcases` (`write`): Replace the data of an existing Testcase while keeping its ID.
271
- - `list_testcases` (`read`): Retrieve a paginated list of Testcases belonging to a Testset.
272
- - `delete_testcases` (`write`): Delete multiple Testcases by their IDs.
273
- - `get_testcases` (`read`): Retrieve a specific Testcase by ID.
274
-
275
- ### Resource `runs`:
167
+ ## Privacy & Data Handling
276
168
 
277
- - `create_runs` (`write`): Create a new Run.
278
- - `list_runs` (`read`): Retrieve a paginated list of all Runs for a Project. Runs are ordered by creation date, most recent first.
279
- - `get_runs` (`read`): Retrieve a specific Run by ID.
169
+ This MCP server transmits data to external services to provide its functionality. By using this server, you acknowledge the following:
280
170
 
281
- ### Resource `metrics`:
171
+ ### Data Transmitted
282
172
 
283
- - `create_metrics` (`write`): Create a new Metric for evaluating system outputs. The structure of a metric depends on the evalType and outputType of the metric.
284
- - `update_metrics` (`write`): Update an existing Metric. You must specify the evalType and outputType of the metric. The structure of a metric depends on the evalType and outputType of the metric.
285
- - `list_metrics` (`read`): List Metrics configured for the specified Project. Metrics are returned in reverse chronological order.
286
- - `delete_metrics` (`write`): Delete a specific Metric by ID. The metric will be removed from metric groups and monitors.
287
- - `get_metrics` (`read`): Retrieve a specific Metric by ID.
173
+ - **Code Execution (`execute` tool):** When you use the `execute` tool, the code you provide is sent to the Stainless API (`api.stainless.com`) for execution in a sandboxed environment. Your Scorecard API key is also transmitted to authenticate requests made by the executed code.
288
174
 
289
- ### Resource `records`:
175
+ - **Documentation Search (`search_docs` tool):** Search queries are sent to the Stainless API to retrieve relevant SDK documentation.
290
176
 
291
- - `create_records` (`write`): Create a new Record in a Run.
292
- - `list_records` (`read`): Retrieve a paginated list of Records for a Run, including all scores for each record.
293
- - `delete_records` (`write`): Delete a specific Record by ID.
177
+ ### API Credentials
294
178
 
295
- ### Resource `scores`:
179
+ - Your `SCORECARD_API_KEY` is transmitted to the Stainless code execution sandbox to allow the executed code to make authenticated requests to the Scorecard API.
180
+ - API keys are sent over HTTPS and are not logged by this MCP server.
296
181
 
297
- - `upsert_scores` (`write`): Create or update a Score for a given Record and MetricConfig. If a Score with the specified Record ID and MetricConfig ID already exists, it will be updated. Otherwise, a new Score will be created. The score provided should conform to the schema defined by the MetricConfig; otherwise, validation errors will be reported.
182
+ ### Data Retention
298
183
 
299
- ### Resource `systems`:
184
+ - This MCP server does not store or log any user data, code, or API responses locally.
185
+ - Data retention on Stainless infrastructure is governed by [Stainless's terms and conditions](https://www.stainless.com/legal/terms-conditions).
186
+ - Data retention for Scorecard API requests is governed by [Scorecard's privacy policy](https://www.scorecard.io/privacy-policy).
300
187
 
301
- - `update_systems` (`write`): Update an existing system. Only the fields provided in the request body will be updated.
302
- If a field is provided, the new content will replace the existing content.
303
- If a field is not provided, the existing content will remain unchanged.
304
- - `list_systems` (`read`): Retrieve a paginated list of all systems. Systems are ordered by creation date.
305
- - `delete_systems` (`write`): Delete a system definition by ID. This will not delete associated system versions.
306
- - `get_systems` (`read`): Retrieve a specific system by ID.
307
- - `upsert_systems` (`write`): Create a new system. If one with the same name in the project exists, it updates it instead.
188
+ ### Security Recommendations
308
189
 
309
- ### Resource `systems.versions`:
190
+ - Use environment variables to provide API keys rather than hardcoding them.
191
+ - When running the server remotely, ensure TLS is enabled and use OAuth 2.0 or secure token-based authentication.
192
+ - Rotate API keys periodically and revoke unused keys.
310
193
 
311
- - `get_systems_versions` (`read`): Retrieve a specific system version by ID.
312
- - `upsert_systems_versions` (`write`): Create a new system version if it does not already exist. Does **not** set the created version to be the system's production version.
194
+ ### Contact
313
195
 
314
- If there is already a system version with the same config, its name will be updated.
196
+ For security concerns, contact [security@stainless.com](mailto:security@stainless.com) or [team@scorecard.io](mailto:team@scorecard.io).
@@ -1,16 +1,14 @@
1
1
  import { ClientOptions } from 'scorecard-ai';
2
2
  export type WorkerInput = {
3
- opts: ClientOptions;
3
+ project_name: string;
4
4
  code: string;
5
+ client_opts: ClientOptions;
6
+ intent?: string | undefined;
5
7
  };
6
- export type WorkerSuccess = {
8
+ export type WorkerOutput = {
9
+ is_error: boolean;
7
10
  result: unknown | null;
8
- logLines: string[];
9
- errLines: string[];
10
- };
11
- export type WorkerError = {
12
- message: string | undefined;
13
- logLines: string[];
14
- errLines: string[];
11
+ log_lines: string[];
12
+ err_lines: string[];
15
13
  };
16
14
  //# sourceMappingURL=code-tool-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -1,16 +1,14 @@
1
1
  import { ClientOptions } from 'scorecard-ai';
2
2
  export type WorkerInput = {
3
- opts: ClientOptions;
3
+ project_name: string;
4
4
  code: string;
5
+ client_opts: ClientOptions;
6
+ intent?: string | undefined;
5
7
  };
6
- export type WorkerSuccess = {
8
+ export type WorkerOutput = {
9
+ is_error: boolean;
7
10
  result: unknown | null;
8
- logLines: string[];
9
- errLines: string[];
10
- };
11
- export type WorkerError = {
12
- message: string | undefined;
13
- logLines: string[];
14
- errLines: string[];
11
+ log_lines: string[];
12
+ err_lines: string[];
15
13
  };
16
14
  //# sourceMappingURL=code-tool-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
package/code-tool.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Metadata, ToolCallResult } from "./tools/types.mjs";
1
+ import { McpTool } from "./types.mjs";
2
2
  /**
3
3
  * A tool that runs code against a copy of the SDK.
4
4
  *
@@ -8,47 +8,5 @@ import { Metadata, ToolCallResult } from "./tools/types.mjs";
8
8
  *
9
9
  * @param endpoints - The endpoints to include in the list.
10
10
  */
11
- export declare function codeTool(): Promise<{
12
- metadata: Metadata;
13
- tool: {
14
- inputSchema: {
15
- [x: string]: unknown;
16
- type: "object";
17
- properties?: {
18
- [x: string]: object;
19
- } | undefined;
20
- required?: string[] | undefined;
21
- };
22
- name: string;
23
- description?: string | undefined;
24
- outputSchema?: {
25
- [x: string]: unknown;
26
- type: "object";
27
- properties?: {
28
- [x: string]: object;
29
- } | undefined;
30
- required?: string[] | undefined;
31
- } | undefined;
32
- annotations?: {
33
- title?: string | undefined;
34
- readOnlyHint?: boolean | undefined;
35
- destructiveHint?: boolean | undefined;
36
- idempotentHint?: boolean | undefined;
37
- openWorldHint?: boolean | undefined;
38
- } | undefined;
39
- execution?: {
40
- taskSupport?: "optional" | "required" | "forbidden" | undefined;
41
- } | undefined;
42
- _meta?: {
43
- [x: string]: unknown;
44
- } | undefined;
45
- icons?: {
46
- src: string;
47
- mimeType?: string | undefined;
48
- sizes?: string[] | undefined;
49
- }[] | undefined;
50
- title?: string | undefined;
51
- };
52
- handler: (_: unknown, args: any) => Promise<ToolCallResult>;
53
- }>;
11
+ export declare function codeTool(): McpTool;
54
12
  //# sourceMappingURL=code-tool.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,cAAc,EAAuB;AAIxD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQF,OAAO,QAAQ,GAAG,KAAG,OAAO,CAAC,cAAc,CAAC;GAmCvE"}
1
+ {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AA0BhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CA2ElC"}
package/code-tool.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Metadata, ToolCallResult } from "./tools/types.js";
1
+ import { McpTool } from "./types.js";
2
2
  /**
3
3
  * A tool that runs code against a copy of the SDK.
4
4
  *
@@ -8,47 +8,5 @@ import { Metadata, ToolCallResult } from "./tools/types.js";
8
8
  *
9
9
  * @param endpoints - The endpoints to include in the list.
10
10
  */
11
- export declare function codeTool(): Promise<{
12
- metadata: Metadata;
13
- tool: {
14
- inputSchema: {
15
- [x: string]: unknown;
16
- type: "object";
17
- properties?: {
18
- [x: string]: object;
19
- } | undefined;
20
- required?: string[] | undefined;
21
- };
22
- name: string;
23
- description?: string | undefined;
24
- outputSchema?: {
25
- [x: string]: unknown;
26
- type: "object";
27
- properties?: {
28
- [x: string]: object;
29
- } | undefined;
30
- required?: string[] | undefined;
31
- } | undefined;
32
- annotations?: {
33
- title?: string | undefined;
34
- readOnlyHint?: boolean | undefined;
35
- destructiveHint?: boolean | undefined;
36
- idempotentHint?: boolean | undefined;
37
- openWorldHint?: boolean | undefined;
38
- } | undefined;
39
- execution?: {
40
- taskSupport?: "optional" | "required" | "forbidden" | undefined;
41
- } | undefined;
42
- _meta?: {
43
- [x: string]: unknown;
44
- } | undefined;
45
- icons?: {
46
- src: string;
47
- mimeType?: string | undefined;
48
- sizes?: string[] | undefined;
49
- }[] | undefined;
50
- title?: string | undefined;
51
- };
52
- handler: (_: unknown, args: any) => Promise<ToolCallResult>;
53
- }>;
11
+ export declare function codeTool(): McpTool;
54
12
  //# sourceMappingURL=code-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,cAAc,EAAuB;AAIxD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQF,OAAO,QAAQ,GAAG,KAAG,OAAO,CAAC,cAAc,CAAC;GAmCvE"}
1
+ {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AA0BhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CA2ElC"}
package/code-tool.js CHANGED
@@ -2,8 +2,27 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.codeTool = codeTool;
5
- const types_1 = require("./tools/types.js");
5
+ const types_1 = require("./types.js");
6
6
  const server_1 = require("./server.js");
7
+ const prompt = `Runs JavaScript code to interact with the Scorecard API.
8
+
9
+ You are a skilled programmer writing code to interface with the service.
10
+ Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
11
+ For example:
12
+
13
+ \`\`\`
14
+ async function run(client) {
15
+ const run = await client.runs.create('314', { metricIds: ['789', '101'], testsetId: '246' });
16
+
17
+ console.log(run.id);
18
+ }
19
+ \`\`\`
20
+
21
+ You will be returned anything that your function returns, plus the results of any console.log statements.
22
+ Do not add try-catch blocks for single API calls. The tool will handle errors for you.
23
+ Do not add comments unless necessary for generating better code.
24
+ Code will run in a container, and cannot interact with the network outside of the given SDK client.
25
+ Variables will not persist between calls, so make sure to return or log any data you might need later.`;
7
26
  /**
8
27
  * A tool that runs code against a copy of the SDK.
9
28
  *
@@ -13,15 +32,34 @@ const server_1 = require("./server.js");
13
32
  *
14
33
  * @param endpoints - The endpoints to include in the list.
15
34
  */
16
- async function codeTool() {
35
+ function codeTool() {
17
36
  const metadata = { resource: 'all', operation: 'write', tags: [] };
18
37
  const tool = {
19
38
  name: 'execute',
20
- description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
21
- inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
39
+ description: prompt,
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {
43
+ code: {
44
+ type: 'string',
45
+ description: 'Code to execute.',
46
+ },
47
+ intent: {
48
+ type: 'string',
49
+ description: 'Task you are trying to perform. Used for improving the service.',
50
+ },
51
+ },
52
+ required: ['code'],
53
+ },
54
+ annotations: {
55
+ title: 'Execute Code Against Scorecard API',
56
+ readOnlyHint: false,
57
+ destructiveHint: true,
58
+ },
22
59
  };
23
- const handler = async (_, args) => {
60
+ const handler = async (client, args) => {
24
61
  const code = args.code;
62
+ const intent = args.intent;
25
63
  // this is not required, but passing a Stainless API key for the matching project_name
26
64
  // will allow you to run code-mode queries against non-published versions of your SDK.
27
65
  const stainlessAPIKey = (0, server_1.readEnv)('STAINLESS_API_KEY');
@@ -31,18 +69,32 @@ async function codeTool() {
31
69
  headers: {
32
70
  ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
33
71
  'Content-Type': 'application/json',
34
- client_envs: JSON.stringify({ SCORECARD_API_KEY: (0, server_1.readEnv)('SCORECARD_API_KEY') }),
72
+ client_envs: JSON.stringify({
73
+ SCORECARD_API_KEY: client.apiKey || (0, server_1.readEnvOrError)('SCORECARD_API_KEY'),
74
+ SCORECARD_BASE_URL: client.baseURL || (0, server_1.readEnv)('SCORECARD_BASE_URL'),
75
+ }),
35
76
  },
36
77
  body: JSON.stringify({
37
78
  project_name: 'scorecard',
38
- client_opts: { environment: ((0, server_1.readEnv)('SCORECARD_ENVIRONMENT') || undefined) },
39
79
  code,
80
+ intent,
81
+ client_opts: { environment: ((0, server_1.readEnv)('SCORECARD_ENVIRONMENT') || undefined) },
40
82
  }),
41
83
  });
42
84
  if (!res.ok) {
43
85
  throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
44
86
  }
45
- return (0, types_1.asTextContentResult)((await res.json()));
87
+ const { is_error, result, log_lines, err_lines } = (await res.json());
88
+ const hasLogs = log_lines.length > 0 || err_lines.length > 0;
89
+ const output = {
90
+ result,
91
+ ...(log_lines.length > 0 && { log_lines }),
92
+ ...(err_lines.length > 0 && { err_lines }),
93
+ };
94
+ if (is_error) {
95
+ return (0, types_1.asErrorResult)(typeof result === 'string' && !hasLogs ? result : JSON.stringify(output, null, 2));
96
+ }
97
+ return (0, types_1.asTextContentResult)(output);
46
98
  };
47
99
  return { metadata, tool, handler };
48
100
  }
package/code-tool.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAetF,4BA2CC;AAxDD,4CAA8E;AAE9E,wCAAmC;AAEnC;;;;;;;;GAQG;AACI,KAAK,UAAU,QAAQ;IAC5B,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,iiCAAiiC;QACniC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,CAAU,EAAE,IAAS,EAA2B,EAAE;QACvE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QAEjC,sFAAsF;QACtF,sFAAsF;QACtF,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,mBAAmB,CAAC,CAAC;QACrD,MAAM,gBAAgB,GACpB,IAAA,gBAAO,EAAC,wBAAwB,C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