Search SEI CERT rules by keyword
search_rulesRank SEI CERT C/C++ rules by keyword relevance to a free-text query of API names, concepts, or rule IDs when you know what the code does but not which rule applies.
Instructions
Rank SEI CERT C/C++ rules by keyword relevance to a free-text query: API names (strcpy, malloc, pthread_mutex_lock), concepts (integer overflow) or a rule ID. Use when you know what the code does but not which rule applies. Do not use for structured filters (use list_rules) or to read a rule (use get_rule). Matching is case-insensitive term counting over titles, rule text and examples, not semantic search; 1-character tokens are ignored and a query with no usable token returns an empty list. Reads bundled data only; fast.
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": {
"query": "<query>"
},
"name": "search_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Restrict to SEI CERT C (c) or C++ (cpp). | any |
| limit | No | Maximum results. | |
| query | Yes | Keywords separated by spaces; title hits weigh 8x body hits. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query as received. | |
| results | Yes | Best match first. Same summary fields as list_rules (without coverage) plus `score`. |