scorecard-ai-mcp 2.0.0 → 2.1.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 (325) hide show
  1. package/README.md +39 -0
  2. package/code-tool-paths.cjs +6 -0
  3. package/code-tool-paths.cjs.map +1 -0
  4. package/code-tool-paths.d.cts +2 -0
  5. package/code-tool-paths.d.cts.map +1 -0
  6. package/code-tool-types.d.mts +14 -0
  7. package/code-tool-types.d.mts.map +1 -0
  8. package/code-tool-types.d.ts +14 -0
  9. package/code-tool-types.d.ts.map +1 -0
  10. package/code-tool-types.js +4 -0
  11. package/code-tool-types.js.map +1 -0
  12. package/code-tool-types.mjs +3 -0
  13. package/code-tool-types.mjs.map +1 -0
  14. package/code-tool-worker.d.mts +5 -0
  15. package/code-tool-worker.d.mts.map +1 -0
  16. package/code-tool-worker.d.ts +5 -0
  17. package/code-tool-worker.d.ts.map +1 -0
  18. package/code-tool-worker.js +45 -0
  19. package/code-tool-worker.js.map +1 -0
  20. package/code-tool-worker.mjs +40 -0
  21. package/code-tool-worker.mjs.map +1 -0
  22. package/code-tool.d.mts +12 -0
  23. package/code-tool.d.mts.map +1 -0
  24. package/code-tool.d.ts +12 -0
  25. package/code-tool.d.ts.map +1 -0
  26. package/code-tool.js +157 -0
  27. package/code-tool.js.map +1 -0
  28. package/code-tool.mjs +121 -0
  29. package/code-tool.mjs.map +1 -0
  30. package/compat.d.mts +4 -2
  31. package/compat.d.mts.map +1 -1
  32. package/compat.d.ts +4 -2
  33. package/compat.d.ts.map +1 -1
  34. package/compat.js +8 -3
  35. package/compat.js.map +1 -1
  36. package/compat.mjs +7 -2
  37. package/compat.mjs.map +1 -1
  38. package/filtering.d.mts +2 -0
  39. package/filtering.d.mts.map +1 -0
  40. package/filtering.d.ts +2 -0
  41. package/filtering.d.ts.map +1 -0
  42. package/filtering.js +20 -0
  43. package/filtering.js.map +1 -0
  44. package/filtering.mjs +13 -0
  45. package/filtering.mjs.map +1 -0
  46. package/headers.d.mts +4 -0
  47. package/headers.d.mts.map +1 -0
  48. package/headers.d.ts +4 -0
  49. package/headers.d.ts.map +1 -0
  50. package/headers.js +22 -0
  51. package/headers.js.map +1 -0
  52. package/headers.mjs +18 -0
  53. package/headers.mjs.map +1 -0
  54. package/http.d.mts +9 -0
  55. package/http.d.mts.map +1 -0
  56. package/http.d.ts +9 -0
  57. package/http.d.ts.map +1 -0
  58. package/http.js +108 -0
  59. package/http.js.map +1 -0
  60. package/http.mjs +100 -0
  61. package/http.mjs.map +1 -0
  62. package/index.js +15 -10
  63. package/index.js.map +1 -1
  64. package/index.mjs +17 -12
  65. package/index.mjs.map +1 -1
  66. package/options.d.mts +11 -6
  67. package/options.d.mts.map +1 -1
  68. package/options.d.ts +11 -6
  69. package/options.d.ts.map +1 -1
  70. package/options.js +136 -15
  71. package/options.js.map +1 -1
  72. package/options.mjs +135 -15
  73. package/options.mjs.map +1 -1
  74. package/package.json +89 -4
  75. package/server.d.mts +4 -16
  76. package/server.d.mts.map +1 -1
  77. package/server.d.ts +4 -16
  78. package/server.d.ts.map +1 -1
  79. package/server.js +86 -33
  80. package/server.js.map +1 -1
  81. package/server.mjs +84 -32
  82. package/server.mjs.map +1 -1
  83. package/src/code-tool-paths.cts +3 -0
  84. package/src/code-tool-types.ts +14 -0
  85. package/src/code-tool-worker.ts +46 -0
  86. package/src/code-tool.ts +146 -0
  87. package/src/compat.ts +9 -4
  88. package/src/filtering.ts +14 -0
  89. package/src/headers.ts +23 -0
  90. package/src/http.ts +127 -0
  91. package/src/index.ts +18 -14
  92. package/src/options.ts +158 -21
  93. package/src/server.ts +103 -48
  94. package/src/stdio.ts +13 -0
  95. package/src/tools/metrics/create-metrics.ts +8 -2
  96. package/src/tools/metrics/update-metrics.ts +8 -2
  97. package/src/tools/projects/create-projects.ts +14 -5
  98. package/src/tools/projects/list-projects.ts +16 -5
  99. package/src/tools/records/create-records.ts +17 -5
  100. package/src/tools/runs/create-runs.ts +14 -5
  101. package/src/tools/scores/upsert-scores.ts +16 -5
  102. package/src/tools/systems/delete-systems.ts +16 -5
  103. package/src/tools/systems/get-systems.ts +16 -5
  104. package/src/tools/systems/list-systems.ts +17 -5
  105. package/src/tools/systems/update-systems.ts +13 -5
  106. package/src/tools/systems/upsert-systems.ts +15 -5
  107. package/src/tools/systems/versions/get-systems-versions.ts +18 -5
  108. package/src/tools/systems/versions/upsert-systems-versions.ts +16 -5
  109. package/src/tools/testcases/create-testcases.ts +15 -5
  110. package/src/tools/testcases/delete-testcases.ts +14 -5
  111. package/src/tools/testcases/get-testcases.ts +16 -5
  112. package/src/tools/testcases/list-testcases.ts +17 -5
  113. package/src/tools/testcases/update-testcases.ts +17 -5
  114. package/src/tools/testsets/create-testsets.ts +14 -5
  115. package/src/tools/testsets/delete-testsets.ts +16 -5
  116. package/src/tools/testsets/get-testsets.ts +16 -5
  117. package/src/tools/testsets/list-testsets.ts +17 -5
  118. package/src/tools/testsets/update-testsets.ts +14 -5
  119. package/src/tools/types.ts +1 -1
  120. package/stdio.d.mts +3 -0
  121. package/stdio.d.mts.map +1 -0
  122. package/stdio.d.ts +3 -0
  123. package/stdio.d.ts.map +1 -0
  124. package/stdio.js +14 -0
  125. package/stdio.js.map +1 -0
  126. package/stdio.mjs +10 -0
  127. package/stdio.mjs.map +1 -0
  128. package/tools/metrics/create-metrics.d.mts +1 -1
  129. package/tools/metrics/create-metrics.d.mts.map +1 -1
  130. package/tools/metrics/create-metrics.d.ts +1 -1
  131. package/tools/metrics/create-metrics.d.ts.map +1 -1
  132. package/tools/metrics/create-metrics.js +7 -0
  133. package/tools/metrics/create-metrics.js.map +1 -1
  134. package/tools/metrics/create-metrics.mjs +7 -0
  135. package/tools/metrics/create-metrics.mjs.map +1 -1
  136. package/tools/metrics/update-metrics.d.mts +1 -1
  137. package/tools/metrics/update-metrics.d.mts.map +1 -1
  138. package/tools/metrics/update-metrics.d.ts +1 -1
  139. package/tools/metrics/update-metrics.d.ts.map +1 -1
  140. package/tools/metrics/update-metrics.js +7 -0
  141. package/tools/metrics/update-metrics.js.map +1 -1
  142. package/tools/metrics/update-metrics.mjs +7 -0
  143. package/tools/metrics/update-metrics.mjs.map +1 -1
  144. package/tools/projects/create-projects.d.mts +1 -1
  145. package/tools/projects/create-projects.d.mts.map +1 -1
  146. package/tools/projects/create-projects.d.ts +1 -1
  147. package/tools/projects/create-projects.d.ts.map +1 -1
  148. package/tools/projects/create-projects.js +11 -3
  149. package/tools/projects/create-projects.js.map +1 -1
  150. package/tools/projects/create-projects.mjs +11 -3
  151. package/tools/projects/create-projects.mjs.map +1 -1
  152. package/tools/projects/list-projects.d.mts +1 -1
  153. package/tools/projects/list-projects.d.mts.map +1 -1
  154. package/tools/projects/list-projects.d.ts +1 -1
  155. package/tools/projects/list-projects.d.ts.map +1 -1
  156. package/tools/projects/list-projects.js +14 -3
  157. package/tools/projects/list-projects.js.map +1 -1
  158. package/tools/projects/list-projects.mjs +14 -3
  159. package/tools/projects/list-projects.mjs.map +1 -1
  160. package/tools/records/create-records.d.mts +1 -1
  161. package/tools/records/create-records.d.mts.map +1 -1
  162. package/tools/records/create-records.d.ts +1 -1
  163. package/tools/records/create-records.d.ts.map +1 -1
  164. package/tools/records/create-records.js +14 -3
  165. package/tools/records/create-records.js.map +1 -1
  166. package/tools/records/create-records.mjs +14 -3
  167. package/tools/records/create-records.mjs.map +1 -1
  168. package/tools/runs/create-runs.d.mts +1 -1
  169. package/tools/runs/create-runs.d.mts.map +1 -1
  170. package/tools/runs/create-runs.d.ts +1 -1
  171. package/tools/runs/create-runs.d.ts.map +1 -1
  172. package/tools/runs/create-runs.js +11 -3
  173. package/tools/runs/create-runs.js.map +1 -1
  174. package/tools/runs/create-runs.mjs +11 -3
  175. package/tools/runs/create-runs.mjs.map +1 -1
  176. package/tools/scores/upsert-scores.d.mts +1 -1
  177. package/tools/scores/upsert-scores.d.mts.map +1 -1
  178. package/tools/scores/upsert-scores.d.ts +1 -1
  179. package/tools/scores/upsert-scores.d.ts.map +1 -1
  180. package/tools/scores/upsert-scores.js +14 -3
  181. package/tools/scores/upsert-scores.js.map +1 -1
  182. package/tools/scores/upsert-scores.mjs +14 -3
  183. package/tools/scores/upsert-scores.mjs.map +1 -1
  184. package/tools/systems/delete-systems.d.mts +1 -1
  185. package/tools/systems/delete-systems.d.mts.map +1 -1
  186. package/tools/systems/delete-systems.d.ts +1 -1
  187. package/tools/systems/delete-systems.d.ts.map +1 -1
  188. package/tools/systems/delete-systems.js +13 -3
  189. package/tools/systems/delete-systems.js.map +1 -1
  190. package/tools/systems/delete-systems.mjs +13 -3
  191. package/tools/systems/delete-systems.mjs.map +1 -1
  192. package/tools/systems/get-systems.d.mts +1 -1
  193. package/tools/systems/get-systems.d.mts.map +1 -1
  194. package/tools/systems/get-systems.d.ts +1 -1
  195. package/tools/systems/get-systems.d.ts.map +1 -1
  196. package/tools/systems/get-systems.js +13 -3
  197. package/tools/systems/get-systems.js.map +1 -1
  198. package/tools/systems/get-systems.mjs +13 -3
  199. package/tools/systems/get-systems.mjs.map +1 -1
  200. package/tools/systems/list-systems.d.mts +1 -1
  201. package/tools/systems/list-systems.d.mts.map +1 -1
  202. package/tools/systems/list-systems.d.ts +1 -1
  203. package/tools/systems/list-systems.d.ts.map +1 -1
  204. package/tools/systems/list-systems.js +14 -3
  205. package/tools/systems/list-systems.js.map +1 -1
  206. package/tools/systems/list-systems.mjs +14 -3
  207. package/tools/systems/list-systems.mjs.map +1 -1
  208. package/tools/systems/update-systems.d.mts +1 -1
  209. package/tools/systems/update-systems.d.mts.map +1 -1
  210. package/tools/systems/update-systems.d.ts +1 -1
  211. package/tools/systems/update-systems.d.ts.map +1 -1
  212. package/tools/systems/update-systems.js +11 -3
  213. package/tools/systems/update-systems.js.map +1 -1
  214. package/tools/systems/update-systems.mjs +11 -3
  215. package/tools/systems/update-systems.mjs.map +1 -1
  216. package/tools/systems/upsert-systems.d.mts +1 -1
  217. package/tools/systems/upsert-systems.d.mts.map +1 -1
  218. package/tools/systems/upsert-systems.d.ts +1 -1
  219. package/tools/systems/upsert-systems.d.ts.map +1 -1
  220. package/tools/systems/upsert-systems.js +12 -3
  221. package/tools/systems/upsert-systems.js.map +1 -1
  222. package/tools/systems/upsert-systems.mjs +12 -3
  223. package/tools/systems/upsert-systems.mjs.map +1 -1
  224. package/tools/systems/versions/get-systems-versions.d.mts +1 -1
  225. package/tools/systems/versions/get-systems-versions.d.mts.map +1 -1
  226. package/tools/systems/versions/get-systems-versions.d.ts +1 -1
  227. package/tools/systems/versions/get-systems-versions.d.ts.map +1 -1
  228. package/tools/systems/versions/get-systems-versions.js +13 -3
  229. package/tools/systems/versions/get-systems-versions.js.map +1 -1
  230. package/tools/systems/versions/get-systems-versions.mjs +13 -3
  231. package/tools/systems/versions/get-systems-versions.mjs.map +1 -1
  232. package/tools/systems/versions/upsert-systems-versions.d.mts +1 -1
  233. package/tools/systems/versions/upsert-systems-versions.d.mts.map +1 -1
  234. package/tools/systems/versions/upsert-systems-versions.d.ts +1 -1
  235. package/tools/systems/versions/upsert-systems-versions.d.ts.map +1 -1
  236. package/tools/systems/versions/upsert-systems-versions.js +12 -3
  237. package/tools/systems/versions/upsert-systems-versions.js.map +1 -1
  238. package/tools/systems/versions/upsert-systems-versions.mjs +12 -3
  239. package/tools/systems/versions/upsert-systems-versions.mjs.map +1 -1
  240. package/tools/testcases/create-testcases.d.mts +1 -1
  241. package/tools/testcases/create-testcases.d.mts.map +1 -1
  242. package/tools/testcases/create-testcases.d.ts +1 -1
  243. package/tools/testcases/create-testcases.d.ts.map +1 -1
  244. package/tools/testcases/create-testcases.js +12 -3
  245. package/tools/testcases/create-testcases.js.map +1 -1
  246. package/tools/testcases/create-testcases.mjs +12 -3
  247. package/tools/testcases/create-testcases.mjs.map +1 -1
  248. package/tools/testcases/delete-testcases.d.mts +1 -1
  249. package/tools/testcases/delete-testcases.d.mts.map +1 -1
  250. package/tools/testcases/delete-testcases.d.ts +1 -1
  251. package/tools/testcases/delete-testcases.d.ts.map +1 -1
  252. package/tools/testcases/delete-testcases.js +11 -3
  253. package/tools/testcases/delete-testcases.js.map +1 -1
  254. package/tools/testcases/delete-testcases.mjs +11 -3
  255. package/tools/testcases/delete-testcases.mjs.map +1 -1
  256. package/tools/testcases/get-testcases.d.mts +1 -1
  257. package/tools/testcases/get-testcases.d.mts.map +1 -1
  258. package/tools/testcases/get-testcases.d.ts +1 -1
  259. package/tools/testcases/get-testcases.d.ts.map +1 -1
  260. package/tools/testcases/get-testcases.js +13 -3
  261. package/tools/testcases/get-testcases.js.map +1 -1
  262. package/tools/testcases/get-testcases.mjs +13 -3
  263. package/tools/testcases/get-testcases.mjs.map +1 -1
  264. package/tools/testcases/list-testcases.d.mts +1 -1
  265. package/tools/testcases/list-testcases.d.mts.map +1 -1
  266. package/tools/testcases/list-testcases.d.ts +1 -1
  267. package/tools/testcases/list-testcases.d.ts.map +1 -1
  268. package/tools/testcases/list-testcases.js +14 -3
  269. package/tools/testcases/list-testcases.js.map +1 -1
  270. package/tools/testcases/list-testcases.mjs +14 -3
  271. package/tools/testcases/list-testcases.mjs.map +1 -1
  272. package/tools/testcases/update-testcases.d.mts +1 -1
  273. package/tools/testcases/update-testcases.d.mts.map +1 -1
  274. package/tools/testcases/update-testcases.d.ts +1 -1
  275. package/tools/testcases/update-testcases.d.ts.map +1 -1
  276. package/tools/testcases/update-testcases.js +14 -3
  277. package/tools/testcases/update-testcases.js.map +1 -1
  278. package/tools/testcases/update-testcases.mjs +14 -3
  279. package/tools/testcases/update-testcases.mjs.map +1 -1
  280. package/tools/testsets/create-testsets.d.mts +1 -1
  281. package/tools/testsets/create-testsets.d.mts.map +1 -1
  282. package/tools/testsets/create-testsets.d.ts +1 -1
  283. package/tools/testsets/create-testsets.d.ts.map +1 -1
  284. package/tools/testsets/create-testsets.js +12 -3
  285. package/tools/testsets/create-testsets.js.map +1 -1
  286. package/tools/testsets/create-testsets.mjs +12 -3
  287. package/tools/testsets/create-testsets.mjs.map +1 -1
  288. package/tools/testsets/delete-testsets.d.mts +1 -1
  289. package/tools/testsets/delete-testsets.d.mts.map +1 -1
  290. package/tools/testsets/delete-testsets.d.ts +1 -1
  291. package/tools/testsets/delete-testsets.d.ts.map +1 -1
  292. package/tools/testsets/delete-testsets.js +13 -3
  293. package/tools/testsets/delete-testsets.js.map +1 -1
  294. package/tools/testsets/delete-testsets.mjs +13 -3
  295. package/tools/testsets/delete-testsets.mjs.map +1 -1
  296. package/tools/testsets/get-testsets.d.mts +1 -1
  297. package/tools/testsets/get-testsets.d.mts.map +1 -1
  298. package/tools/testsets/get-testsets.d.ts +1 -1
  299. package/tools/testsets/get-testsets.d.ts.map +1 -1
  300. package/tools/testsets/get-testsets.js +13 -3
  301. package/tools/testsets/get-testsets.js.map +1 -1
  302. package/tools/testsets/get-testsets.mjs +13 -3
  303. package/tools/testsets/get-testsets.mjs.map +1 -1
  304. package/tools/testsets/list-testsets.d.mts +1 -1
  305. package/tools/testsets/list-testsets.d.mts.map +1 -1
  306. package/tools/testsets/list-testsets.d.ts +1 -1
  307. package/tools/testsets/list-testsets.d.ts.map +1 -1
  308. package/tools/testsets/list-testsets.js +14 -3
  309. package/tools/testsets/list-testsets.js.map +1 -1
  310. package/tools/testsets/list-testsets.mjs +14 -3
  311. package/tools/testsets/list-testsets.mjs.map +1 -1
  312. package/tools/testsets/update-testsets.d.mts +1 -1
  313. package/tools/testsets/update-testsets.d.mts.map +1 -1
  314. package/tools/testsets/update-testsets.d.ts +1 -1
  315. package/tools/testsets/update-testsets.d.ts.map +1 -1
  316. package/tools/testsets/update-testsets.js +12 -3
  317. package/tools/testsets/update-testsets.js.map +1 -1
  318. package/tools/testsets/update-testsets.mjs +12 -3
  319. package/tools/testsets/update-testsets.mjs.map +1 -1
  320. package/tools/types.d.mts +1 -1
  321. package/tools/types.d.mts.map +1 -1
  322. package/tools/types.d.ts +1 -1
  323. package/tools/types.d.ts.map +1 -1
  324. package/tools/types.js.map +1 -1
  325. package/tools/types.mjs.map +1 -1
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,7 +17,8 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'create_projects',
20
- description: 'Create a new Project.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new Project.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/project',\n $defs: {\n project: {\n type: 'object',\n description: 'A Project in the Scorecard system.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Project.'\n },\n description: {\n type: 'string',\n description: 'The description of the Project.'\n },\n name: {\n type: 'string',\n description: 'The name of the Project.'\n }\n },\n required: [ 'id',\n 'description',\n 'name'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
@@ -29,13 +30,21 @@ export const tool: Tool = {
29
30
  type: 'string',
30
31
  description: 'The name of the Project.',
31
32
  },
33
+ jq_filter: {
34
+ type: 'string',
35
+ title: 'jq Filter',
36
+ description:
37
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
38
+ },
32
39
  },
