scorecard-ai-mcp 1.0.0-alpha.7 → 1.0.0-alpha.9
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 +31 -30
- package/compat.d.mts +2 -0
- package/compat.d.mts.map +1 -1
- package/compat.d.ts +2 -0
- package/compat.d.ts.map +1 -1
- package/compat.js +7 -4
- package/compat.js.map +1 -1
- package/compat.mjs +8 -4
- package/compat.mjs.map +1 -1
- package/dynamic-tools.d.mts +1 -1
- package/dynamic-tools.d.mts.map +1 -1
- package/dynamic-tools.d.ts +1 -1
- package/dynamic-tools.d.ts.map +1 -1
- package/dynamic-tools.js +7 -5
- package/dynamic-tools.js.map +1 -1
- package/dynamic-tools.mjs +7 -5
- package/dynamic-tools.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts +1 -6
- package/server.d.mts.map +1 -1
- package/server.d.ts +1 -6
- package/server.d.ts.map +1 -1
- package/server.js +4 -12
- package/server.js.map +1 -1
- package/server.mjs +4 -12
- package/server.mjs.map +1 -1
- package/src/compat.ts +13 -4
- package/src/dynamic-tools.ts +15 -8
- package/src/server.ts +5 -12
- package/src/tools/index.ts +3 -18
- package/src/tools/projects/create-projects.ts +7 -2
- package/src/tools/projects/list-projects.ts +7 -2
- package/src/tools/records/create-records.ts +11 -6
- package/src/tools/runs/create-runs.ts +11 -6
- package/src/tools/scores/upsert-scores.ts +7 -2
- package/src/tools/system-configs/create-system-configs.ts +7 -2
- package/src/tools/system-configs/get-system-configs.ts +7 -5
- package/src/tools/system-configs/list-system-configs.ts +7 -2
- package/src/tools/systems/create-systems.ts +7 -2
- package/src/tools/systems/delete-systems.ts +7 -2
- package/src/tools/systems/get-systems.ts +7 -2
- package/src/tools/systems/list-systems.ts +7 -2
- package/src/tools/systems/update-systems.ts +7 -2
- package/src/tools/testcases/create-testcases.ts +7 -4
- package/src/tools/testcases/delete-testcases.ts +7 -2
- package/src/tools/testcases/get-testcases.ts +7 -2
- package/src/tools/testcases/list-testcases.ts +7 -2
- package/src/tools/testcases/update-testcases.ts +7 -2
- package/src/tools/testsets/create-testsets.ts +14 -9
- package/src/tools/testsets/delete-testsets.ts +7 -2
- package/src/tools/testsets/get-testsets.ts +7 -2
- package/src/tools/testsets/list-testsets.ts +7 -2
- package/src/tools/testsets/update-testsets.ts +14 -9
- package/src/tools/types.ts +104 -0
- package/tools/index.d.mts +2 -13
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts +2 -13
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +0 -2
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +0 -2
- package/tools/index.mjs.map +1 -1
- package/tools/projects/create-projects.d.mts +2 -2
- package/tools/projects/create-projects.d.mts.map +1 -1
- package/tools/projects/create-projects.d.ts +2 -2
- package/tools/projects/create-projects.d.ts.map +1 -1
- package/tools/projects/create-projects.js +6 -2
- package/tools/projects/create-projects.js.map +1 -1
- package/tools/projects/create-projects.mjs +6 -2
- package/tools/projects/create-projects.mjs.map +1 -1
- package/tools/projects/list-projects.d.mts +2 -2
- package/tools/projects/list-projects.d.mts.map +1 -1
- package/tools/projects/list-projects.d.ts +2 -2
- package/tools/projects/list-projects.d.ts.map +1 -1
- package/tools/projects/list-projects.js +6 -2
- package/tools/projects/list-projects.js.map +1 -1
- package/tools/projects/list-projects.mjs +6 -2
- package/tools/projects/list-projects.mjs.map +1 -1
- package/tools/records/create-records.d.mts +2 -2
- package/tools/records/create-records.d.mts.map +1 -1
- package/tools/records/create-records.d.ts +2 -2
- package/tools/records/create-records.d.ts.map +1 -1
- package/tools/records/create-records.js +10 -6
- package/tools/records/create-records.js.map +1 -1
- package/tools/records/create-records.mjs +10 -6
- package/tools/records/create-records.mjs.map +1 -1
- package/tools/runs/create-runs.d.mts +2 -2
- package/tools/runs/create-runs.d.mts.map +1 -1
- package/tools/runs/create-runs.d.ts +2 -2
- package/tools/runs/create-runs.d.ts.map +1 -1
- package/tools/runs/create-runs.js +10 -6
- package/tools/runs/create-runs.js.map +1 -1
- package/tools/runs/create-runs.mjs +10 -6
- package/tools/runs/create-runs.mjs.map +1 -1
- package/tools/scores/upsert-scores.d.mts +2 -2
- package/tools/scores/upsert-scores.d.mts.map +1 -1
- package/tools/scores/upsert-scores.d.ts +2 -2
- package/tools/scores/upsert-scores.d.ts.map +1 -1
- package/tools/scores/upsert-scores.js +6 -2
- package/tools/scores/upsert-scores.js.map +1 -1
- package/tools/scores/upsert-scores.mjs +6 -2
- package/tools/scores/upsert-scores.mjs.map +1 -1
- package/tools/system-configs/create-system-configs.d.mts +2 -2
- package/tools/system-configs/create-system-configs.d.mts.map +1 -1
- package/tools/system-configs/create-system-configs.d.ts +2 -2
- package/tools/system-configs/create-system-configs.d.ts.map +1 -1
- package/tools/system-configs/create-system-configs.js +6 -2
- package/tools/system-configs/create-system-configs.js.map +1 -1
- package/tools/system-configs/create-system-configs.mjs +6 -2
- package/tools/system-configs/create-system-configs.mjs.map +1 -1
- package/tools/system-configs/get-system-configs.d.mts +2 -2
- package/tools/system-configs/get-system-configs.d.mts.map +1 -1
- package/tools/system-configs/get-system-configs.d.ts +2 -2
- package/tools/system-configs/get-system-configs.d.ts.map +1 -1
- package/tools/system-configs/get-system-configs.js +6 -5
- package/tools/system-configs/get-system-configs.js.map +1 -1
- package/tools/system-configs/get-system-configs.mjs +6 -5
- package/tools/system-configs/get-system-configs.mjs.map +1 -1
- package/tools/system-configs/list-system-configs.d.mts +2 -2
- package/tools/system-configs/list-system-configs.d.mts.map +1 -1
- package/tools/system-configs/list-system-configs.d.ts +2 -2
- package/tools/system-configs/list-system-configs.d.ts.map +1 -1
- package/tools/system-configs/list-system-configs.js +6 -2
- package/tools/system-configs/list-system-configs.js.map +1 -1
- package/tools/system-configs/list-system-configs.mjs +6 -2
- package/tools/system-configs/list-system-configs.mjs.map +1 -1
- package/tools/systems/create-systems.d.mts +2 -2
- package/tools/systems/create-systems.d.mts.map +1 -1
- package/tools/systems/create-systems.d.ts +2 -2
- package/tools/systems/create-systems.d.ts.map +1 -1
- package/tools/systems/create-systems.js +6 -2
- package/tools/systems/create-systems.js.map +1 -1
- package/tools/systems/create-systems.mjs +6 -2
- package/tools/systems/create-systems.mjs.map +1 -1
- package/tools/systems/delete-systems.d.mts +2 -2
- package/tools/systems/delete-systems.d.mts.map +1 -1
- package/tools/systems/delete-systems.d.ts +2 -2
- package/tools/systems/delete-systems.d.ts.map +1 -1
- package/tools/systems/delete-systems.js +6 -2
- package/tools/systems/delete-systems.js.map +1 -1
- package/tools/systems/delete-systems.mjs +6 -2
- package/tools/systems/delete-systems.mjs.map +1 -1
- package/tools/systems/get-systems.d.mts +2 -2
- package/tools/systems/get-systems.d.mts.map +1 -1
- package/tools/systems/get-systems.d.ts +2 -2
- package/tools/systems/get-systems.d.ts.map +1 -1
- package/tools/systems/get-systems.js +6 -2
- package/tools/systems/get-systems.js.map +1 -1
- package/tools/systems/get-systems.mjs +6 -2
- package/tools/systems/get-systems.mjs.map +1 -1
- package/tools/systems/list-systems.d.mts +2 -2
- package/tools/systems/list-systems.d.mts.map +1 -1
- package/tools/systems/list-systems.d.ts +2 -2
- package/tools/systems/list-systems.d.ts.map +1 -1
- package/tools/systems/list-systems.js +6 -2
- package/tools/systems/list-systems.js.map +1 -1
- package/tools/systems/list-systems.mjs +6 -2
- package/tools/systems/list-systems.mjs.map +1 -1
- package/tools/systems/update-systems.d.mts +2 -2
- package/tools/systems/update-systems.d.mts.map +1 -1
- package/tools/systems/update-systems.d.ts +2 -2
- package/tools/systems/update-systems.d.ts.map +1 -1
- package/tools/systems/update-systems.js +6 -2
- package/tools/systems/update-systems.js.map +1 -1
- package/tools/systems/update-systems.mjs +6 -2
- package/tools/systems/update-systems.mjs.map +1 -1
- package/tools/testcases/create-testcases.d.mts +2 -2
- package/tools/testcases/create-testcases.d.mts.map +1 -1
- package/tools/testcases/create-testcases.d.ts +2 -2
- package/tools/testcases/create-testcases.d.ts.map +1 -1
- package/tools/testcases/create-testcases.js +6 -3
- package/tools/testcases/create-testcases.js.map +1 -1
- package/tools/testcases/create-testcases.mjs +6 -3
- package/tools/testcases/create-testcases.mjs.map +1 -1
- package/tools/testcases/delete-testcases.d.mts +2 -2
- package/tools/testcases/delete-testcases.d.mts.map +1 -1
- package/tools/testcases/delete-testcases.d.ts +2 -2
- package/tools/testcases/delete-testcases.d.ts.map +1 -1
- package/tools/testcases/delete-testcases.js +6 -2
- package/tools/testcases/delete-testcases.js.map +1 -1
- package/tools/testcases/delete-testcases.mjs +6 -2
- package/tools/testcases/delete-testcases.mjs.map +1 -1
- package/tools/testcases/get-testcases.d.mts +2 -2
- package/tools/testcases/get-testcases.d.mts.map +1 -1
- package/tools/testcases/get-testcases.d.ts +2 -2
- package/tools/testcases/get-testcases.d.ts.map +1 -1
- package/tools/testcases/get-testcases.js +6 -2
- package/tools/testcases/get-testcases.js.map +1 -1
- package/tools/testcases/get-testcases.mjs +6 -2
- package/tools/testcases/get-testcases.mjs.map +1 -1
- package/tools/testcases/list-testcases.d.mts +2 -2
- package/tools/testcases/list-testcases.d.mts.map +1 -1
- package/tools/testcases/list-testcases.d.ts +2 -2
- package/tools/testcases/list-testcases.d.ts.map +1 -1
- package/tools/testcases/list-testcases.js +6 -2
- package/tools/testcases/list-testcases.js.map +1 -1
- package/tools/testcases/list-testcases.mjs +6 -2
- package/tools/testcases/list-testcases.mjs.map +1 -1
- package/tools/testcases/update-testcases.d.mts +2 -2
- package/tools/testcases/update-testcases.d.mts.map +1 -1
- package/tools/testcases/update-testcases.d.ts +2 -2
- package/tools/testcases/update-testcases.d.ts.map +1 -1
- package/tools/testcases/update-testcases.js +6 -2
- package/tools/testcases/update-testcases.js.map +1 -1
- package/tools/testcases/update-testcases.mjs +6 -2
- package/tools/testcases/update-testcases.mjs.map +1 -1
- package/tools/testsets/create-testsets.d.mts +2 -2
- package/tools/testsets/create-testsets.d.mts.map +1 -1
- package/tools/testsets/create-testsets.d.ts +2 -2
- package/tools/testsets/create-testsets.d.ts.map +1 -1
- package/tools/testsets/create-testsets.js +13 -9
- package/tools/testsets/create-testsets.js.map +1 -1
- package/tools/testsets/create-testsets.mjs +13 -9
- package/tools/testsets/create-testsets.mjs.map +1 -1
- package/tools/testsets/delete-testsets.d.mts +2 -2
- package/tools/testsets/delete-testsets.d.mts.map +1 -1
- package/tools/testsets/delete-testsets.d.ts +2 -2
- package/tools/testsets/delete-testsets.d.ts.map +1 -1
- package/tools/testsets/delete-testsets.js +6 -2
- package/tools/testsets/delete-testsets.js.map +1 -1
- package/tools/testsets/delete-testsets.mjs +6 -2
- package/tools/testsets/delete-testsets.mjs.map +1 -1
- package/tools/testsets/get-testsets.d.mts +2 -2
- package/tools/testsets/get-testsets.d.mts.map +1 -1
- package/tools/testsets/get-testsets.d.ts +2 -2
- package/tools/testsets/get-testsets.d.ts.map +1 -1
- package/tools/testsets/get-testsets.js +6 -2
- package/tools/testsets/get-testsets.js.map +1 -1
- package/tools/testsets/get-testsets.mjs +6 -2
- package/tools/testsets/get-testsets.mjs.map +1 -1
- package/tools/testsets/list-testsets.d.mts +2 -2
- package/tools/testsets/list-testsets.d.mts.map +1 -1
- package/tools/testsets/list-testsets.d.ts +2 -2
- package/tools/testsets/list-testsets.d.ts.map +1 -1
- package/tools/testsets/list-testsets.js +6 -2
- package/tools/testsets/list-testsets.js.map +1 -1
- package/tools/testsets/list-testsets.mjs +6 -2
- package/tools/testsets/list-testsets.mjs.map +1 -1
- package/tools/testsets/update-testsets.d.mts +2 -2
- package/tools/testsets/update-testsets.d.mts.map +1 -1
- package/tools/testsets/update-testsets.d.ts +2 -2
- package/tools/testsets/update-testsets.d.ts.map +1 -1
- package/tools/testsets/update-testsets.js +13 -9
- package/tools/testsets/update-testsets.js.map +1 -1
- package/tools/testsets/update-testsets.mjs +13 -9
- package/tools/testsets/update-testsets.mjs.map +1 -1
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/src/tools/runs/update-runs.ts +0 -44
- package/tools/runs/update-runs.d.mts +0 -32
- package/tools/runs/update-runs.d.mts.map +0 -1
- package/tools/runs/update-runs.d.ts +0 -32
- package/tools/runs/update-runs.d.ts.map +0 -1
- package/tools/runs/update-runs.js +0 -41
- package/tools/runs/update-runs.js.map +0 -1
- package/tools/runs/update-runs.mjs +0 -37
- package/tools/runs/update-runs.mjs.map +0 -1
package/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAkCtF,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAkCtF,oBA6BC;AAKD,kCAkBC;AAKD,wCAYC;AApGD,oEAAoE;AACpE,sCAAsE;AACtE,iEAAyG;AACzG,gEAAqC;AACrC,wCAKkB;AAClB,sDAA+C;AAE/C,oCAAoC;AAA3B,kGAAA,SAAS,OAAA;AAElB,yBAAyB;AACZ,QAAA,MAAM,GAAG,IAAI,kBAAS,CACjC;IACE,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,eAAe;CACzB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF;;;GAGG;AACH,SAAgB,IAAI,CAAC,MAKpB;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,YAAY,kBAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzF,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,IAAI,iBAAS,CAAC;IAExD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,C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AAO;AACT,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB;AAEK,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IACpD,IAAI,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
package/server.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export { endpoints } from "./tools.mjs";
|
|
|
9
9
|
// Create server instance
|
|
10
10
|
export const server = new McpServer({
|
|
11
11
|
name: 'scorecard_ai_api',
|
|
12
|
-
version: '1.0.0-alpha.
|
|
12
|
+
version: '1.0.0-alpha.9',
|
|
13
13
|
}, {
|
|
14
14
|
capabilities: {
|
|
15
15
|
tools: {},
|
|
@@ -23,7 +23,7 @@ export function init(params) {
|
|
|
23
23
|
const server = params.server instanceof McpServer ? params.server.server : params.server;
|
|
24
24
|
const providedEndpoints = params.endpoints || endpoints;
|
|
25
25
|
const endpointMap = Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
|
|
26
|
-
const client = params.client || new Scorecard({});
|
|
26
|
+
const client = params.client || new Scorecard({ environment: (readEnv('SCORECARD_ENVIRONMENT') || undefined) });
|
|
27
27
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
28
28
|
return {
|
|
29
29
|
tools: providedEndpoints.map((endpoint) => endpoint.tool),
|
|
@@ -61,17 +61,9 @@ export function selectTools(endpoints, options) {
|
|
|
61
61
|
export async function executeHandler(tool, handler, client, args, compatibilityOptions) {
|
|
62
62
|
const options = { ...defaultClientCapabilities, ...compatibilityOptions };
|
|
63
63
|
if (options.validJson && args) {
|
|
64
|
-
args =
|
|
64
|
+
args = parseEmbeddedJSON(args, tool.inputSchema);
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
content: [
|
|
69
|
-
{
|
|
70
|
-
type: 'text',
|
|
71
|
-
text: JSON.stringify(result, null, 2),
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
};
|
|
66
|
+
return await handler(client, args || {});
|
|
75
67
|
}
|
|
76
68
|
export const readEnv = (env) => {
|
|
77
69
|
if (typeof globalThis.process !== 'undefined') {
|
package/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EAAE,qBAAqB,EAAE,sBAAsB,EAAQ,MAAM,oCAAoC;OACjG,SAAS,MAAM,cAAc;OAC7B,EACL,iCAAiC,EAEjC,yBAAyB,EACzB,iBAAiB,GAClB;OACM,EAAE,YAAY,EAAE;OAEhB,EAAE,SAAS,EAAE;AAEpB,yBAAyB;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,SAAS,CACjC;IACE,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,eAAe;CACzB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,MAKpB;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,YAAY,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzF,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC;IAExD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,C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AAC,CAAC"}
|
package/src/compat.ts
CHANGED
|
@@ -148,7 +148,11 @@ export function removeTopLevelUnions(tool: Tool): Tool[] {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
function findUsedDefs(
|
|
151
|
+
function findUsedDefs(
|
|
152
|
+
schema: JSONSchema,
|
|
153
|
+
defs: Record<string, JSONSchema>,
|
|
154
|
+
visited: Set<string> = new Set(),
|
|
155
|
+
): Record<string, JSONSchema> {
|
|
152
156
|
const usedDefs: Record<string, JSONSchema> = {};
|
|
153
157
|
|
|
154
158
|
if (typeof schema !== 'object' || schema === null) {
|
|
@@ -160,9 +164,11 @@ function findUsedDefs(schema: JSONSchema, defs: Record<string, JSONSchema>): Rec
|
|
|
160
164
|
if (refParts[0] === '#' && refParts[1] === '$defs' && refParts[2]) {
|
|
161
165
|
const defName = refParts[2];
|
|
162
166
|
const def = defs[defName];
|
|
163
|
-
if (def) {
|
|
167
|
+
if (def && !visited.has(schema.$ref)) {
|
|
164
168
|
usedDefs[defName] = def;
|
|
165
|
-
|
|
169
|
+
visited.add(schema.$ref);
|
|
170
|
+
Object.assign(usedDefs, findUsedDefs(def, defs, visited));
|
|
171
|
+
visited.delete(schema.$ref);
|
|
166
172
|
}
|
|
167
173
|
}
|
|
168
174
|
return usedDefs;
|
|
@@ -170,13 +176,16 @@ function findUsedDefs(schema: JSONSchema, defs: Record<string, JSONSchema>): Rec
|
|
|
170
176
|
|
|
171
177
|
for (const key in schema) {
|
|
172
178
|
if (key !== '$defs' && typeof schema[key] === 'object' && schema[key] !== null) {
|
|
173
|
-
Object.assign(usedDefs, findUsedDefs(schema[key] as JSONSchema, defs));
|
|
179
|
+
Object.assign(usedDefs, findUsedDefs(schema[key] as JSONSchema, defs, visited));
|
|
174
180
|
}
|
|
175
181
|
}
|
|
176
182
|
|
|
177
183
|
return usedDefs;
|
|
178
184
|
}
|
|
179
185
|
|
|
186
|
+
// Export for testing
|
|
187
|
+
export { findUsedDefs };
|
|
188
|
+
|
|
180
189
|
/**
|
|
181
190
|
* Inlines all $refs in a schema, eliminating $defs.
|
|
182
191
|
* If a circular reference is detected, the circular property is removed.
|
package/src/dynamic-tools.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Scorecard from 'scorecard-ai';
|
|
2
|
-
import { Endpoint } from './tools';
|
|
2
|
+
import { Endpoint, asTextContentResult, ToolCallResult } from './tools/types';
|
|
3
3
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { Cabidela } from '@cloudflare/cabidela';
|
|
@@ -41,7 +41,10 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
41
41
|
description: 'List or search for all endpoints in the Scorecard TypeScript API',
|
|
42
42
|
inputSchema: zodToInputSchema(listEndpointsSchema),
|
|
43
43
|
},
|
|
44
|
-
handler: async (
|
|
44
|
+
handler: async (
|
|
45
|
+
client: Scorecard,
|
|
46
|
+
args: Record<string, unknown> | undefined,
|
|
47
|
+
): Promise<ToolCallResult> => {
|
|
45
48
|
const query = args && listEndpointsSchema.parse(args).search_query?.trim();
|
|
46
49
|
|
|
47
50
|
const filteredEndpoints =
|
|
@@ -49,15 +52,16 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
49
52
|
endpoints.filter((endpoint) => {
|
|
50
53
|
const fieldsToMatch = [
|
|
51
54
|
endpoint.tool.name,
|
|
55
|
+
endpoint.tool.description,
|
|
52
56
|
endpoint.metadata.resource,
|
|
53
57
|
endpoint.metadata.operation,
|
|
54
58
|
...endpoint.metadata.tags,
|
|
55
59
|
];
|
|
56
|
-
return fieldsToMatch.some((field) => field.toLowerCase().includes(query.toLowerCase()));
|
|
60
|
+
return fieldsToMatch.some((field) => field && field.toLowerCase().includes(query.toLowerCase()));
|
|
57
61
|
})
|
|
58
62
|
: endpoints;
|
|
59
63
|
|
|
60
|
-
return {
|
|
64
|
+
return asTextContentResult({
|
|
61
65
|
tools: filteredEndpoints.map(({ tool, metadata }) => ({
|
|
62
66
|
name: tool.name,
|
|
63
67
|
description: tool.description,
|
|
@@ -65,7 +69,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
65
69
|
operation: metadata.operation,
|
|
66
70
|
tags: metadata.tags,
|
|
67
71
|
})),
|
|
68
|
-
};
|
|
72
|
+
});
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
|
|
@@ -94,7 +98,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
94
98
|
if (!endpoint) {
|
|
95
99
|
throw new Error(`Endpoint ${endpointName} not found`);
|
|
96
100
|
}
|
|
97
|
-
return endpoint.tool;
|
|
101
|
+
return asTextContentResult(endpoint.tool);
|
|
98
102
|
},
|
|
99
103
|
};
|
|
100
104
|
|
|
@@ -119,7 +123,10 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
119
123
|
'Invoke an endpoint in the Scorecard TypeScript API. Note: use the `list_api_endpoints` tool to get the list of endpoints and `get_api_endpoint_schema` tool to get the schema for an endpoint.',
|
|
120
124
|
inputSchema: zodToInputSchema(invokeEndpointSchema),
|
|
121
125
|
},
|
|
122
|
-
handler: async (
|
|
126
|
+
handler: async (
|
|
127
|
+
client: Scorecard,
|
|
128
|
+
args: Record<string, unknown> | undefined,
|
|
129
|
+
): Promise<ToolCallResult> => {
|
|
123
130
|
if (!args) {
|
|
124
131
|
throw new Error('No endpoint provided');
|
|
125
132
|
}
|
|
@@ -144,7 +151,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
144
151
|
throw new Error(`Invalid arguments for endpoint ${endpoint_name}:\n${error}`);
|
|
145
152
|
}
|
|
146
153
|
|
|
147
|
-
return endpoint.handler(client, endpointArgs);
|
|
154
|
+
return await endpoint.handler(client, endpointArgs);
|
|
148
155
|
},
|
|
149
156
|
};
|
|
150
157
|
|
package/src/server.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { endpoints } from './tools';
|
|
|
19
19
|
export const server = new McpServer(
|
|
20
20
|
{
|
|
21
21
|
name: 'scorecard_ai_api',
|
|
22
|
-
version: '1.0.0-alpha.
|
|
22
|
+
version: '1.0.0-alpha.9',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
capabilities: {
|
|
@@ -43,7 +43,8 @@ export function init(params: {
|
|
|
43
43
|
|
|
44
44
|
const endpointMap = Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
|
|
45
45
|
|
|
46
|
-
const client =
|
|
46
|
+
const client =
|
|
47
|
+
params.client || new Scorecard({ environment: (readEnv('SCORECARD_ENVIRONMENT') || undefined) as any });
|
|
47
48
|
|
|
48
49
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
49
50
|
return {
|
|
@@ -97,17 +98,9 @@ export async function executeHandler(
|
|
|
97
98
|
) {
|
|
98
99
|
const options = { ...defaultClientCapabilities, ...compatibilityOptions };
|
|
99
100
|
if (options.validJson && args) {
|
|
100
|
-
args =
|
|
101
|
+
args = parseEmbeddedJSON(args, tool.inputSchema);
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
content: [
|
|
105
|
-
{
|
|
106
|
-
type: 'text',
|
|
107
|
-
text: JSON.stringify(result, null, 2),
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
};
|
|
103
|
+
return await handler(client, args || {});
|
|
111
104
|
}
|
|
112
105
|
|
|
113
106
|
export const readEnv = (env: string): string | undefined => {
|
package/src/tools/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import { Metadata, Endpoint, HandlerFunction } from './types';
|
|
4
|
+
|
|
5
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
5
6
|
|
|
6
7
|
import create_projects from './projects/create-projects';
|
|
7
8
|
import list_projects from './projects/list-projects';
|
|
@@ -16,7 +17,6 @@ import list_testcases from './testcases/list-testcases';
|
|
|
16
17
|
import delete_testcases from './testcases/delete-testcases';
|
|
17
18
|
import get_testcases from './testcases/get-testcases';
|
|
18
19
|
import create_runs from './runs/create-runs';
|
|
19
|
-
import update_runs from './runs/update-runs';
|
|
20
20
|
import create_records from './records/create-records';
|
|
21
21
|
import upsert_scores from './scores/upsert-scores';
|
|
22
22
|
import create_systems from './systems/create-systems';
|
|
@@ -28,20 +28,6 @@ import create_system_configs from './system-configs/create-system-configs';
|
|
|
28
28
|
import list_system_configs from './system-configs/list-system-configs';
|
|
29
29
|
import get_system_configs from './system-configs/get-system-configs';
|
|
30
30
|
|
|
31
|
-
export type HandlerFunction = (client: Scorecard, args: Record<string, unknown> | undefined) => Promise<any>;
|
|
32
|
-
|
|
33
|
-
export type Metadata = {
|
|
34
|
-
resource: string;
|
|
35
|
-
operation: 'read' | 'write';
|
|
36
|
-
tags: string[];
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type Endpoint = {
|
|
40
|
-
metadata: Metadata;
|
|
41
|
-
tool: Tool;
|
|
42
|
-
handler: HandlerFunction;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
31
|
export const endpoints: Endpoint[] = [];
|
|
46
32
|
|
|
47
33
|
function addEndpoint(endpoint: Endpoint) {
|
|
@@ -61,7 +47,6 @@ addEndpoint(list_testcases);
|
|
|
61
47
|
addEndpoint(delete_testcases);
|
|
62
48
|
addEndpoint(get_testcases);
|
|
63
49
|
addEndpoint(create_runs);
|
|
64
|
-
addEndpoint(update_runs);
|
|
65
50
|
addEndpoint(create_records);
|
|
66
51
|
addEndpoint(upsert_scores);
|
|
67
52
|
addEndpoint(create_systems);
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'projects',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/projects',
|
|
15
|
+
operationId: 'createProject',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -28,9 +33,9 @@ export const tool: Tool = {
|
|
|
28
33
|
},
|
|
29
34
|
};
|
|
30
35
|
|
|
31
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
36
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
32
37
|
const body = args as any;
|
|
33
|
-
return client.projects.create(body);
|
|
38
|
+
return asTextContentResult(await client.projects.create(body));
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'projects',
|
|
9
11
|
operation: 'read',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/projects',
|
|
15
|
+
operationId: 'listProjects',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -31,9 +36,9 @@ export const tool: Tool = {
|
|
|
31
36
|
},
|
|
32
37
|
};
|
|
33
38
|
|
|
34
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
39
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
35
40
|
const body = args as any;
|
|
36
|
-
return client.projects.list(body);
|
|
41
|
+
return asTextContentResult(await client.projects.list(body));
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'records',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/runs/{runId}/records',
|
|
15
|
+
operationId: 'createRecord',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -19,13 +24,13 @@ export const tool: Tool = {
|
|
|
19
24
|
runId: {
|
|
20
25
|
type: 'string',
|
|
21
26
|
},
|
|
22
|
-
|
|
27
|
+
expected: {
|
|
23
28
|
type: 'object',
|
|
24
|
-
description:
|
|
29
|
+
description: 'The expected outputs for the Testcase.',
|
|
25
30
|
},
|
|
26
|
-
|
|
31
|
+
inputs: {
|
|
27
32
|
type: 'object',
|
|
28
|
-
description:
|
|
33
|
+
description: "The actual inputs sent to the system, which should match the system's input schema.",
|
|
29
34
|
},
|
|
30
35
|
outputs: {
|
|
31
36
|
type: 'object',
|
|
@@ -39,9 +44,9 @@ export const tool: Tool = {
|
|
|
39
44
|
},
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
47
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
43
48
|
const { runId, ...body } = args as any;
|
|
44
|
-
return client.records.create(runId, body);
|
|
49
|
+
return asTextContentResult(await client.records.create(runId, body));
|
|
45
50
|
};
|
|
46
51
|
|
|
47
52
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'runs',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/projects/{projectId}/runs',
|
|
15
|
+
operationId: 'createRun',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -26,21 +31,21 @@ export const tool: Tool = {
|
|
|
26
31
|
type: 'string',
|
|
27
32
|
},
|
|
28
33
|
},
|
|
29
|
-
testsetId: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: 'The ID of the Testset this Run is testing.',
|
|
32
|
-
},
|
|
33
34
|
systemConfigId: {
|
|
34
35
|
type: 'string',
|
|
35
36
|
description: 'The ID of the system configuration this Run is using.',
|
|
36
37
|
},
|
|
38
|
+
testsetId: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'The ID of the Testset this Run is testing.',
|
|
41
|
+
},
|
|
37
42
|
},
|
|
38
43
|
},
|
|
39
44
|
};
|
|
40
45
|
|
|
41
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
46
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
42
47
|
const { projectId, ...body } = args as any;
|
|
43
|
-
return client.runs.create(projectId, body);
|
|
48
|
+
return asTextContentResult(await client.runs.create(projectId, body));
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'scores',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'put',
|
|
14
|
+
httpPath: '/records/{recordId}/scores/{metricConfigId}',
|
|
15
|
+
operationId: 'upsertScore',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -32,9 +37,9 @@ export const tool: Tool = {
|
|
|
32
37
|
},
|
|
33
38
|
};
|
|
34
39
|
|
|
35
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
40
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
36
41
|
const { metricConfigId, ...body } = args as any;
|
|
37
|
-
return client.scores.upsert(metricConfigId, body);
|
|
42
|
+
return asTextContentResult(await client.scores.upsert(metricConfigId, body));
|
|
38
43
|
};
|
|
39
44
|
|
|
40
45
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'system_configs',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/systems/{systemId}/configs',
|
|
15
|
+
operationId: 'createSystemConfig',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -51,9 +56,9 @@ export const tool: Tool = {
|
|
|
51
56
|
},
|
|
52
57
|
};
|
|
53
58
|
|
|
54
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
59
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
55
60
|
const { systemId, ...body } = args as any;
|
|
56
|
-
return client.systemConfigs.create(systemId, body);
|
|
61
|
+
return asTextContentResult(await client.systemConfigs.create(systemId, body));
|
|
57
62
|
};
|
|
58
63
|
|
|
59
64
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'system_configs',
|
|
9
11
|
operation: 'read',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/systems/configs/{systemConfigId}',
|
|
15
|
+
operationId: 'getSystemConfig',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -16,9 +21,6 @@ export const tool: Tool = {
|
|
|
16
21
|
inputSchema: {
|
|
17
22
|
type: 'object',
|
|
18
23
|
properties: {
|
|
19
|
-
systemId: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
},
|
|
22
24
|
systemConfigId: {
|
|
23
25
|
type: 'string',
|
|
24
26
|
},
|
|
@@ -26,9 +28,9 @@ export const tool: Tool = {
|
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
30
32
|
const { systemConfigId, ...body } = args as any;
|
|
31
|
-
return client.systemConfigs.get(systemConfigId
|
|
33
|
+
return asTextContentResult(await client.systemConfigs.get(systemConfigId));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'system_configs',
|
|
9
11
|
operation: 'read',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/systems/{systemId}/configs',
|
|
15
|
+
operationId: 'listSystemConfigs',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -34,9 +39,9 @@ export const tool: Tool = {
|
|
|
34
39
|
},
|
|
35
40
|
};
|
|
36
41
|
|
|
37
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
42
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
38
43
|
const { systemId, ...body } = args as any;
|
|
39
|
-
return client.systemConfigs.list(systemId, body);
|
|
44
|
+
return asTextContentResult(await client.systemConfigs.list(systemId, body));
|
|
40
45
|
};
|
|
41
46
|
|
|
42
47
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'systems',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/projects/{projectId}/systems',
|
|
15
|
+
operationId: 'createSystem',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -44,9 +49,9 @@ export const tool: Tool = {
|
|
|
44
49
|
},
|
|
45
50
|
};
|
|
46
51
|
|
|
47
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
52
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
48
53
|
const { projectId, ...body } = args as any;
|
|
49
|
-
return client.systems.create(projectId, body);
|
|
54
|
+
return asTextContentResult(await client.systems.create(projectId, body));
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'systems',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'delete',
|
|
14
|
+
httpPath: '/systems/{systemId}',
|
|
15
|
+
operationId: 'deleteSystem',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -23,9 +28,9 @@ export const tool: Tool = {
|
|
|
23
28
|
},
|
|
24
29
|
};
|
|
25
30
|
|
|
26
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
27
32
|
const { systemId, ...body } = args as any;
|
|
28
|
-
return client.systems.delete(systemId);
|
|
33
|
+
return asTextContentResult(await client.systems.delete(systemId));
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import Scorecard from 'scorecard-ai';
|
|
@@ -8,6 +10,9 @@ export const metadata: Metadata = {
|
|
|
8
10
|
resource: 'systems',
|
|
9
11
|
operation: 'read',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/systems/{systemId}',
|
|
15
|
+
operationId: 'getSystem',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
@@ -23,9 +28,9 @@ export const tool: Tool = {
|
|
|
23
28
|
},
|
|
24
29
|
};
|
|
25
30
|
|
|
26
|
-
export const handler = (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
|
|
27
32
|
const { systemId, ...body } = args as any;
|
|
28
|
-
return client.systems.get(systemId);
|
|
33
|
+
return asTextContentResult(await client.systems.get(systemId));
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
export default { metadata, tool, handler };
|