scorecard-ai-mcp 2.6.0 → 3.0.0-beta.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/LICENSE +1 -1
- package/README.md +14 -225
- package/code-tool-types.d.mts +6 -9
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +6 -9
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool.d.mts +2 -44
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +2 -44
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +39 -7
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +40 -8
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +3 -3
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +3 -3
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +1 -1
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +1 -18
- package/http.js.map +1 -1
- package/http.mjs +1 -18
- package/http.mjs.map +1 -1
- package/index.js +4 -40
- package/index.js.map +1 -1
- package/index.mjs +4 -40
- package/index.mjs.map +1 -1
- package/options.d.mts +0 -9
- package/options.d.mts.map +1 -1
- package/options.d.ts +0 -9
- package/options.d.ts.map +1 -1
- package/options.js +6 -361
- package/options.js.map +1 -1
- package/options.mjs +6 -361
- package/options.mjs.map +1 -1
- package/package.json +9 -49
- package/server.d.mts +3 -8
- package/server.d.mts.map +1 -1
- package/server.d.ts +3 -8
- package/server.d.ts.map +1 -1
- package/server.js +12 -65
- package/server.js.map +1 -1
- package/server.mjs +11 -62
- package/server.mjs.map +1 -1
- package/src/code-tool-types.ts +6 -9
- package/src/code-tool.ts +45 -11
- package/src/docs-search-tool.ts +1 -1
- package/src/http.ts +1 -19
- package/src/index.ts +5 -52
- package/src/options.ts +7 -388
- package/src/server.ts +12 -72
- package/src/stdio.ts +2 -3
- package/src/{tools/types.ts → types.ts} +1 -1
- package/stdio.d.mts +1 -2
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +1 -2
- package/stdio.d.ts.map +1 -1
- package/stdio.js +2 -2
- package/stdio.js.map +1 -1
- package/stdio.mjs +2 -2
- package/stdio.mjs.map +1 -1
- package/{tools/types.d.mts → types.d.mts} +1 -1
- package/types.d.mts.map +1 -0
- package/{tools/types.d.ts → types.d.ts} +1 -1
- package/types.d.ts.map +1 -0
- package/types.js.map +1 -0
- package/types.mjs.map +1 -0
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -3
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -3
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -24
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -16
- package/filtering.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -159
- package/src/filtering.ts +0 -18
- package/src/tools/index.ts +0 -131
- package/src/tools/metrics/create-metrics.ts +0 -383
- package/src/tools/metrics/delete-metrics.ts +0 -54
- package/src/tools/metrics/get-metrics.ts +0 -46
- package/src/tools/metrics/list-metrics.ts +0 -58
- package/src/tools/metrics/update-metrics.ts +0 -383
- package/src/tools/projects/create-projects.ts +0 -57
- package/src/tools/projects/list-projects.ts +0 -62
- package/src/tools/records/create-records.ts +0 -71
- package/src/tools/records/delete-records.ts +0 -54
- package/src/tools/records/list-records.ts +0 -65
- package/src/tools/runs/create-runs.ts +0 -67
- package/src/tools/runs/get-runs.ts +0 -54
- package/src/tools/runs/list-runs.ts +0 -65
- package/src/tools/scores/upsert-scores.ts +0 -65
- package/src/tools/systems/delete-systems.ts +0 -54
- package/src/tools/systems/get-systems.ts +0 -54
- package/src/tools/systems/list-systems.ts +0 -65
- package/src/tools/systems/update-systems.ts +0 -64
- package/src/tools/systems/upsert-systems.ts +0 -66
- package/src/tools/systems/versions/get-systems-versions.ts +0 -56
- package/src/tools/systems/versions/upsert-systems-versions.ts +0 -64
- package/src/tools/testcases/create-testcases.ts +0 -67
- package/src/tools/testcases/delete-testcases.ts +0 -56
- package/src/tools/testcases/get-testcases.ts +0 -54
- package/src/tools/testcases/list-testcases.ts +0 -65
- package/src/tools/testcases/update-testcases.ts +0 -59
- package/src/tools/testsets/create-testsets.ts +0 -94
- package/src/tools/testsets/delete-testsets.ts +0 -54
- package/src/tools/testsets/get-testsets.ts +0 -54
- package/src/tools/testsets/list-testsets.ts +0 -65
- package/src/tools/testsets/update-testsets.ts +0 -94
- package/src/tools.ts +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -115
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -108
- package/tools/index.mjs.map +0 -1
- package/tools/metrics/create-metrics.d.mts +0 -51
- package/tools/metrics/create-metrics.d.mts.map +0 -1
- package/tools/metrics/create-metrics.d.ts +0 -51
- package/tools/metrics/create-metrics.d.ts.map +0 -1
- package/tools/metrics/create-metrics.js +0 -381
- package/tools/metrics/create-metrics.js.map +0 -1
- package/tools/metrics/create-metrics.mjs +0 -374
- package/tools/metrics/create-metrics.mjs.map +0 -1
- package/tools/metrics/delete-metrics.d.mts +0 -51
- package/tools/metrics/delete-metrics.d.mts.map +0 -1
- package/tools/metrics/delete-metrics.d.ts +0 -51
- package/tools/metrics/delete-metrics.d.ts.map +0 -1
- package/tools/metrics/delete-metrics.js +0 -54
- package/tools/metrics/delete-metrics.js.map +0 -1
- package/tools/metrics/delete-metrics.mjs +0 -47
- package/tools/metrics/delete-metrics.mjs.map +0 -1
- package/tools/metrics/get-metrics.d.mts +0 -51
- package/tools/metrics/get-metrics.d.mts.map +0 -1
- package/tools/metrics/get-metrics.d.ts +0 -51
- package/tools/metrics/get-metrics.d.ts.map +0 -1
- package/tools/metrics/get-metrics.js +0 -48
- package/tools/metrics/get-metrics.js.map +0 -1
- package/tools/metrics/get-metrics.mjs +0 -41
- package/tools/metrics/get-metrics.mjs.map +0 -1
- package/tools/metrics/list-metrics.d.mts +0 -51
- package/tools/metrics/list-metrics.d.mts.map +0 -1
- package/tools/metrics/list-metrics.d.ts +0 -51
- package/tools/metrics/list-metrics.d.ts.map +0 -1
- package/tools/metrics/list-metrics.js +0 -57
- package/tools/metrics/list-metrics.js.map +0 -1
- package/tools/metrics/list-metrics.mjs +0 -50
- package/tools/metrics/list-metrics.mjs.map +0 -1
- package/tools/metrics/update-metrics.d.mts +0 -51
- package/tools/metrics/update-metrics.d.mts.map +0 -1
- package/tools/metrics/update-metrics.d.ts +0 -51
- package/tools/metrics/update-metrics.d.ts.map +0 -1
- package/tools/metrics/update-metrics.js +0 -381
- package/tools/metrics/update-metrics.js.map +0 -1
- package/tools/metrics/update-metrics.mjs +0 -374
- package/tools/metrics/update-metrics.mjs.map +0 -1
- package/tools/projects/create-projects.d.mts +0 -51
- package/tools/projects/create-projects.d.mts.map +0 -1
- package/tools/projects/create-projects.d.ts +0 -51
- package/tools/projects/create-projects.d.ts.map +0 -1
- package/tools/projects/create-projects.js +0 -57
- package/tools/projects/create-projects.js.map +0 -1
- package/tools/projects/create-projects.mjs +0 -50
- package/tools/projects/create-projects.mjs.map +0 -1
- package/tools/projects/list-projects.d.mts +0 -51
- package/tools/projects/list-projects.d.mts.map +0 -1
- package/tools/projects/list-projects.d.ts +0 -51
- package/tools/projects/list-projects.d.ts.map +0 -1
- package/tools/projects/list-projects.js +0 -60
- package/tools/projects/list-projects.js.map +0 -1
- package/tools/projects/list-projects.mjs +0 -53
- package/tools/projects/list-projects.mjs.map +0 -1
- package/tools/records/create-records.d.mts +0 -51
- package/tools/records/create-records.d.mts.map +0 -1
- package/tools/records/create-records.d.ts +0 -51
- package/tools/records/create-records.d.ts.map +0 -1
- package/tools/records/create-records.js +0 -71
- package/tools/records/create-records.js.map +0 -1
- package/tools/records/create-records.mjs +0 -64
- package/tools/records/create-records.mjs.map +0 -1
- package/tools/records/delete-records.d.mts +0 -51
- package/tools/records/delete-records.d.mts.map +0 -1
- package/tools/records/delete-records.d.ts +0 -51
- package/tools/records/delete-records.d.ts.map +0 -1
- package/tools/records/delete-records.js +0 -54
- package/tools/records/delete-records.js.map +0 -1
- package/tools/records/delete-records.mjs +0 -47
- package/tools/records/delete-records.mjs.map +0 -1
- package/tools/records/list-records.d.mts +0 -51
- package/tools/records/list-records.d.mts.map +0 -1
- package/tools/records/list-records.d.ts +0 -51
- package/tools/records/list-records.d.ts.map +0 -1
- package/tools/records/list-records.js +0 -63
- package/tools/records/list-records.js.map +0 -1
- package/tools/records/list-records.mjs +0 -56
- package/tools/records/list-records.mjs.map +0 -1
- package/tools/runs/create-runs.d.mts +0 -51
- package/tools/runs/create-runs.d.mts.map +0 -1
- package/tools/runs/create-runs.d.ts +0 -51
- package/tools/runs/create-runs.d.ts.map +0 -1
- package/tools/runs/create-runs.js +0 -67
- package/tools/runs/create-runs.js.map +0 -1
- package/tools/runs/create-runs.mjs +0 -60
- package/tools/runs/create-runs.mjs.map +0 -1
- package/tools/runs/get-runs.d.mts +0 -51
- package/tools/runs/get-runs.d.mts.map +0 -1
- package/tools/runs/get-runs.d.ts +0 -51
- package/tools/runs/get-runs.d.ts.map +0 -1
- package/tools/runs/get-runs.js +0 -54
- package/tools/runs/get-runs.js.map +0 -1
- package/tools/runs/get-runs.mjs +0 -47
- package/tools/runs/get-runs.mjs.map +0 -1
- package/tools/runs/list-runs.d.mts +0 -51
- package/tools/runs/list-runs.d.mts.map +0 -1
- package/tools/runs/list-runs.d.ts +0 -51
- package/tools/runs/list-runs.d.ts.map +0 -1
- package/tools/runs/list-runs.js +0 -63
- package/tools/runs/list-runs.js.map +0 -1
- package/tools/runs/list-runs.mjs +0 -56
- package/tools/runs/list-runs.mjs.map +0 -1
- package/tools/scores/upsert-scores.d.mts +0 -51
- package/tools/scores/upsert-scores.d.mts.map +0 -1
- package/tools/scores/upsert-scores.d.ts +0 -51
- package/tools/scores/upsert-scores.d.ts.map +0 -1
- package/tools/scores/upsert-scores.js +0 -62
- package/tools/scores/upsert-scores.js.map +0 -1
- package/tools/scores/upsert-scores.mjs +0 -55
- package/tools/scores/upsert-scores.mjs.map +0 -1
- package/tools/systems/delete-systems.d.mts +0 -51
- package/tools/systems/delete-systems.d.mts.map +0 -1
- package/tools/systems/delete-systems.d.ts +0 -51
- package/tools/systems/delete-systems.d.ts.map +0 -1
- package/tools/systems/delete-systems.js +0 -54
- package/tools/systems/delete-systems.js.map +0 -1
- package/tools/systems/delete-systems.mjs +0 -47
- package/tools/systems/delete-systems.mjs.map +0 -1
- package/tools/systems/get-systems.d.mts +0 -51
- package/tools/systems/get-systems.d.mts.map +0 -1
- package/tools/systems/get-systems.d.ts +0 -51
- package/tools/systems/get-systems.d.ts.map +0 -1
- package/tools/systems/get-systems.js +0 -54
- package/tools/systems/get-systems.js.map +0 -1
- package/tools/systems/get-systems.mjs +0 -47
- package/tools/systems/get-systems.mjs.map +0 -1
- package/tools/systems/list-systems.d.mts +0 -51
- package/tools/systems/list-systems.d.mts.map +0 -1
- package/tools/systems/list-systems.d.ts +0 -51
- package/tools/systems/list-systems.d.ts.map +0 -1
- package/tools/systems/list-systems.js +0 -63
- package/tools/systems/list-systems.js.map +0 -1
- package/tools/systems/list-systems.mjs +0 -56
- package/tools/systems/list-systems.mjs.map +0 -1
- package/tools/systems/update-systems.d.mts +0 -51
- package/tools/systems/update-systems.d.mts.map +0 -1
- package/tools/systems/update-systems.d.ts +0 -51
- package/tools/systems/update-systems.d.ts.map +0 -1
- package/tools/systems/update-systems.js +0 -64
- package/tools/systems/update-systems.js.map +0 -1
- package/tools/systems/update-systems.mjs +0 -57
- package/tools/systems/update-systems.mjs.map +0 -1
- package/tools/systems/upsert-systems.d.mts +0 -51
- package/tools/systems/upsert-systems.d.mts.map +0 -1
- package/tools/systems/upsert-systems.d.ts +0 -51
- package/tools/systems/upsert-systems.d.ts.map +0 -1
- package/tools/systems/upsert-systems.js +0 -65
- package/tools/systems/upsert-systems.js.map +0 -1
- package/tools/systems/upsert-systems.mjs +0 -58
- package/tools/systems/upsert-systems.mjs.map +0 -1
- package/tools/systems/versions/get-systems-versions.d.mts +0 -51
- package/tools/systems/versions/get-systems-versions.d.mts.map +0 -1
- package/tools/systems/versions/get-systems-versions.d.ts +0 -51
- package/tools/systems/versions/get-systems-versions.d.ts.map +0 -1
- package/tools/systems/versions/get-systems-versions.js +0 -54
- package/tools/systems/versions/get-systems-versions.js.map +0 -1
- package/tools/systems/versions/get-systems-versions.mjs +0 -47
- package/tools/systems/versions/get-systems-versions.mjs.map +0 -1
- package/tools/systems/versions/upsert-systems-versions.d.mts +0 -51
- package/tools/systems/versions/upsert-systems-versions.d.mts.map +0 -1
- package/tools/systems/versions/upsert-systems-versions.d.ts +0 -51
- package/tools/systems/versions/upsert-systems-versions.d.ts.map +0 -1
- package/tools/systems/versions/upsert-systems-versions.js +0 -61
- package/tools/systems/versions/upsert-systems-versions.js.map +0 -1
- package/tools/systems/versions/upsert-systems-versions.mjs +0 -54
- package/tools/systems/versions/upsert-systems-versions.mjs.map +0 -1
- package/tools/testcases/create-testcases.d.mts +0 -51
- package/tools/testcases/create-testcases.d.mts.map +0 -1
- package/tools/testcases/create-testcases.d.ts +0 -51
- package/tools/testcases/create-testcases.d.ts.map +0 -1
- package/tools/testcases/create-testcases.js +0 -67
- package/tools/testcases/create-testcases.js.map +0 -1
- package/tools/testcases/create-testcases.mjs +0 -60
- package/tools/testcases/create-testcases.mjs.map +0 -1
- package/tools/testcases/delete-testcases.d.mts +0 -51
- package/tools/testcases/delete-testcases.d.mts.map +0 -1
- package/tools/testcases/delete-testcases.d.ts +0 -51
- package/tools/testcases/delete-testcases.d.ts.map +0 -1
- package/tools/testcases/delete-testcases.js +0 -56
- package/tools/testcases/delete-testcases.js.map +0 -1
- package/tools/testcases/delete-testcases.mjs +0 -49
- package/tools/testcases/delete-testcases.mjs.map +0 -1
- package/tools/testcases/get-testcases.d.mts +0 -51
- package/tools/testcases/get-testcases.d.mts.map +0 -1
- package/tools/testcases/get-testcases.d.ts +0 -51
- package/tools/testcases/get-testcases.d.ts.map +0 -1
- package/tools/testcases/get-testcases.js +0 -54
- package/tools/testcases/get-testcases.js.map +0 -1
- package/tools/testcases/get-testcases.mjs +0 -47
- package/tools/testcases/get-testcases.mjs.map +0 -1
- package/tools/testcases/list-testcases.d.mts +0 -51
- package/tools/testcases/list-testcases.d.mts.map +0 -1
- package/tools/testcases/list-testcases.d.ts +0 -51
- package/tools/testcases/list-testcases.d.ts.map +0 -1
- package/tools/testcases/list-testcases.js +0 -63
- package/tools/testcases/list-testcases.js.map +0 -1
- package/tools/testcases/list-testcases.mjs +0 -56
- package/tools/testcases/list-testcases.mjs.map +0 -1
- package/tools/testcases/update-testcases.d.mts +0 -51
- package/tools/testcases/update-testcases.d.mts.map +0 -1
- package/tools/testcases/update-testcases.d.ts +0 -51
- package/tools/testcases/update-testcases.d.ts.map +0 -1
- package/tools/testcases/update-testcases.js +0 -59
- package/tools/testcases/update-testcases.js.map +0 -1
- package/tools/testcases/update-testcases.mjs +0 -52
- package/tools/testcases/update-testcases.mjs.map +0 -1
- package/tools/testsets/create-testsets.d.mts +0 -51
- package/tools/testsets/create-testsets.d.mts.map +0 -1
- package/tools/testsets/create-testsets.d.ts +0 -51
- package/tools/testsets/create-testsets.d.ts.map +0 -1
- package/tools/testsets/create-testsets.js +0 -93
- package/tools/testsets/create-testsets.js.map +0 -1
- package/tools/testsets/create-testsets.mjs +0 -86
- package/tools/testsets/create-testsets.mjs.map +0 -1
- package/tools/testsets/delete-testsets.d.mts +0 -51
- package/tools/testsets/delete-testsets.d.mts.map +0 -1
- package/tools/testsets/delete-testsets.d.ts +0 -51
- package/tools/testsets/delete-testsets.d.ts.map +0 -1
- package/tools/testsets/delete-testsets.js +0 -54
- package/tools/testsets/delete-testsets.js.map +0 -1
- package/tools/testsets/delete-testsets.mjs +0 -47
- package/tools/testsets/delete-testsets.mjs.map +0 -1
- package/tools/testsets/get-testsets.d.mts +0 -51
- package/tools/testsets/get-testsets.d.mts.map +0 -1
- package/tools/testsets/get-testsets.d.ts +0 -51
- package/tools/testsets/get-testsets.d.ts.map +0 -1
- package/tools/testsets/get-testsets.js +0 -54
- package/tools/testsets/get-testsets.js.map +0 -1
- package/tools/testsets/get-testsets.mjs +0 -47
- package/tools/testsets/get-testsets.mjs.map +0 -1
- package/tools/testsets/list-testsets.d.mts +0 -51
- package/tools/testsets/list-testsets.d.mts.map +0 -1
- package/tools/testsets/list-testsets.d.ts +0 -51
- package/tools/testsets/list-testsets.d.ts.map +0 -1
- package/tools/testsets/list-testsets.js +0 -63
- package/tools/testsets/list-testsets.js.map +0 -1
- package/tools/testsets/list-testsets.mjs +0 -56
- package/tools/testsets/list-testsets.mjs.map +0 -1
- package/tools/testsets/update-testsets.d.mts +0 -51
- package/tools/testsets/update-testsets.d.mts.map +0 -1
- package/tools/testsets/update-testsets.d.ts +0 -51
- package/tools/testsets/update-testsets.d.ts.map +0 -1
- package/tools/testsets/update-testsets.js +0 -93
- package/tools/testsets/update-testsets.js.map +0 -1
- package/tools/testsets/update-testsets.mjs +0 -86
- package/tools/testsets/update-testsets.mjs.map +0 -1
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js.map +0 -1
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
- /package/{tools/types.js → types.js} +0 -0
- /package/{tools/types.mjs → types.mjs} +0 -0
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Scorecard
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ For clients with a configuration JSON, it might look something like this:
|
|
|
26
26
|
"mcpServers": {
|
|
27
27
|
"scorecard_ai_api": {
|
|
28
28
|
"command": "npx",
|
|
29
|
-
"args": ["-y", "scorecard-ai-mcp"
|
|
29
|
+
"args": ["-y", "scorecard-ai-mcp"],
|
|
30
30
|
"env": {
|
|
31
31
|
"SCORECARD_API_KEY": "My API Key",
|
|
32
32
|
"SCORECARD_ENVIRONMENT": "production"
|
|
@@ -56,113 +56,25 @@ If you use Claude Code, you can install the MCP server by running the command be
|
|
|
56
56
|
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
|
|
57
57
|
|
|
58
58
|
```
|
|
59
|
-
claude mcp add
|
|
59
|
+
claude mcp add scorecard_ai_mcp_api --env SCORECARD_API_KEY="Your SCORECARD_API_KEY here." -- npx -y scorecard-ai-mcp
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
##
|
|
62
|
+
## Code Mode
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
This MCP server is built on the "Code Mode" tool scheme. In this MCP Server,
|
|
65
|
+
your agent will write code against the TypeScript SDK, which will then be executed in an
|
|
66
|
+
isolated sandbox. To accomplish this, the server will expose two tools to your agent:
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
|
|
68
|
+
- The first tool is a docs search tool, which can be used to generically query for
|
|
69
|
+
documentation about your API/SDK.
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
- The second tool is a code tool, where the agent can write code against the TypeScript SDK.
|
|
72
|
+
The code will be executed in a sandbox environment without web or filesystem access. Then,
|
|
73
|
+
anything the code returns or prints will be returned to the agent as the result of the
|
|
74
|
+
tool call.
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
context window.
|
|
75
|
-
|
|
76
|
-
You can filter by multiple aspects:
|
|
77
|
-
|
|
78
|
-
- `--tool` includes a specific tool by name
|
|
79
|
-
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
|
|
80
|
-
- `--operation` includes just read (get/list) or just write operations
|
|
81
|
-
|
|
82
|
-
### Dynamic tools
|
|
83
|
-
|
|
84
|
-
If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
|
|
85
|
-
expose the following tools:
|
|
86
|
-
|
|
87
|
-
1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
|
|
88
|
-
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
|
|
89
|
-
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
|
|
90
|
-
|
|
91
|
-
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
|
|
92
|
-
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
|
|
93
|
-
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
|
|
94
|
-
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
|
|
95
|
-
you can opt-in to explicit tools, the dynamic tools, or both.
|
|
96
|
-
|
|
97
|
-
See more information with `--help`.
|
|
98
|
-
|
|
99
|
-
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
|
|
100
|
-
|
|
101
|
-
Use `--list` to see the list of available tools, or see below.
|
|
102
|
-
|
|
103
|
-
### Code execution
|
|
104
|
-
|
|
105
|
-
If you specify `--tools=code` to the MCP server, it will expose just two tools:
|
|
106
|
-
|
|
107
|
-
- `search_docs` - Searches the API documentation and returns a list of markdown results
|
|
108
|
-
- `execute` - Runs code against the TypeScript client
|
|
109
|
-
|
|
110
|
-
This allows the LLM to implement more complex logic by chaining together many API calls without loading
|
|
111
|
-
intermediary results into its context window.
|
|
112
|
-
|
|
113
|
-
The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
|
|
114
|
-
|
|
115
|
-
### Specifying the MCP Client
|
|
116
|
-
|
|
117
|
-
Different clients have varying abilities to handle arbitrary tools and schemas.
|
|
118
|
-
|
|
119
|
-
You can specify the client you are using with the `--client` argument, and the MCP server will automatically
|
|
120
|
-
serve tools and schemas that are more compatible with that client.
|
|
121
|
-
|
|
122
|
-
- `--client=<type>`: Set all capabilities based on a known MCP client
|
|
123
|
-
|
|
124
|
-
- Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
|
|
125
|
-
- Example: `--client=cursor`
|
|
126
|
-
|
|
127
|
-
Additionally, if you have a client not on the above list, or the client has gotten better
|
|
128
|
-
over time, you can manually enable or disable certain capabilities:
|
|
129
|
-
|
|
130
|
-
- `--capability=<name>`: Specify individual client capabilities
|
|
131
|
-
- Available capabilities:
|
|
132
|
-
- `top-level-unions`: Enable support for top-level unions in tool schemas
|
|
133
|
-
- `valid-json`: Enable JSON string parsing for arguments
|
|
134
|
-
- `refs`: Enable support for $ref pointers in schemas
|
|
135
|
-
- `unions`: Enable support for union types (anyOf) in schemas
|
|
136
|
-
- `formats`: Enable support for format validations in schemas (e.g. date-time, email)
|
|
137
|
-
- `tool-name-length=N`: Set maximum tool name length to N characters
|
|
138
|
-
- Example: `--capability=top-level-unions --capability=tool-name-length=40`
|
|
139
|
-
- Example: `--capability=top-level-unions,tool-name-length=40`
|
|
140
|
-
|
|
141
|
-
### Examples
|
|
142
|
-
|
|
143
|
-
1. Filter for read operations on cards:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
--resource=cards --operation=read
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
2. Exclude specific tools while including others:
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
--resource=cards --no-tool=create_cards
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
3. Configure for Cursor client with custom max tool name length:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
--client=cursor --capability=tool-name-length=40
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
4. Complex filtering with multiple criteria:
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
|
|
165
|
-
```
|
|
76
|
+
Using this scheme, agents are capable of performing very complex tasks deterministically
|
|
77
|
+
and repeatably.
|
|
166
78
|
|
|
167
79
|
## Running remotely
|
|
168
80
|
|
|
@@ -189,126 +101,3 @@ A configuration JSON for this server might look like this, assuming the server i
|
|
|
189
101
|
}
|
|
190
102
|
}
|
|
191
103
|
```
|
|
192
|
-
|
|
193
|
-
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
|
|
194
|
-
For example, to exclude specific tools while including others, use the URL:
|
|
195
|
-
|
|
196
|
-
```
|
|
197
|
-
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## Importing the tools and server individually
|
|
207
|
-
|
|
208
|
-
```js
|
|
209
|
-
// Import the server, generated endpoints, or the init function
|
|
210
|
-
import { server, endpoints, init } from "scorecard-ai-mcp/server";
|
|
211
|
-
|
|
212
|
-
// import a specific tool
|
|
213
|
-
import createProjects from "scorecard-ai-mcp/tools/projects/create-projects";
|
|
214
|
-
|
|
215
|
-
// initialize the server and all endpoints
|
|
216
|
-
init({ server, endpoints });
|
|
217
|
-
|
|
218
|
-
// manually start server
|
|
219
|
-
const transport = new StdioServerTransport();
|
|
220
|
-
await server.connect(transport);
|
|
221
|
-
|
|
222
|
-
// or initialize your own server with specific tools
|
|
223
|
-
const myServer = new McpServer(...);
|
|
224
|
-
|
|
225
|
-
// define your own endpoint
|
|
226
|
-
const myCustomEndpoint = {
|
|
227
|
-
tool: {
|
|
228
|
-
name: 'my_custom_tool',
|
|
229
|
-
description: 'My custom tool',
|
|
230
|
-
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
|
|
231
|
-
},
|
|
232
|
-
handler: async (client: client, args: any) => {
|
|
233
|
-
return { myResponse: 'Hello world!' };
|
|
234
|
-
})
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// initialize the server with your custom endpoints
|
|
238
|
-
init({ server: myServer, endpoints: [createProjects, myCustomEndpoint] });
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## Available Tools
|
|
242
|
-
|
|
243
|
-
The following tools are available in this MCP server.
|
|
244
|
-
|
|
245
|
-
### Resource `projects`:
|
|
246
|
-
|
|
247
|
-
- `create_projects` (`write`): Create a new Project.
|
|
248
|
-
- `list_projects` (`read`): Retrieve a paginated list of all Projects. Projects are ordered by creation date, with oldest Projects first.
|
|
249
|
-
|
|
250
|
-
### Resource `testsets`:
|
|
251
|
-
|
|
252
|
-
- `create_testsets` (`write`): Create a new Testset for a Project. The Testset will be created in the Project specified in the path.
|
|
253
|
-
- `update_testsets` (`write`): Update a Testset. Only the fields provided in the request body will be updated.
|
|
254
|
-
If a field is provided, the new content will replace the existing content.
|
|
255
|
-
If a field is not provided, the existing content will remain unchanged.
|
|
256
|
-
|
|
257
|
-
When updating the schema:
|
|
258
|
-
|
|
259
|
-
- If field mappings are not provided and existing mappings reference fields that no longer exist, those mappings will be automatically removed
|
|
260
|
-
- To preserve all existing mappings, ensure all referenced fields remain in the updated schema
|
|
261
|
-
- For complete control, provide both schema and fieldMapping when updating the schema
|
|
262
|
-
|
|
263
|
-
- `list_testsets` (`read`): Retrieve a paginated list of Testsets belonging to a Project.
|
|
264
|
-
- `delete_testsets` (`write`): Delete Testset
|
|
265
|
-
- `get_testsets` (`read`): Get Testset
|
|
266
|
-
|
|
267
|
-
### Resource `testcases`:
|
|
268
|
-
|
|
269
|
-
- `create_testcases` (`write`): Create multiple Testcases in the specified Testset.
|
|
270
|
-
- `update_testcases` (`write`): Replace the data of an existing Testcase while keeping its ID.
|
|
271
|
-
- `list_testcases` (`read`): Retrieve a paginated list of Testcases belonging to a Testset.
|
|
272
|
-
- `delete_testcases` (`write`): Delete multiple Testcases by their IDs.
|
|
273
|
-
- `get_testcases` (`read`): Retrieve a specific Testcase by ID.
|
|
274
|
-
|
|
275
|
-
### Resource `runs`:
|
|
276
|
-
|
|
277
|
-
- `create_runs` (`write`): Create a new Run.
|
|
278
|
-
- `list_runs` (`read`): Retrieve a paginated list of all Runs for a Project. Runs are ordered by creation date, most recent first.
|
|
279
|
-
- `get_runs` (`read`): Retrieve a specific Run by ID.
|
|
280
|
-
|
|
281
|
-
### Resource `metrics`:
|
|
282
|
-
|
|
283
|
-
- `create_metrics` (`write`): Create a new Metric for evaluating system outputs. The structure of a metric depends on the evalType and outputType of the metric.
|
|
284
|
-
- `update_metrics` (`write`): Update an existing Metric. You must specify the evalType and outputType of the metric. The structure of a metric depends on the evalType and outputType of the metric.
|
|
285
|
-
- `list_metrics` (`read`): List Metrics configured for the specified Project. Metrics are returned in reverse chronological order.
|
|
286
|
-
- `delete_metrics` (`write`): Delete a specific Metric by ID. The metric will be removed from metric groups and monitors.
|
|
287
|
-
- `get_metrics` (`read`): Retrieve a specific Metric by ID.
|
|
288
|
-
|
|
289
|
-
### Resource `records`:
|
|
290
|
-
|
|
291
|
-
- `create_records` (`write`): Create a new Record in a Run.
|
|
292
|
-
- `list_records` (`read`): Retrieve a paginated list of Records for a Run, including all scores for each record.
|
|
293
|
-
- `delete_records` (`write`): Delete a specific Record by ID.
|
|
294
|
-
|
|
295
|
-
### Resource `scores`:
|
|
296
|
-
|
|
297
|
-
- `upsert_scores` (`write`): Create or update a Score for a given Record and MetricConfig. If a Score with the specified Record ID and MetricConfig ID already exists, it will be updated. Otherwise, a new Score will be created. The score provided should conform to the schema defined by the MetricConfig; otherwise, validation errors will be reported.
|
|
298
|
-
|
|
299
|
-
### Resource `systems`:
|
|
300
|
-
|
|
301
|
-
- `update_systems` (`write`): Update an existing system. Only the fields provided in the request body will be updated.
|
|
302
|
-
If a field is provided, the new content will replace the existing content.
|
|
303
|
-
If a field is not provided, the existing content will remain unchanged.
|
|
304
|
-
- `list_systems` (`read`): Retrieve a paginated list of all systems. Systems are ordered by creation date.
|
|
305
|
-
- `delete_systems` (`write`): Delete a system definition by ID. This will not delete associated system versions.
|
|
306
|
-
- `get_systems` (`read`): Retrieve a specific system by ID.
|
|
307
|
-
- `upsert_systems` (`write`): Create a new system. If one with the same name in the project exists, it updates it instead.
|
|
308
|
-
|
|
309
|
-
### Resource `systems.versions`:
|
|
310
|
-
|
|
311
|
-
- `get_systems_versions` (`read`): Retrieve a specific system version by ID.
|
|
312
|
-
- `upsert_systems_versions` (`write`): Create a new system version if it does not already exist. Does **not** set the created version to be the system's production version.
|
|
313
|
-
|
|
314
|
-
If there is already a system version with the same config, its name will be updated.
|
package/code-tool-types.d.mts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { ClientOptions } from 'scorecard-ai';
|
|
2
2
|
export type WorkerInput = {
|
|
3
|
-
|
|
3
|
+
project_name: string;
|
|
4
4
|
code: string;
|
|
5
|
+
client_opts: ClientOptions;
|
|
5
6
|
};
|
|
6
|
-
export type
|
|
7
|
+
export type WorkerOutput = {
|
|
8
|
+
is_error: boolean;
|
|
7
9
|
result: unknown | null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export type WorkerError = {
|
|
12
|
-
message: string | undefined;
|
|
13
|
-
logLines: string[];
|
|
14
|
-
errLines: string[];
|
|
10
|
+
log_lines: string[];
|
|
11
|
+
err_lines: string[];
|
|
15
12
|
};
|
|
16
13
|
//# sourceMappingURL=code-tool-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/code-tool-types.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { ClientOptions } from 'scorecard-ai';
|
|
2
2
|
export type WorkerInput = {
|
|
3
|
-
|
|
3
|
+
project_name: string;
|
|
4
4
|
code: string;
|
|
5
|
+
client_opts: ClientOptions;
|
|
5
6
|
};
|
|
6
|
-
export type
|
|
7
|
+
export type WorkerOutput = {
|
|
8
|
+
is_error: boolean;
|
|
7
9
|
result: unknown | null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export type WorkerError = {
|
|
12
|
-
message: string | undefined;
|
|
13
|
-
logLines: string[];
|
|
14
|
-
errLines: string[];
|
|
10
|
+
log_lines: string[];
|
|
11
|
+
err_lines: string[];
|
|
15
12
|
};
|
|
16
13
|
//# sourceMappingURL=code-tool-types.d.ts.map
|
package/code-tool-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/code-tool.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpTool } from "./types.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* A tool that runs code against a copy of the SDK.
|
|
4
4
|
*
|
|
@@ -8,47 +8,5 @@ import { Metadata, ToolCallResult } from "./tools/types.mjs";
|
|
|
8
8
|
*
|
|
9
9
|
* @param endpoints - The endpoints to include in the list.
|
|
10
10
|
*/
|
|
11
|
-
export declare function codeTool():
|
|
12
|
-
metadata: Metadata;
|
|
13
|
-
tool: {
|
|
14
|
-
inputSchema: {
|
|
15
|
-
[x: string]: unknown;
|
|
16
|
-
type: "object";
|
|
17
|
-
properties?: {
|
|
18
|
-
[x: string]: object;
|
|
19
|
-
} | undefined;
|
|
20
|
-
required?: string[] | undefined;
|
|
21
|
-
};
|
|
22
|
-
name: string;
|
|
23
|
-
description?: string | undefined;
|
|
24
|
-
outputSchema?: {
|
|
25
|
-
[x: string]: unknown;
|
|
26
|
-
type: "object";
|
|
27
|
-
properties?: {
|
|
28
|
-
[x: string]: object;
|
|
29
|
-
} | undefined;
|
|
30
|
-
required?: string[] | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
annotations?: {
|
|
33
|
-
title?: string | undefined;
|
|
34
|
-
readOnlyHint?: boolean | undefined;
|
|
35
|
-
destructiveHint?: boolean | undefined;
|
|
36
|
-
idempotentHint?: boolean | undefined;
|
|
37
|
-
openWorldHint?: boolean | undefined;
|
|
38
|
-
} | undefined;
|
|
39
|
-
execution?: {
|
|
40
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
_meta?: {
|
|
43
|
-
[x: string]: unknown;
|
|
44
|
-
} | undefined;
|
|
45
|
-
icons?: {
|
|
46
|
-
src: string;
|
|
47
|
-
mimeType?: string | undefined;
|
|
48
|
-
sizes?: string[] | undefined;
|
|
49
|
-
}[] | undefined;
|
|
50
|
-
title?: string | undefined;
|
|
51
|
-
};
|
|
52
|
-
handler: (_: unknown, args: any) => Promise<ToolCallResult>;
|
|
53
|
-
}>;
|
|
11
|
+
export declare function codeTool(): McpTool;
|
|
54
12
|
//# sourceMappingURL=code-tool.d.mts.map
|
package/code-tool.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,
|
|
1
|
+
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AA0BhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
|
package/code-tool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpTool } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* A tool that runs code against a copy of the SDK.
|
|
4
4
|
*
|
|
@@ -8,47 +8,5 @@ import { Metadata, ToolCallResult } from "./tools/types.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param endpoints - The endpoints to include in the list.
|
|
10
10
|
*/
|
|
11
|
-
export declare function codeTool():
|
|
12
|
-
metadata: Metadata;
|
|
13
|
-
tool: {
|
|
14
|
-
inputSchema: {
|
|
15
|
-
[x: string]: unknown;
|
|
16
|
-
type: "object";
|
|
17
|
-
properties?: {
|
|
18
|
-
[x: string]: object;
|
|
19
|
-
} | undefined;
|
|
20
|
-
required?: string[] | undefined;
|
|
21
|
-
};
|
|
22
|
-
name: string;
|
|
23
|
-
description?: string | undefined;
|
|
24
|
-
outputSchema?: {
|
|
25
|
-
[x: string]: unknown;
|
|
26
|
-
type: "object";
|
|
27
|
-
properties?: {
|
|
28
|
-
[x: string]: object;
|
|
29
|
-
} | undefined;
|
|
30
|
-
required?: string[] | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
annotations?: {
|
|
33
|
-
title?: string | undefined;
|
|
34
|
-
readOnlyHint?: boolean | undefined;
|
|
35
|
-
destructiveHint?: boolean | undefined;
|
|
36
|
-
idempotentHint?: boolean | undefined;
|
|
37
|
-
openWorldHint?: boolean | undefined;
|
|
38
|
-
} | undefined;
|
|
39
|
-
execution?: {
|
|
40
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
_meta?: {
|
|
43
|
-
[x: string]: unknown;
|
|
44
|
-
} | undefined;
|
|
45
|
-
icons?: {
|
|
46
|
-
src: string;
|
|
47
|
-
mimeType?: string | undefined;
|
|
48
|
-
sizes?: string[] | undefined;
|
|
49
|
-
}[] | undefined;
|
|
50
|
-
title?: string | undefined;
|
|
51
|
-
};
|
|
52
|
-
handler: (_: unknown, args: any) => Promise<ToolCallResult>;
|
|
53
|
-
}>;
|
|
11
|
+
export declare function codeTool(): McpTool;
|
|
54
12
|
//# sourceMappingURL=code-tool.d.ts.map
|
package/code-tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,
|
|
1
|
+
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AA0BhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
|
package/code-tool.js
CHANGED
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.codeTool = codeTool;
|
|
5
|
-
const types_1 = require("./
|
|
5
|
+
const types_1 = require("./types.js");
|
|
6
6
|
const server_1 = require("./server.js");
|
|
7
|
+
const prompt = `Runs JavaScript code to interact with the Scorecard API.
|
|
8
|
+
|
|
9
|
+
You are a skilled programmer writing code to interface with the service.
|
|
10
|
+
Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
|
|
11
|
+
For example:
|
|
12
|
+
|
|
13
|
+
\`\`\`
|
|
14
|
+
async function run(client) {
|
|
15
|
+
const run = await client.runs.create('314', { metricIds: ['789', '101'], testsetId: '246' });
|
|
16
|
+
|
|
17
|
+
console.log(run.id);
|
|
18
|
+
}
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
You will be returned anything that your function returns, plus the results of any console.log statements.
|
|
22
|
+
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
|
|
23
|
+
Do not add comments unless necessary for generating better code.
|
|
24
|
+
Code will run in a container, and cannot interact with the network outside of the given SDK client.
|
|
25
|
+
Variables will not persist between calls, so make sure to return or log any data you might need later.`;
|
|
7
26
|
/**
|
|
8
27
|
* A tool that runs code against a copy of the SDK.
|
|
9
28
|
*
|
|
@@ -13,14 +32,14 @@ const server_1 = require("./server.js");
|
|
|
13
32
|
*
|
|
14
33
|
* @param endpoints - The endpoints to include in the list.
|
|
15
34
|
*/
|
|
16
|
-
|
|
35
|
+
function codeTool() {
|
|
17
36
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
18
37
|
const tool = {
|
|
19
38
|
name: 'execute',
|
|
20
|
-
description:
|
|
39
|
+
description: prompt,
|
|
21
40
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
22
41
|
};
|
|
23
|
-
const handler = async (
|
|
42
|
+
const handler = async (client, args) => {
|
|
24
43
|
const code = args.code;
|
|
25
44
|
// this is not required, but passing a Stainless API key for the matching project_name
|
|
26
45
|
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
@@ -31,18 +50,31 @@ async function codeTool() {
|
|
|
31
50
|
headers: {
|
|
32
51
|
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
33
52
|
'Content-Type': 'application/json',
|
|
34
|
-
client_envs: JSON.stringify({
|
|
53
|
+
client_envs: JSON.stringify({
|
|
54
|
+
SCORECARD_API_KEY: client.apiKey || (0, server_1.readEnvOrError)('SCORECARD_API_KEY'),
|
|
55
|
+
SCORECARD_BASE_URL: client.baseURL || (0, server_1.readEnv)('SCORECARD_BASE_URL'),
|
|
56
|
+
}),
|
|
35
57
|
},
|
|
36
58
|
body: JSON.stringify({
|
|
37
59
|
project_name: 'scorecard',
|
|
38
|
-
client_opts: { environment: ((0, server_1.readEnv)('SCORECARD_ENVIRONMENT') || undefined) },
|
|
39
60
|
code,
|
|
61
|
+
client_opts: { environment: ((0, server_1.readEnv)('SCORECARD_ENVIRONMENT') || undefined) },
|
|
40
62
|
}),
|
|
41
63
|
});
|
|
42
64
|
if (!res.ok) {
|
|
43
65
|
throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
|
|
44
66
|
}
|
|
45
|
-
|
|
67
|
+
const { is_error, result, log_lines, err_lines } = (await res.json());
|
|
68
|
+
const hasLogs = log_lines.length > 0 || err_lines.length > 0;
|
|
69
|
+
const output = {
|
|
70
|
+
result,
|
|
71
|
+
...(log_lines.length > 0 && { log_lines }),
|
|
72
|
+
...(err_lines.length > 0 && { err_lines }),
|
|
73
|
+
};
|
|
74
|
+
if (is_error) {
|
|
75
|
+
return (0, types_1.asErrorResult)(typeof result === 'string' && !hasLogs ? result : JSON.stringify(output, null, 2));
|
|
76
|
+
}
|
|
77
|
+
return (0, types_1.asTextContentResult)(output);
|
|
46
78
|
};
|
|
47
79
|
return { metadata, tool, handler };
|
|
48
80
|
}
|
package/code-tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;
|
|
1
|
+
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAqCtF,4BAuDC;AA1FD,sCAAgG;AAEhG,wCAAmD;AAInD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;uGAkBwF,CAAC;AAExG;;;;;;;;GAQG;AACH,SAAgB,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,MAAiB,EAAE,IAAS,EAA2B,EAAE;QAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QAEjC,sFAAsF;QACtF,sFAAsF;QACtF,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,mBAAmB,CAAC,CAAC;QACrD,MAAM,gBAAgB,GACpB,IAAA,gBAAO,EAAC,wBAAwB,CAAC,IAAI,4CAA4C,CAAC;QAEpF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,GAAG,CAAC,eAAe,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;gBAC1D,cAAc,EAAE,kBAAkB;gBAClC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;oBAC1B,iBAAiB,EAAE,MAAM,CAAC,MAAM,IAAI,IAAA,uBAAc,EAAC,mBAAmB,CAAC;oBACvE,kBAAkB,EAAE,MAAM,CAAC,OAAO,IAAI,IAAA,gBAAO,EAAC,oBAAoB,CAAC;iBACpE,CAAC;aACH;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,YAAY,EAAE,WAAW;gBACzB,IAAI;gBACJ,WAAW,EAAE,EAAE,WAAW,EAAE,CAAC,IAAA,gBAAO,EAAC,uBAAuB,CAAC,IAAI,SAAS,CAAQ,EAAE;aAC/D,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,MAAM,KACX,GAAG,CAAC,UACN,4DAA4D,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAC/E,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAiB,CAAC;QACtF,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG;YACb,MAAM;YACN,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YAC1C,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;SAC3C,CAAC;QACF,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAA,qBAAa,EAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,IAAA,2BAAmB,EAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/code-tool.mjs
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { asTextContentResult } from "./
|
|
3
|
-
import { readEnv } from "./server.mjs";
|
|
2
|
+
import { asErrorResult, asTextContentResult } from "./types.mjs";
|
|
3
|
+
import { readEnv, readEnvOrError } from "./server.mjs";
|
|
4
|
+
const prompt = `Runs JavaScript code to interact with the Scorecard API.
|
|
5
|
+
|
|
6
|
+
You are a skilled programmer writing code to interface with the service.
|
|
7
|
+
Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
|
|
8
|
+
For example:
|
|
9
|
+
|
|
10
|
+
\`\`\`
|
|
11
|
+
async function run(client) {
|
|
12
|
+
const run = await client.runs.create('314', { metricIds: ['789', '101'], testsetId: '246' });
|
|
13
|
+
|
|
14
|
+
console.log(run.id);
|
|
15
|
+
}
|
|
16
|
+
\`\`\`
|
|
17
|
+
|
|
18
|
+
You will be returned anything that your function returns, plus the results of any console.log statements.
|
|
19
|
+
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
|
|
20
|
+
Do not add comments unless necessary for generating better code.
|
|
21
|
+
Code will run in a container, and cannot interact with the network outside of the given SDK client.
|
|
22
|
+
Variables will not persist between calls, so make sure to return or log any data you might need later.`;
|
|
4
23
|
/**
|
|
5
24
|
* A tool that runs code against a copy of the SDK.
|
|
6
25
|
*
|
|
@@ -10,14 +29,14 @@ import { readEnv } from "./server.mjs";
|
|
|
10
29
|
*
|
|
11
30
|
* @param endpoints - The endpoints to include in the list.
|
|
12
31
|
*/
|
|
13
|
-
export
|
|
32
|
+
export function codeTool() {
|
|
14
33
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
15
34
|
const tool = {
|
|
16
35
|
name: 'execute',
|
|
17
|
-
description:
|
|
36
|
+
description: prompt,
|
|
18
37
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
19
38
|
};
|
|
20
|
-
const handler = async (
|
|
39
|
+
const handler = async (client, args) => {
|
|
21
40
|
const code = args.code;
|
|
22
41
|
// this is not required, but passing a Stainless API key for the matching project_name
|
|
23
42
|
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
@@ -28,18 +47,31 @@ export async function codeTool() {
|
|
|
28
47
|
headers: {
|
|
29
48
|
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
30
49
|
'Content-Type': 'application/json',
|
|
31
|
-
client_envs: JSON.stringify({
|
|
50
|
+
client_envs: JSON.stringify({
|
|
51
|
+
SCORECARD_API_KEY: client.apiKey || readEnvOrError('SCORECARD_API_KEY'),
|
|
52
|
+
SCORECARD_BASE_URL: client.baseURL || readEnv('SCORECARD_BASE_URL'),
|
|
53
|
+
}),
|
|
32
54
|
},
|
|
33
55
|
body: JSON.stringify({
|
|
34
56
|
project_name: 'scorecard',
|
|
35
|
-
client_opts: { environment: (readEnv('SCORECARD_ENVIRONMENT') || undefined) },
|
|
36
57
|
code,
|
|
58
|
+
client_opts: { environment: (readEnv('SCORECARD_ENVIRONMENT') || undefined) },
|
|
37
59
|
}),
|
|
38
60
|
});
|
|
39
61
|
if (!res.ok) {
|
|
40
62
|
throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
|
|
41
63
|
}
|
|
42
|
-
|
|
64
|
+
const { is_error, result, log_lines, err_lines } = (await res.json());
|
|
65
|
+
const hasLogs = log_lines.length > 0 || err_lines.length > 0;
|
|
66
|
+
const output = {
|
|
67
|
+
result,
|
|
68
|
+
...(log_lines.length > 0 && { log_lines }),
|
|
69
|
+
...(err_lines.length > 0 && { err_lines }),
|
|
70
|
+
};
|
|
71
|
+
if (is_error) {
|
|
72
|
+
return asErrorResult(typeof result === 'string' && !hasLogs ? result : JSON.stringify(output, null, 2));
|
|
73
|
+
}
|
|
74
|
+
return asTextContentResult(output);
|
|
43
75
|
};
|
|
44
76
|
return { metadata, tool, handler };
|
|
45
77
|
}
|
package/code-tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAqC,aAAa,EAAE,mBAAmB,EAAE;OAEzE,EAAE,OAAO,EAAE,cAAc,EAAE;AAIlC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;uGAkBwF,CAAC;AAExG;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,MAAiB,EAAE,IAAS,EAA2B,EAAE;QAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QAEjC,sFAAsF;QACtF,sFAAsF;QACtF,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACrD,MAAM,gBAAgB,GACpB,OAAO,CAAC,wBAAwB,CAAC,IAAI,4CAA4C,CAAC;QAEpF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,GAAG,CAAC,eAAe,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;gBAC1D,cAAc,EAAE,kBAAkB;gBAClC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;oBAC1B,iBAAiB,EAAE,MAAM,CAAC,MAAM,IAAI,cAAc,CAAC,mBAAmB,CAAC;oBACvE,kBAAkB,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;iBACpE,CAAC;aACH;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,YAAY,EAAE,WAAW;gBACzB,IAAI;gBACJ,WAAW,EAAE,EAAE,WAAW,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,SAAS,CAAQ,EAAE;aAC/D,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,MAAM,KACX,GAAG,CAAC,UACN,4DAA4D,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAC/E,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAiB,CAAC;QACtF,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG;YACb,MAAM;YACN,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YAC1C,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;SAC3C,CAAC;QACF,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,aAAa,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|