40
+ required: ['description', 'name'],
33
41
  },
42
+ annotations: {},
34
43
  };
35
44
 
36
45
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
37
- const body = args as any;
38
- return asTextContentResult(await client.projects.create(body));
46
+ const { jq_filter, ...body } = args as any;
47
+ return asTextContentResult(await maybeFilter(jq_filter, await client.projects.create(body)));
39
48
  };
40
49
 
41
50
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'list_projects',
20
20
  description:
21
- 'Retrieve a paginated list of all Projects. Projects are ordered by creation date, with oldest Projects first.',
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a paginated list of all Projects. Projects are ordered by creation date, with oldest Projects first.\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n $ref: '#/$defs/project'\n }\n },\n hasMore: {\n type: 'boolean'\n },\n nextCursor: {\n type: 'string'\n },\n total: {\n type: 'integer'\n }\n },\n required: [ 'data',\n 'hasMore',\n 'nextCursor'\n ],\n $defs: {\n project: {\n type: 'object',\n description: 'A Project in the Scorecard system.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Project.'\n },\n description: {\n type: 'string',\n description: 'The description of the Project.'\n },\n name: {\n type: 'string',\n description: 'The name of the Project.'\n }\n },\n required: [ 'id',\n 'description',\n 'name'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -32,13 +32,24 @@ export const tool: Tool = {
32
32
  description:
33
33
  'Maximum number of items to return (1-100). Use with `cursor` for pagination through large sets.',
34
34
  },
35
+ jq_filter: {
36
+ type: 'string',
37
+ title: 'jq Filter',
38
+ description:
39
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
40
+ },
35
41
  },
