get_sarif
Run GauntletCI on a .NET repository to generate a SARIF 2.1.0 report for integration with GitHub Advanced Security or VS Code SARIF viewer.
Instructions
Run GauntletCI and return a SARIF 2.1.0 report. Useful for feeding into tools that consume SARIF (GitHub Advanced Security, VS Code SARIF viewer, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workingDirectory | Yes | Absolute path to the .NET repository root. |
Implementation Reference
- src/index.ts:188-197 (handler)Handler for the 'get_sarif' tool. Calls runGauntletCI with outputFormat='sarif' and returns the raw SARIF output.
if (name === "get_sarif") { const { output, exitCode } = runGauntletCI(workingDirectory, sensitivity, "sarif"); if (exitCode !== 0 && exitCode !== 1) { return { content: [{ type: "text", text: `GauntletCI error (exit ${exitCode}): ${output}` }], isError: true, }; } return { content: [{ type: "text", text: output }] }; } - src/index.ts:126-140 (schema)Tool registration with input schema for 'get_sarif'. Requires 'workingDirectory' (string). No 'sensitivity' param.
{ name: "get_sarif", description: "Run GauntletCI and return a SARIF 2.1.0 report. Useful for feeding into tools that consume SARIF (GitHub Advanced Security, VS Code SARIF viewer, etc.).", inputSchema: { type: "object", properties: { workingDirectory: { type: "string", description: "Absolute path to the .NET repository root.", }, }, required: ["workingDirectory"], }, }, - src/index.ts:83-142 (registration)The tool is registered via ListToolsRequestSchema handler in the tools array at index 2 (position 3).
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: "analyze_commit", description: "Run GauntletCI behavioral change risk analysis on the current HEAD commit in a .NET repository. Returns findings as structured text.", inputSchema: { type: "object", properties: { workingDirectory: { type: "string", description: "Absolute path to the .NET repository root.", }, sensitivity: { type: "string", enum: ["strict", "balanced", "permissive"], description: "Risk sensitivity filter. Default: balanced.", default: "balanced", }, }, required: ["workingDirectory"], }, }, { name: "get_findings_json", description: "Run GauntletCI and return the raw JSON result for programmatic processing.", inputSchema: { type: "object", properties: { workingDirectory: { type: "string", description: "Absolute path to the .NET repository root.", }, sensitivity: { type: "string", enum: ["strict", "balanced", "permissive"], default: "balanced", }, }, required: ["workingDirectory"], }, }, { name: "get_sarif", description: "Run GauntletCI and return a SARIF 2.1.0 report. Useful for feeding into tools that consume SARIF (GitHub Advanced Security, VS Code SARIF viewer, etc.).", inputSchema: { type: "object", properties: { workingDirectory: { type: "string", description: "Absolute path to the .NET repository root.", }, }, required: ["workingDirectory"], }, }, ], })); - src/index.ts:33-52 (helper)Helper function runGauntletCI that spawns the 'gauntletci analyze' CLI with the given output format (including 'sarif').
export function runGauntletCI( workingDir: string, sensitivity: string, outputFormat: "json" | "sarif" | "text" ): { output: string; exitCode: number } { const result = spawnSync( "gauntletci", ["analyze", "--output", outputFormat, "--no-banner", "--sensitivity", sensitivity, "--no-llm"], { cwd: workingDir, encoding: "utf8", shell: process.platform === "win32", } ); return { output: result.stdout ?? "", exitCode: result.status ?? -1, }; }