@@ -68,6 +68,50 @@ This resource provides a complete reference of the default tools exposed by the
6868| ` sarif_compare_alerts ` | Compare code locations of two SARIF alerts for overlap (sink, source, any-location, full-path modes) |
6969| ` sarif_diff_runs ` | Diff two SARIF files to find added, removed, and changed rules/results across analysis runs |
7070
71+ ### ` sarif_list_rules ` Response Format
72+
73+ Returns a JSON object with per-rule result counts and metadata:
74+
75+ ``` json
76+ {
77+ "totalRules" : 3 ,
78+ "totalResults" : 15 ,
79+ "rules" : [
80+ {
81+ "ruleId" : " js/sql-injection" ,
82+ "resultCount" : 8 ,
83+ "name" : " Database query built from user-controlled sources" ,
84+ "kind" : " path-problem" ,
85+ "precision" : " high" ,
86+ "severity" : " 8.8" ,
87+ "tags" : [" security" , " external/cwe/cwe-089" ],
88+ "tool" : " CodeQL" ,
89+ "toolVersion" : " 2.20.4"
90+ }
91+ ]
92+ }
93+ ```
94+
95+ | Field | Type | Description |
96+ | -------------- | ------ | ------------------------------------------------ |
97+ | ` totalRules ` | number | Total number of distinct rules in the SARIF file |
98+ | ` totalResults ` | number | Sum of ` resultCount ` across all rules |
99+ | ` rules[] ` | array | Per-rule summaries (see below) |
100+
101+ Each rule object:
102+
103+ | Field | Type | Required | Description |
104+ | ------------- | -------- | -------- | ---------------------------------------------------------------------------- |
105+ | ` ruleId ` | string | yes | Rule identifier (matches the CodeQL query ` @id ` ) |
106+ | ` resultCount ` | number | yes | Number of results (findings) for this rule. ` 0 ` if defined but not triggered |
107+ | ` name ` | string | no | Display name (from ` shortDescription.text ` , ` name ` , or ` id ` ) |
108+ | ` kind ` | string | no | Query kind (` path-problem ` , ` problem ` , etc.) |
109+ | ` precision ` | string | no | Precision level (` high ` , ` medium ` , ` low ` , ` very-high ` ) |
110+ | ` severity ` | string | no | Security severity score (from ` security-severity ` property) |
111+ | ` tags ` | string[ ] | no | Rule tags (e.g., ` security ` , ` external/cwe/cwe-089 ` ) |
112+ | ` tool ` | string | no | Tool driver name (e.g., ` CodeQL ` ) |
113+ | ` toolVersion ` | string | no | Tool driver version |
114+
71115## Common Tool Workflows
72116
73117### Create and Test a Query
0 commit comments