42
+ required: [],
43
+ },
44
+ annotations: {
45
+ readOnlyHint: true,
36
46
  },
37
47
  };
38
48
 
39
49
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
40
- const body = args as any;
41
- return asTextContentResult(await client.projects.list(body));
50
+ const { jq_filter, ...body } = args as any;
51
+ const response = await client.projects.list(body).asResponse();
52
+ return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
42
53
  };
43
54
 
44
55
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,7 +17,8 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'create_records',
20
- description: 'Create a new Record in a Run.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new Record in a Run.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/record',\n $defs: {\n record: {\n type: 'object',\n description: 'A record of a system execution in the Scorecard system.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Record.'\n },\n expected: {\n type: 'object',\n description: 'The expected outputs for the Testcase.',\n additionalProperties: true\n },\n inputs: {\n type: 'object',\n description: 'The actual inputs sent to the system, which should match the system\\'s input schema.',\n additionalProperties: true\n },\n outputs: {\n type: 'object',\n description: 'The actual outputs from the system.',\n additionalProperties: true\n },\n runId: {\n type: 'string',\n description: 'The ID of the Run containing this Record.'\n },\n testcaseId: {\n type: 'string',\n description: 'The ID of the Testcase.'\n }\n },\n required: [ 'id',\n 'expected',\n 'inputs',\n 'outputs',\n 'runId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
@@ -27,26 +28,37 @@ export const tool: Tool = {
27
28
  expected: {
28
29
  type: 'object',
29
30
  description: 'The expected outputs for the Testcase.',
31
+ additionalProperties: true,
30
32
  },
31
33
  inputs: {
32
34
  type: 'object',
33
35
  description: "The actual inputs sent to the system, which should match the system's input schema.",
36
+ additionalProperties: true,
34
37
  },
35
38
  outputs: {
36
39
  type: 'object',
37
40
  description: 'The actual outputs from the system.',
41
+ additionalProperties: true,
38
42
  },
39
43
  testcaseId: {
40
44
  type: 'string',
41
45
  description: 'The ID of the Testcase.',
42
46
  },
47
+ jq_filter: {
48
+ type: 'string',
49
+ title: 'jq Filter',
50
+ description:
51
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
52
+ },
43
53
  },
54
+ required: ['runId', 'expected', 'inputs', 'outputs'],
44
55
  },
56
+ annotations: {},
45
57
  };
