Get one coding-standard rule
get_ruleRetrieve a rule's full CERT, MISRA, or AUTOSAR record—classification, examples, checkers, and cross-references—to explain or validate a finding before judgment.
Instructions
Return the full record of one rule. SEI CERT: text, noncompliant and compliant code examples, exceptions, risk assessment, CWE IDs, related MISRA/AUTOSAR guidelines (cross_references), the checkers that detect it, and how the profile adjusts or disables it. MISRA/AUTOSAR: classification, section, enforcement, related CERT rules, checkers and our one-line summary; the official text appears only when the user loaded a licensed rule-texts file (text_source, quote_required). Use before judging or explaining a finding, or to copy the verbatim quote validate_findings requires. Do not use to discover rules (use search_rules or list_rules). Reads bundled data only. CERT records are large (median ~10 KB, up to ~80 KB); set include_examples=false for text and risk only. An unknown ID returns an error listing close matches.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rule_id": "<rule_id>"
},
"name": "get_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Review profile: 'default' (plain SEI CERT), 'ceph' (Ceph severities, suppressions and idioms), 'misra' (MISRA C:2012 + MISRA C++:2023), 'autosar' (AUTOSAR C++14) or an absolute path to a profile .yaml file. | default |
| rule_id | Yes | Rule ID, case-insensitive. SEI CERT: category, two digits, -C or -CPP (EXP34-C). MISRA C:2012: MISRA-C-2012-<n.n> or MISRA-C-2012-DIR-<n.n>. MISRA C++:2023: MISRA-CPP-2023-<n.n.n> (DIR- for directives). AUTOSAR C++14: AUTOSAR-<A|M>n-n-n. | |
| include_examples | No | Include code examples in `text` and `examples`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Canonical rule ID, e.g. EXP34-C or MISRA-C-2012-10.4. | |
| cwe | Yes | Related CWE IDs. | |
| url | Yes | Rule page on the SEI CERT site, or the MISRA/AUTOSAR publication page. | |
| kind | Yes | rule, recommendation (CERT) or directive (MISRA). | |
| lang | Yes | c or cpp. | |
| risk | Yes | CERT risk assessment: severity, likelihood, remediation, priority, level, detectable, repairable. | |
| text | Yes | Rule text as markdown; examples included unless include_examples=false. Copy `quote` values for validate_findings from here. MISRA/AUTOSAR: facts and our summary only, plus your licensed text when loaded. | |
| title | Yes | ||
| profile | Yes | name, override (severity/priority/note), disabled reason or null, idioms[]. | |
| category | Yes | CERT three-letter category, or the MISRA/AUTOSAR section number. | |
| coverage | Yes | tier, tier_runnable, tier_extended and checkers[] {tool, checker, specific, available}. | |
| examples | Yes | Noncompliant/compliant example pairs; [] when include_examples=false. | |
| standard | Yes | cert-c, cert-cpp, misra-c-2012, misra-cpp-2023 or autosar-cpp14. |