scorecard-ai-mcp 2.4.1 → 2.6.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.
- package/README.md +38 -1
- package/code-tool-types.d.mts +2 -0
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +2 -0
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool.d.mts +45 -3
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +45 -3
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +24 -132
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +24 -99
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +12 -6
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +12 -6
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +10 -2
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +10 -2
- package/docs-search-tool.mjs.map +1 -1
- package/dynamic-tools.d.mts +1 -1
- package/dynamic-tools.d.ts +1 -1
- package/dynamic-tools.js +1 -1
- package/dynamic-tools.mjs +1 -1
- package/filtering.d.mts +1 -0
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -0
- package/filtering.d.ts.map +1 -1
- package/filtering.js +4 -0
- package/filtering.js.map +1 -1
- package/filtering.mjs +3 -0
- package/filtering.mjs.map +1 -1
- package/headers.d.mts.map +1 -1
- package/headers.d.ts.map +1 -1
- package/headers.js +1 -1
- package/headers.js.map +1 -1
- package/headers.mjs +1 -1
- package/headers.mjs.map +1 -1
- package/http.js +2 -2
- package/http.js.map +1 -1
- package/http.mjs +2 -2
- package/http.mjs.map +1 -1
- package/options.d.mts.map +1 -1
- package/options.d.ts.map +1 -1
- package/options.js +6 -3
- package/options.js.map +1 -1
- package/options.mjs +6 -3
- package/options.mjs.map +1 -1
- package/package.json +6 -20
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-types.ts +5 -1
- package/src/code-tool.ts +34 -121
- package/src/docs-search-tool.ts +14 -3
- package/src/dynamic-tools.ts +1 -1
- package/src/filtering.ts +4 -0
- package/src/headers.ts +3 -1
- package/src/http.ts +2 -2
- package/src/options.ts +10 -3
- package/src/server.ts +1 -1
- package/src/tools/index.ts +2 -0
- package/src/tools/metrics/create-metrics.ts +9 -2
- package/src/tools/metrics/delete-metrics.ts +54 -0
- package/src/tools/metrics/get-metrics.ts +9 -2
- package/src/tools/metrics/list-metrics.ts +9 -2
- package/src/tools/metrics/update-metrics.ts +9 -2
- package/src/tools/projects/create-projects.ts +10 -3
- package/src/tools/projects/list-projects.ts +10 -3
- package/src/tools/records/create-records.ts +10 -3
- package/src/tools/records/delete-records.ts +10 -3
- package/src/tools/records/list-records.ts +10 -3
- package/src/tools/runs/create-runs.ts +10 -3
- package/src/tools/runs/get-runs.ts +10 -3
- package/src/tools/runs/list-runs.ts +10 -3
- package/src/tools/scores/upsert-scores.ts +12 -3
- package/src/tools/systems/delete-systems.ts +10 -3
- package/src/tools/systems/get-systems.ts +10 -3
- package/src/tools/systems/list-systems.ts +10 -3
- package/src/tools/systems/update-systems.ts +10 -3
- package/src/tools/systems/upsert-systems.ts +10 -3
- package/src/tools/systems/versions/get-systems-versions.ts +12 -5
- package/src/tools/systems/versions/upsert-systems-versions.ts +12 -5
- package/src/tools/testcases/create-testcases.ts +10 -3
- package/src/tools/testcases/delete-testcases.ts +10 -3
- package/src/tools/testcases/get-testcases.ts +10 -3
- package/src/tools/testcases/list-testcases.ts +10 -3
- package/src/tools/testcases/update-testcases.ts +10 -3
- package/src/tools/testsets/create-testsets.ts +10 -3
- package/src/tools/testsets/delete-testsets.ts +10 -3
- package/src/tools/testsets/get-testsets.ts +10 -3
- package/src/tools/testsets/list-testsets.ts +10 -3
- package/src/tools/testsets/update-testsets.ts +10 -3
- package/src/tools/types.ts +12 -0
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +2 -0
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +2 -0
- package/tools/index.mjs.map +1 -1
- package/tools/metrics/create-metrics.d.mts +12 -6
- package/tools/metrics/create-metrics.d.mts.map +1 -1
- package/tools/metrics/create-metrics.d.ts +12 -6
- package/tools/metrics/create-metrics.d.ts.map +1 -1
- package/tools/metrics/create-metrics.js +13 -1
- package/tools/metrics/create-metrics.js.map +1 -1
- package/tools/metrics/create-metrics.mjs +11 -2
- package/tools/metrics/create-metrics.mjs.map +1 -1
- package/tools/metrics/delete-metrics.d.mts +51 -0
- package/tools/metrics/delete-metrics.d.mts.map +1 -0
- package/tools/metrics/delete-metrics.d.ts +51 -0
- package/tools/metrics/delete-metrics.d.ts.map +1 -0
- package/tools/metrics/delete-metrics.js +54 -0
- package/tools/metrics/delete-metrics.js.map +1 -0
- package/tools/metrics/delete-metrics.mjs +47 -0
- package/tools/metrics/delete-metrics.mjs.map +1 -0
- package/tools/metrics/get-metrics.d.mts +12 -6
- package/tools/metrics/get-metrics.d.mts.map +1 -1
- package/tools/metrics/get-metrics.d.ts +12 -6
- package/tools/metrics/get-metrics.d.ts.map +1 -1
- package/tools/metrics/get-metrics.js +13 -1
- package/tools/metrics/get-metrics.js.map +1 -1
- package/tools/metrics/get-metrics.mjs +11 -2
- package/tools/metrics/get-metrics.mjs.map +1 -1
- package/tools/metrics/list-metrics.d.mts +12 -6
- package/tools/metrics/list-metrics.d.mts.map +1 -1
- package/tools/metrics/list-metrics.d.ts +12 -6
- package/tools/metrics/list-metrics.d.ts.map +1 -1
- package/tools/metrics/list-metrics.js +13 -1
- package/tools/metrics/list-metrics.js.map +1 -1
- package/tools/metrics/list-metrics.mjs +11 -2
- package/tools/metrics/list-metrics.mjs.map +1 -1
- package/tools/metrics/update-metrics.d.mts +12 -6
- package/tools/metrics/update-metrics.d.mts.map +1 -1
- package/tools/metrics/update-metrics.d.ts +12 -6
- package/tools/metrics/update-metrics.d.ts.map +1 -1
- package/tools/metrics/update-metrics.js +13 -1
- package/tools/metrics/update-metrics.js.map +1 -1
- package/tools/metrics/update-metrics.mjs +11 -2
- package/tools/metrics/update-metrics.mjs.map +1 -1
- package/tools/projects/create-projects.d.mts +12 -6
- package/tools/projects/create-projects.d.mts.map +1 -1
- package/tools/projects/create-projects.d.ts +12 -6
- package/tools/projects/create-projects.d.ts.map +1 -1
- package/tools/projects/create-projects.js +13 -1
- package/tools/projects/create-projects.js.map +1 -1
- package/tools/projects/create-projects.mjs +12 -3
- package/tools/projects/create-projects.mjs.map +1 -1
- package/tools/projects/list-projects.d.mts +12 -6
- package/tools/projects/list-projects.d.mts.map +1 -1
- package/tools/projects/list-projects.d.ts +12 -6
- package/tools/projects/list-projects.d.ts.map +1 -1
- package/tools/projects/list-projects.js +13 -1
- package/tools/projects/list-projects.js.map +1 -1
- package/tools/projects/list-projects.mjs +12 -3
- package/tools/projects/list-projects.mjs.map +1 -1
- package/tools/records/create-records.d.mts +12 -6
- package/tools/records/create-records.d.mts.map +1 -1
- package/tools/records/create-records.d.ts +12 -6
- package/tools/records/create-records.d.ts.map +1 -1
- package/tools/records/create-records.js +13 -1
- package/tools/records/create-records.js.map +1 -1
- package/tools/records/create-records.mjs +12 -3
- package/tools/records/create-records.mjs.map +1 -1
- package/tools/records/delete-records.d.mts +12 -6
- package/tools/records/delete-records.d.mts.map +1 -1
- package/tools/records/delete-records.d.ts +12 -6
- package/tools/records/delete-records.d.ts.map +1 -1
- package/tools/records/delete-records.js +13 -1
- package/tools/records/delete-records.js.map +1 -1
- package/tools/records/delete-records.mjs +12 -3
- package/tools/records/delete-records.mjs.map +1 -1
- package/tools/records/list-records.d.mts +12 -6
- package/tools/records/list-records.d.mts.map +1 -1
- package/tools/records/list-records.d.ts +12 -6
- package/tools/records/list-records.d.ts.map +1 -1
- package/tools/records/list-records.js +13 -1
- package/tools/records/list-records.js.map +1 -1
- package/tools/records/list-records.mjs +12 -3
- package/tools/records/list-records.mjs.map +1 -1
- package/tools/runs/create-runs.d.mts +12 -6
- package/tools/runs/create-runs.d.mts.map +1 -1
- package/tools/runs/create-runs.d.ts +12 -6
- package/tools/runs/create-runs.d.ts.map +1 -1
- package/tools/runs/create-runs.js +13 -1
- package/tools/runs/create-runs.js.map +1 -1
- package/tools/runs/create-runs.mjs +12 -3
- package/tools/runs/create-runs.mjs.map +1 -1
- package/tools/runs/get-runs.d.mts +12 -6
- package/tools/runs/get-runs.d.mts.map +1 -1
- package/tools/runs/get-runs.d.ts +12 -6
- package/tools/runs/get-runs.d.ts.map +1 -1
- package/tools/runs/get-runs.js +13 -1
- package/tools/runs/get-runs.js.map +1 -1
- package/tools/runs/get-runs.mjs +12 -3
- package/tools/runs/get-runs.mjs.map +1 -1
- package/tools/runs/list-runs.d.mts +12 -6
- package/tools/runs/list-runs.d.mts.map +1 -1
- package/tools/runs/list-runs.d.ts +12 -6
- package/tools/runs/list-runs.d.ts.map +1 -1
- package/tools/runs/list-runs.js +13 -1
- package/tools/runs/list-runs.js.map +1 -1
- package/tools/runs/list-runs.mjs +12 -3
- package/tools/runs/list-runs.mjs.map +1 -1
- package/tools/scores/upsert-scores.d.mts +12 -6
- package/tools/scores/upsert-scores.d.mts.map +1 -1
- package/tools/scores/upsert-scores.d.ts +12 -6
- package/tools/scores/upsert-scores.d.ts.map +1 -1
- package/tools/scores/upsert-scores.js +13 -1
- package/tools/scores/upsert-scores.js.map +1 -1
- package/tools/scores/upsert-scores.mjs +12 -3
- package/tools/scores/upsert-scores.mjs.map +1 -1
- package/tools/systems/delete-systems.d.mts +12 -6
- package/tools/systems/delete-systems.d.mts.map +1 -1
- package/tools/systems/delete-systems.d.ts +12 -6
- package/tools/systems/delete-systems.d.ts.map +1 -1
- package/tools/systems/delete-systems.js +13 -1
- package/tools/systems/delete-systems.js.map +1 -1
- package/tools/systems/delete-systems.mjs +12 -3
- package/tools/systems/delete-systems.mjs.map +1 -1
- package/tools/systems/get-systems.d.mts +12 -6
- package/tools/systems/get-systems.d.mts.map +1 -1
- package/tools/systems/get-systems.d.ts +12 -6
- package/tools/systems/get-systems.d.ts.map +1 -1
- package/tools/systems/get-systems.js +13 -1
- package/tools/systems/get-systems.js.map +1 -1
- package/tools/systems/get-systems.mjs +12 -3
- package/tools/systems/get-systems.mjs.map +1 -1
- package/tools/systems/list-systems.d.mts +12 -6
- package/tools/systems/list-systems.d.mts.map +1 -1
- package/tools/systems/list-systems.d.ts +12 -6
- package/tools/systems/list-systems.d.ts.map +1 -1
- package/tools/systems/list-systems.js +13 -1
- package/tools/systems/list-systems.js.map +1 -1
- package/tools/systems/list-systems.mjs +12 -3
- package/tools/systems/list-systems.mjs.map +1 -1
- package/tools/systems/update-systems.d.mts +12 -6
- package/tools/systems/update-systems.d.mts.map +1 -1
- package/tools/systems/update-systems.d.ts +12 -6
- package/tools/systems/update-systems.d.ts.map +1 -1
- package/tools/systems/update-systems.js +13 -1
- package/tools/systems/update-systems.js.map +1 -1
- package/tools/systems/update-systems.mjs +12 -3
- package/tools/systems/update-systems.mjs.map +1 -1
- package/tools/systems/upsert-systems.d.mts +12 -6
- package/tools/systems/upsert-systems.d.mts.map +1 -1
- package/tools/systems/upsert-systems.d.ts +12 -6
- package/tools/systems/upsert-systems.d.ts.map +1 -1
- package/tools/systems/upsert-systems.js +13 -1
- package/tools/systems/upsert-systems.js.map +1 -1
- package/tools/systems/upsert-systems.mjs +12 -3
- package/tools/systems/upsert-systems.mjs.map +1 -1
- package/tools/systems/versions/get-systems-versions.d.mts +12 -6
- package/tools/systems/versions/get-systems-versions.d.mts.map +1 -1
- package/tools/systems/versions/get-systems-versions.d.ts +12 -6
- package/tools/systems/versions/get-systems-versions.d.ts.map +1 -1
- package/tools/systems/versions/get-systems-versions.js +13 -1
- package/tools/systems/versions/get-systems-versions.js.map +1 -1
- package/tools/systems/versions/get-systems-versions.mjs +12 -3
- package/tools/systems/versions/get-systems-versions.mjs.map +1 -1
- package/tools/systems/versions/upsert-systems-versions.d.mts +12 -6
- package/tools/systems/versions/upsert-systems-versions.d.mts.map +1 -1
- package/tools/systems/versions/upsert-systems-versions.d.ts +12 -6
- package/tools/systems/versions/upsert-systems-versions.d.ts.map +1 -1
- package/tools/systems/versions/upsert-systems-versions.js +13 -1
- package/tools/systems/versions/upsert-systems-versions.js.map +1 -1
- package/tools/systems/versions/upsert-systems-versions.mjs +12 -3
- package/tools/systems/versions/upsert-systems-versions.mjs.map +1 -1
- package/tools/testcases/create-testcases.d.mts +12 -6
- package/tools/testcases/create-testcases.d.mts.map +1 -1
- package/tools/testcases/create-testcases.d.ts +12 -6
- package/tools/testcases/create-testcases.d.ts.map +1 -1
- package/tools/testcases/create-testcases.js +13 -1
- package/tools/testcases/create-testcases.js.map +1 -1
- package/tools/testcases/create-testcases.mjs +12 -3
- package/tools/testcases/create-testcases.mjs.map +1 -1
- package/tools/testcases/delete-testcases.d.mts +12 -6
- package/tools/testcases/delete-testcases.d.mts.map +1 -1
- package/tools/testcases/delete-testcases.d.ts +12 -6
- package/tools/testcases/delete-testcases.d.ts.map +1 -1
- package/tools/testcases/delete-testcases.js +13 -1
- package/tools/testcases/delete-testcases.js.map +1 -1
- package/tools/testcases/delete-testcases.mjs +12 -3
- package/tools/testcases/delete-testcases.mjs.map +1 -1
- package/tools/testcases/get-testcases.d.mts +12 -6
- package/tools/testcases/get-testcases.d.mts.map +1 -1
- package/tools/testcases/get-testcases.d.ts +12 -6
- package/tools/testcases/get-testcases.d.ts.map +1 -1
- package/tools/testcases/get-testcases.js +13 -1
- package/tools/testcases/get-testcases.js.map +1 -1
- package/tools/testcases/get-testcases.mjs +12 -3
- package/tools/testcases/get-testcases.mjs.map +1 -1
- package/tools/testcases/list-testcases.d.mts +12 -6
- package/tools/testcases/list-testcases.d.mts.map +1 -1
- package/tools/testcases/list-testcases.d.ts +12 -6
- package/tools/testcases/list-testcases.d.ts.map +1 -1
- package/tools/testcases/list-testcases.js +13 -1
- package/tools/testcases/list-testcases.js.map +1 -1
- package/tools/testcases/list-testcases.mjs +12 -3
- package/tools/testcases/list-testcases.mjs.map +1 -1
- package/tools/testcases/update-testcases.d.mts +12 -6
- package/tools/testcases/update-testcases.d.mts.map +1 -1
- package/tools/testcases/update-testcases.d.ts +12 -6
- package/tools/testcases/update-testcases.d.ts.map +1 -1
- package/tools/testcases/update-testcases.js +13 -1
- package/tools/testcases/update-testcases.js.map +1 -1
- package/tools/testcases/update-testcases.mjs +12 -3
- package/tools/testcases/update-testcases.mjs.map +1 -1
- package/tools/testsets/create-testsets.d.mts +12 -6
- package/tools/testsets/create-testsets.d.mts.map +1 -1
- package/tools/testsets/create-testsets.d.ts +12 -6
- package/tools/testsets/create-testsets.d.ts.map +1 -1
- package/tools/testsets/create-testsets.js +13 -1
- package/tools/testsets/create-testsets.js.map +1 -1
- package/tools/testsets/create-testsets.mjs +12 -3
- package/tools/testsets/create-testsets.mjs.map +1 -1
- package/tools/testsets/delete-testsets.d.mts +12 -6
- package/tools/testsets/delete-testsets.d.mts.map +1 -1
- package/tools/testsets/delete-testsets.d.ts +12 -6
- package/tools/testsets/delete-testsets.d.ts.map +1 -1
- package/tools/testsets/delete-testsets.js +13 -1
- package/tools/testsets/delete-testsets.js.map +1 -1
- package/tools/testsets/delete-testsets.mjs +12 -3
- package/tools/testsets/delete-testsets.mjs.map +1 -1
- package/tools/testsets/get-testsets.d.mts +12 -6
- package/tools/testsets/get-testsets.d.mts.map +1 -1
- package/tools/testsets/get-testsets.d.ts +12 -6
- package/tools/testsets/get-testsets.d.ts.map +1 -1
- package/tools/testsets/get-testsets.js +13 -1
- package/tools/testsets/get-testsets.js.map +1 -1
- package/tools/testsets/get-testsets.mjs +12 -3
- package/tools/testsets/get-testsets.mjs.map +1 -1
- package/tools/testsets/list-testsets.d.mts +12 -6
- package/tools/testsets/list-testsets.d.mts.map +1 -1
- package/tools/testsets/list-testsets.d.ts +12 -6
- package/tools/testsets/list-testsets.d.ts.map +1 -1
- package/tools/testsets/list-testsets.js +13 -1
- package/tools/testsets/list-testsets.js.map +1 -1
- package/tools/testsets/list-testsets.mjs +12 -3
- package/tools/testsets/list-testsets.mjs.map +1 -1
- package/tools/testsets/update-testsets.d.mts +12 -6
- package/tools/testsets/update-testsets.d.mts.map +1 -1
- package/tools/testsets/update-testsets.d.ts +12 -6
- package/tools/testsets/update-testsets.d.ts.map +1 -1
- package/tools/testsets/update-testsets.js +13 -1
- package/tools/testsets/update-testsets.js.map +1 -1
- package/tools/testsets/update-testsets.mjs +12 -3
- package/tools/testsets/update-testsets.mjs.map +1 -1
- package/tools/types.d.mts +1 -0
- package/tools/types.d.mts.map +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +12 -0
- package/tools/types.js.map +1 -1
- package/tools/types.mjs +11 -0
- package/tools/types.mjs.map +1 -1
- package/code-tool-paths.cjs +0 -6
- package/code-tool-paths.cjs.map +0 -1
- package/code-tool-paths.d.cts +0 -2
- package/code-tool-paths.d.cts.map +0 -1
- package/code-tool-worker.d.mts +0 -5
- package/code-tool-worker.d.mts.map +0 -1
- package/code-tool-worker.d.ts +0 -5
- package/code-tool-worker.d.ts.map +0 -1
- package/code-tool-worker.js +0 -45
- package/code-tool-worker.js.map +0 -1
- package/code-tool-worker.mjs +0 -40
- package/code-tool-worker.mjs.map +0 -1
- package/src/code-tool-paths.cts +0 -3
- package/src/code-tool-worker.ts +0 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { recordId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.records.delete(recordId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -52,7 +52,14 @@ export const tool: Tool = {
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { runId, jq_filter, ...body } = args as any;
|
|
54
54
|
const response = await client.records.list(runId, body).asResponse();
|
|
55
|
-
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -54,7 +54,14 @@ export const tool: Tool = {
|
|
|
54
54
|
|
|
55
55
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
56
56
|
const { projectId, jq_filter, ...body } = args as any;
|
|
57
|
-
|
|
57
|
+
try {
|
|
58
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.runs.create(projectId, body)));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
61
|
+
return asErrorResult(error.message);
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
58
65
|
};
|
|
59
66
|
|
|
60
67
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { runId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.runs.get(runId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -52,7 +52,14 @@ export const tool: Tool = {
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { projectId, jq_filter, ...body } = args as any;
|
|
54
54
|
const response = await client.runs.list(projectId, body).asResponse();
|
|
55
|
-
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -50,7 +50,16 @@ export const tool: Tool = {
|
|
|
50
50
|
|
|
51
51
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
52
52
|
const { metricConfigId, jq_filter, ...body } = args as any;
|
|
53
|
-
|
|
53
|
+
try {
|
|
54
|
+
return asTextContentResult(
|
|
55
|
+
await maybeFilter(jq_filter, await client.scores.upsert(metricConfigId, body)),
|
|
56
|
+
);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { systemId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.systems.delete(systemId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { systemId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.systems.get(systemId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -52,7 +52,14 @@ export const tool: Tool = {
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { projectId, jq_filter, ...body } = args as any;
|
|
54
54
|
const response = await client.systems.list(projectId, body).asResponse();
|
|
55
|
-
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -51,7 +51,14 @@ export const tool: Tool = {
|
|
|
51
51
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { systemId, jq_filter, ...body } = args as any;
|
|
54
|
-
|
|
54
|
+
try {
|
|
55
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.systems.update(systemId, body)));
|
|
56
|
+
} catch (error) {
|
|
57
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
58
|
+
return asErrorResult(error.message);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
55
62
|
};
|
|
56
63
|
|
|
57
64
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -53,7 +53,14 @@ export const tool: Tool = {
|
|
|
53
53
|
|
|
54
54
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
55
55
|
const { projectId, jq_filter, ...body } = args as any;
|
|
56
|
-
|
|
56
|
+
try {
|
|
57
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.systems.upsert(projectId, body)));
|
|
58
|
+
} catch (error) {
|
|
59
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
60
|
+
return asErrorResult(error.message);
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
57
64
|
};
|
|
58
65
|
|
|
59
66
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,9 +41,16 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { systemVersionId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(
|
|
46
|
+
await maybeFilter(jq_filter, await client.systems.versions.get(systemVersionId)),
|
|
47
|
+
);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -49,9 +49,16 @@ export const tool: Tool = {
|
|
|
49
49
|
|
|
50
50
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
51
51
|
const { systemId, jq_filter, ...body } = args as any;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
try {
|
|
53
|
+
return asTextContentResult(
|
|
54
|
+
await maybeFilter(jq_filter, await client.systems.versions.upsert(systemId, body)),
|
|
55
|
+
);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
58
|
+
return asErrorResult(error.message);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
55
62
|
};
|
|
56
63
|
|
|
57
64
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -54,7 +54,14 @@ export const tool: Tool = {
|
|
|
54
54
|
|
|
55
55
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
56
56
|
const { testsetId, jq_filter, ...body } = args as any;
|
|
57
|
-
|
|
57
|
+
try {
|
|
58
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testcases.create(testsetId, body)));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
61
|
+
return asErrorResult(error.message);
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
58
65
|
};
|
|
59
66
|
|
|
60
67
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testcases.delete(body)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { testcaseId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testcases.get(testcaseId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -52,7 +52,14 @@ export const tool: Tool = {
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { testsetId, jq_filter, ...body } = args as any;
|
|
54
54
|
const response = await client.testcases.list(testsetId, body).asResponse();
|
|
55
|
-
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -46,7 +46,14 @@ export const tool: Tool = {
|
|
|
46
46
|
|
|
47
47
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
48
48
|
const { testcaseId, jq_filter, ...body } = args as any;
|
|
49
|
-
|
|
49
|
+
try {
|
|
50
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testcases.update(testcaseId, body)));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
53
|
+
return asErrorResult(error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -81,7 +81,14 @@ export const tool: Tool = {
|
|
|
81
81
|
|
|
82
82
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
83
83
|
const { projectId, jq_filter, ...body } = args as any;
|
|
84
|
-
|
|
84
|
+
try {
|
|
85
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.create(projectId, body)));
|
|
86
|
+
} catch (error) {
|
|
87
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
88
|
+
return asErrorResult(error.message);
|
|
89
|
+
}
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
85
92
|
};
|
|
86
93
|
|
|
87
94
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { testsetId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.delete(testsetId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { testsetId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.get(testsetId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -52,7 +52,14 @@ export const tool: Tool = {
|
|
|
52
52
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
53
53
|
const { projectId, jq_filter, ...body } = args as any;
|
|
54
54
|
const response = await client.testsets.list(projectId, body).asResponse();
|
|
55
|
-
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -81,7 +81,14 @@ export const tool: Tool = {
|
|
|
81
81
|
|
|
82
82
|
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
83
83
|
const { testsetId, jq_filter, ...body } = args as any;
|
|
84
|
-
|
|
84
|
+
try {
|
|
85
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.update(testsetId, body)));
|
|
86
|
+
} catch (error) {
|
|
87
|
+
if (error instanceof Scorecard.APIError || isJqError(error)) {
|
|
88
|
+
return asErrorResult(error.message);
|
|
89
|
+
}
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
85
92
|
};
|
|
86
93
|
|
|
87
94
|
export default { metadata, tool, handler };
|
package/src/tools/types.ts
CHANGED
|
@@ -87,6 +87,18 @@ export async function asBinaryContentResult(response: Response): Promise<ToolCal
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export function asErrorResult(message: string): ToolCallResult {
|
|
91
|
+
return {
|
|
92
|
+
content: [
|
|
93
|
+
{
|
|
94
|
+
type: 'text',
|
|
95
|
+
text: message,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
isError: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
90
102
|
export type Metadata = {
|
|
91
103
|
resource: string;
|
|
92
104
|
operation: 'read' | 'write';
|
package/tools/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAkC/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAsCxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
|