46
58
 
47
59
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
48
- const { runId, ...body } = args as any;
49
- return asTextContentResult(await client.records.create(runId, body));
60
+ const { runId, jq_filter, ...body } = args as any;
61
+ return asTextContentResult(await maybeFilter(jq_filter, await client.records.create(runId, body)));
50
62
  };
51
63
 
52
64
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,7 +17,8 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'create_runs',
20
- description: 'Create a new Run.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new Run.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/run',\n $defs: {\n run: {\n type: 'object',\n description: 'A Run in the Scorecard system.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Run.'\n },\n metricIds: {\n type: 'array',\n description: 'The IDs of the metrics this Run is using.',\n items: {\n type: 'string'\n }\n },\n status: {\n type: 'string',\n description: 'The status of the Run.',\n enum: [ 'pending',\n 'awaiting_execution',\n 'running_execution',\n 'awaiting_scoring',\n 'running_scoring',\n 'awaiting_human_scoring',\n 'completed'\n ]\n },\n testsetId: {\n type: 'string',\n description: 'The ID of the Testset this Run is testing.'\n },\n systemVersionId: {\n type: 'string',\n description: 'The ID of the system version this Run is using.'\n }\n },\n required: [ 'id',\n 'metricIds',\n 'status',\n 'testsetId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
@@ -39,13 +40,21 @@ export const tool: Tool = {
39
40
  type: 'string',
40
41
  description: 'The ID of the Testset this Run is testing.',
41
42
  },
43
+ jq_filter: {
44
+ type: 'string',
45
+ title: 'jq Filter',
46
+ description:
47
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
48
+ },
42
49
  },
50
+ required: ['projectId', 'metricIds'],
43
51
  },
52
+ annotations: {},
44
53
  };
45
54
 
46
55
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
47
- const { projectId, ...body } = args as any;
48
- return asTextContentResult(await client.runs.create(projectId, body));
56
+ const { projectId, jq_filter, ...body } = args as any;
57
+ return asTextContentResult(await maybeFilter(jq_filter, await client.runs.create(projectId, body)));
49
58
  };
50
59
 
51
60
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'upsert_scores',
20
20
  description:
21
- '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.',
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate 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.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/score',\n $defs: {\n score: {\n type: 'object',\n description: 'A Score represents the evaluation of a Record against a specific MetricConfig. The actual `score` is stored as flexible JSON. While any JSON is accepted, it is expected to conform to the output schema defined by the MetricConfig. Any discrepancies will be noted in the `validationErrors` field, but the Score will still be stored.',\n properties: {\n metricConfigId: {\n type: 'string',\n description: 'The ID of the MetricConfig this Score is for.'\n },\n recordId: {\n type: 'string',\n description: 'The ID of the Record this Score is for.'\n },\n score: {\n type: 'object',\n description: 'The score of the Record, as arbitrary JSON. This data should ideally conform to the output schema defined by the associated MetricConfig. If it doesn\\'t, validation errors will be captured in the `validationErrors` field.',\n additionalProperties: true\n },\n validationErrors: {\n type: 'array',\n description: 'Validation errors found in the Score data. If present, the Score doesn\\'t fully conform to its MetricConfig\\'s schema.',\n items: {\n type: 'object',\n properties: {\n message: {\n type: 'string',\n description: 'Human-readable error description.'\n },\n path: {\n type: 'string',\n description: 'JSON Pointer to the field with the validation error.'\n }\n },\n required: [ 'message',\n 'path'\n ]\n }\n }\n },\n required: [ 'metricConfigId',\n 'recordId',\n 'score'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -32,14 +32,25 @@ export const tool: Tool = {
32
32
  type: 'object',
33
33
  description:
34
34
  "The score of the Record, as arbitrary JSON. This data should ideally conform to the output schema defined by the associated MetricConfig. If it doesn't, validation errors will be captured in the `validationErrors` field.",
35
+ additionalProperties: true,
36
+ },
37
+ jq_filter: {
38
+ type: 'string',
39
+ title: 'jq Filter',
40
+ description:
41
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
35
42
  },
36
43
  },
44
+ required: ['recordId', 'metricConfigId', 'score'],
45
+ },
46
+ annotations: {
47
+ idempotentHint: true,
37
48
  },
38
49
  };
39
50
 
40
51
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
41
- const { metricConfigId, ...body } = args as any;
42
- return asTextContentResult(await client.scores.upsert(metricConfigId, body));
52
+ const { metricConfigId, jq_filter, ...body } = args as any;
53
+ return asTextContentResult(await maybeFilter(jq_filter, await client.scores.upsert(metricConfigId, body)));
43
54
  };
44
55
 
45
56
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,20 +17,31 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'delete_systems',
20
- description: 'Delete a system definition by ID. This will not delete associated system versions.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nDelete a system definition by ID. This will not delete associated system versions.\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n success: {\n type: 'boolean',\n description: 'Whether the deletion was successful.'\n }\n },\n required: [ 'success'\n ]\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
24
25
  systemId: {
25
26
  type: 'string',
26
27
  },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description:
32
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
+ },
27
34
  },
35
+ required: ['systemId'],
36
+ },
37
+ annotations: {
38
+ idempotentHint: true,
28
39
  },
29
40
  };
30
41
 
31
42
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
32
- const { systemId, ...body } = args as any;
33
- return asTextContentResult(await client.systems.delete(systemId));
43
+ const { systemId, jq_filter, ...body } = args as any;
44
+ return asTextContentResult(await maybeFilter(jq_filter, await client.systems.delete(systemId)));
34
45
  };
35
46
 
36
47
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,20 +17,31 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'get_systems',
20
- description: 'Retrieve a specific system by ID.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a specific system by ID.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/system',\n $defs: {\n system: {\n type: 'object',\n description: 'A System Under Test (SUT).\\n\\nSystems are templates - to run evaluations, pair them with a SystemVersion that provides specific\\nparameter values.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system.'\n },\n description: {\n type: 'string',\n description: 'The description of the system.'\n },\n name: {\n type: 'string',\n description: 'The name of the system. Unique within the project.'\n },\n productionVersion: {\n $ref: '#/$defs/system_version'\n },\n versions: {\n type: 'array',\n description: 'The versions of the system.',\n items: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n }\n },\n required: [ 'id',\n 'name'\n ]\n }\n }\n },\n required: [ 'id',\n 'description',\n 'name',\n 'productionVersion',\n 'versions'\n ]\n },\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
24
25
  systemId: {
25
26
  type: 'string',
26
27
  },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description:
32
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
+ },
27
34
  },
35
+ required: ['systemId'],
36
+ },
37
+ annotations: {
38
+ readOnlyHint: true,
28
39
  },
29
40
  };
30
41
 
31
42
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
32
- const { systemId, ...body } = args as any;
33
- return asTextContentResult(await client.systems.get(systemId));
43
+ const { systemId, jq_filter, ...body } = args as any;
44
+ return asTextContentResult(await maybeFilter(jq_filter, await client.systems.get(systemId)));
34
45
  };
35
46
 
36
47
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,7 +17,8 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'list_systems',
20
- description: 'Retrieve a paginated list of all systems. Systems are ordered by creation date.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a paginated list of all systems. Systems are ordered by creation date.\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n $ref: '#/$defs/system'\n }\n },\n hasMore: {\n type: 'boolean'\n },\n nextCursor: {\n type: 'string'\n },\n total: {\n type: 'integer'\n }\n },\n required: [ 'data',\n 'hasMore',\n 'nextCursor'\n ],\n $defs: {\n system: {\n type: 'object',\n description: 'A System Under Test (SUT).\\n\\nSystems are templates - to run evaluations, pair them with a SystemVersion that provides specific\\nparameter values.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system.'\n },\n description: {\n type: 'string',\n description: 'The description of the system.'\n },\n name: {\n type: 'string',\n description: 'The name of the system. Unique within the project.'\n },\n productionVersion: {\n $ref: '#/$defs/system_version'\n },\n versions: {\n type: 'array',\n description: 'The versions of the system.',\n items: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n }\n },\n required: [ 'id',\n 'name'\n ]\n }\n }\n },\n required: [ 'id',\n 'description',\n 'name',\n 'productionVersion',\n 'versions'\n ]\n },\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
@@ -34,13 +35,24 @@ export const tool: Tool = {
34
35
  description:
35
36
  'Maximum number of items to return (1-100). Use with `cursor` for pagination through large sets.',
36
37
  },
38
+ jq_filter: {
39
+ type: 'string',
40
+ title: 'jq Filter',
41
+ description:
42
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
43
+ },
37
44
  },
45
+ required: ['projectId'],
46
+ },
47
+ annotations: {
48
+ readOnlyHint: true,
38
49
  },
39
50
  };
40
51
 
41
52
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
42
- const { projectId, ...body } = args as any;
43
- return asTextContentResult(await client.systems.list(projectId, body));
53
+ const { projectId, jq_filter, ...body } = args as any;
54
+ const response = await client.systems.list(projectId, body).asResponse();
55
+ return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
44
56
  };
45
57
 
46
58
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'update_systems',
20
20
  description:
21
- 'Update an existing system. Only the fields provided in the request body will be updated.\nIf a field is provided, the new content will replace the existing content.\nIf a field is not provided, the existing content will remain unchanged.',
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate an existing system. Only the fields provided in the request body will be updated.\nIf a field is provided, the new content will replace the existing content.\nIf a field is not provided, the existing content will remain unchanged.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/system',\n $defs: {\n system: {\n type: 'object',\n description: 'A System Under Test (SUT).\\n\\nSystems are templates - to run evaluations, pair them with a SystemVersion that provides specific\\nparameter values.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system.'\n },\n description: {\n type: 'string',\n description: 'The description of the system.'\n },\n name: {\n type: 'string',\n description: 'The name of the system. Unique within the project.'\n },\n productionVersion: {\n $ref: '#/$defs/system_version'\n },\n versions: {\n type: 'array',\n description: 'The versions of the system.',\n items: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n }\n },\n required: [ 'id',\n 'name'\n ]\n }\n }\n },\n required: [ 'id',\n 'description',\n 'name',\n 'productionVersion',\n 'versions'\n ]\n },\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -37,13 +37,21 @@ export const tool: Tool = {
37
37
  type: 'string',
38
38
  description: 'The ID of the production version of the system.',
39
39
  },
40
+ jq_filter: {
41
+ type: 'string',
42
+ title: 'jq Filter',
43
+ description:
44
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
45
+ },
40
46
  },
47
+ required: ['systemId'],
41
48
  },
49
+ annotations: {},
42
50
  };
43
51
 
44
52
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
45
- const { systemId, ...body } = args as any;
46
- return asTextContentResult(await client.systems.update(systemId, body));
53
+ const { systemId, jq_filter, ...body } = args as any;
54
+ return asTextContentResult(await maybeFilter(jq_filter, await client.systems.update(systemId, body)));
47
55
  };
48
56
 
49
57
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,7 +17,8 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'upsert_systems',
20
- description: 'Create a new system. If one with the same name in the project exists, it updates it instead.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new system. If one with the same name in the project exists, it updates it instead.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/system',\n $defs: {\n system: {\n type: 'object',\n description: 'A System Under Test (SUT).\\n\\nSystems are templates - to run evaluations, pair them with a SystemVersion that provides specific\\nparameter values.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system.'\n },\n description: {\n type: 'string',\n description: 'The description of the system.'\n },\n name: {\n type: 'string',\n description: 'The name of the system. Unique within the project.'\n },\n productionVersion: {\n $ref: '#/$defs/system_version'\n },\n versions: {\n type: 'array',\n description: 'The versions of the system.',\n items: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n }\n },\n required: [ 'id',\n 'name'\n ]\n }\n }\n },\n required: [ 'id',\n 'description',\n 'name',\n 'productionVersion',\n 'versions'\n ]\n },\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
@@ -27,6 +28,7 @@ export const tool: Tool = {
27
28
  config: {
28
29
  type: 'object',
29
30
  description: 'The configuration of the system.',
31
+ additionalProperties: true,
30
32
  },
31
33
  description: {
32
34
  type: 'string',
@@ -37,13 +39,21 @@ export const tool: Tool = {
37
39
  description:
38
40
  'The name of the system. Should be unique within the project. Default is "Default system"',
39
41
  },
42
+ jq_filter: {
43
+ type: 'string',
44
+ title: 'jq Filter',
45
+ description:
46
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
47
+ },
40
48
  },
49
+ required: ['projectId', 'config'],
41
50
  },
51
+ annotations: {},
42
52
  };
43
53
 
44
54
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
45
- const { projectId, ...body } = args as any;
46
- return asTextContentResult(await client.systems.upsert(projectId, body));
55
+ const { projectId, jq_filter, ...body } = args as any;
56
+ return asTextContentResult(await maybeFilter(jq_filter, await client.systems.upsert(projectId, body)));
47
57
  };
48
58
 
49
59
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -17,20 +17,33 @@ export const metadata: Metadata = {
17
17
 
18
18
  export const tool: Tool = {
19
19
  name: 'get_systems_versions',
20
- description: 'Retrieve a specific system version by ID.',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a specific system version by ID.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/system_version',\n $defs: {\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
21
22
  inputSchema: {
22
23
  type: 'object',
23
24
  properties: {
24
25
  systemVersionId: {
25
26
  type: 'string',
26
27
  },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description:
32
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
+ },
27
34
  },
35
+ required: ['systemVersionId'],
36
+ },
37
+ annotations: {
38
+ readOnlyHint: true,
28
39
  },
29
40
  };
30
41
 
31
42
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
32
- const { systemVersionId, ...body } = args as any;
33
- return asTextContentResult(await client.systems.versions.get(systemVersionId));
43
+ const { systemVersionId, jq_filter, ...body } = args as any;
44
+ return asTextContentResult(
45
+ await maybeFilter(jq_filter, await client.systems.versions.get(systemVersionId)),
46
+ );
34
47
  };
35
48
 
36
49
  export default { metadata, tool, handler };
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { asTextContentResult } from 'scorecard-ai-mcp/tools/types';
3
+ import { maybeFilter } from 'scorecard-ai-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
4
5
 
5
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
- import type { Metadata } from '../../';
7
7
  import Scorecard from 'scorecard-ai';
8
8
 
9
9
  export const metadata: Metadata = {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'upsert_systems_versions',
20
20
  description:
21
- "Create a new system version if it does not already exist. Does **not** set the created version to be the system's production version.\n\nIf there is already a system version with the same config, its name will be updated.",
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new system version if it does not already exist. Does **not** set the created version to be the system's production version.\n\nIf there is already a system version with the same config, its name will be updated.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/system_version',\n $defs: {\n system_version: {\n type: 'object',\n description: 'A SystemVersion defines the specific settings for a System Under Test.\\n\\nSystem versions contain parameter values that determine system behavior during evaluation.\\nThey are immutable snapshots - once created, they never change.\\n\\nWhen running evaluations, you reference a specific systemVersionId to establish which system version to test.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the system version.'\n },\n config: {\n type: 'object',\n description: 'The configuration of the system version.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the system version.'\n },\n systemId: {\n type: 'string',\n description: 'The ID of the system the system version belongs to.'\n }\n },\n required: [ 'id',\n 'config',\n 'name',\n 'systemId'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -28,19 +28,30 @@ export const tool: Tool = {
28
28
  config: {
29
29
  type: 'object',
30
30
  description: 'The configuration of the system version.',
31
+ additionalProperties: true,
31
32
  },
32
33
  name: {
33
34
  type: 'string',
34
35
  description:
35
36
  "The name of the system version. If creating a new system version and the name isn't provided, it will be autogenerated.",
36
37
  },
38
+ jq_filter: {
39
+ type: 'string',
40
+ title: 'jq Filter',
41
+ description:
42
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
43
+ },
37
44
  },
45
+ required: ['systemId', 'config'],
38
46
  },
47
+ annotations: {},
39
48
  };
40
49
 
41
50
  export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
42
- const { systemId, ...body } = args as any;
43
- return asTextContentResult(await client.systems.versions.upsert(systemId, body));
51
+ const { systemId, jq_filter, ...body } = args as any;
52
+ return asTextContentResult(
53
+ await maybeFilter(jq_filter, await client.systems.versions.upsert(systemId, body)),
54
+ );
44
55
  };
45
56
 
46
57
  export default { metadata, tool, handler };