Skip to main content
Glama

List coding-standard rules by filter

list_rules
Read-onlyIdempotent

List SEI CERT, MISRA, and AUTOSAR rules by standard, language, category, risk level, classification, or checker coverage to find matching C/C++ guidelines via structured criteria.

Instructions

List rules from the bundled databases, filtered by standard, language, category, kind, risk level, CERT detectability, MISRA/AUTOSAR classification or checker coverage. Default standard is SEI CERT C/C++ (388 rules and recommendations); standard='misra' or 'autosar' lists MISRA C:2012 (221), MISRA C++:2023 (178) or AUTOSAR C++14 (397) guidelines. Use to enumerate rules by structured criteria, e.g. all L1 C++ rules no checker detects or all mandatory MISRA C rules. Do not use for free-text lookup (use search_rules) or one rule's details (use get_rule). Reads bundled data only; fast. Returns summaries; count is the total before limit, so raise limit or narrow filters when truncated is true.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNorule = normative rule; recommendation = CERT advisory (C only); directive = MISRA directive.any
langNoc = C rules (SEI CERT C, MISRA C), cpp = C++ rules (SEI CERT C++, MISRA C++, AUTOSAR).any
levelNoCERT priority level; L1 is the most urgent.any
limitNoMaximum summaries returned (each ~400 bytes).
categoryNoSEI CERT three-letter category, e.g. EXP expressions, MEM memory, INT integers, STR strings, CON concurrency. Ignored for other standards' sections.any
coverageNoChecker coverage tier: deterministic = a rule-specific checker exists; partial = only general checkers; llm-only = no checker, manual review needed. Matches either the all-mappings or the pinned-toolchain tier.any
standardNoRule set: cert = SEI CERT C and C++ (default; the only standard with full rule text); misra = MISRA C:2012 (with Amendments 1-4, i.e. the MISRA C:2023 set) and MISRA C++:2023; autosar = AUTOSAR C++14; or one standard by name; all = every standard.cert
detectableNoCERT's own 'Detectable' flag (true = automatable in principle). Omit for both.
classificationNoMISRA/AUTOSAR classification; SEI CERT rules have none and are excluded when this is set.any

Output Schema

NameRequiredDescriptionDefault
countYesNumber of rules matching the filters, before `limit`.
rulesYesRule summaries: id, standard, title, lang (c|cpp), kind (rule|recommendation|directive), category, severity, likelihood, priority (P1-P27), level (L1-L3), detectable, url, coverage (tier over all mappings), coverage_runnable (tier with the pinned toolchain). MISRA/AUTOSAR entries add classification, category_name, decidability, enforcement and cert (related SEI CERT IDs); their title is our paraphrase, not the official headline.
truncatedYesTrue when count > limit and `rules` was cut.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.1

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavior: bundled data only, fast, returns summaries, and the crucial truncation contract ('`count` is the total before `limit`'). It stops short of describing ordering or how the two coverage tiers are merged, which keeps it at 4 rather than 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then defaults, then usage, then exclusions, then return behavior — a sensible ordering. It is dense but nearly every clause carries information; the per-standard rule counts are the only marginally expendable detail, though they do help agents set `limit`.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter, fully optional filtered-list tool with a 100%-covered schema and an output schema, this description covers what is missing from structured fields: defaults, data provenance, and the truncated/count/limit relationship. An agent has everything needed to call it correctly on the first attempt.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with enums on 7 of 9 parameters, so the schema already carries the semantics and 3 is the correct baseline. The description adds the default standard and rule counts per standard, which helps with filter selection, but does not explain interactions such as category being ignored outside CERT.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('List rules from the bundled databases') and immediately enumerates the filterable dimensions, so an agent knows exactly what the tool returns. It is clearly distinguished from siblings by the explicit routing sentences naming search_rules and get_rule.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the positive use case with a concrete example ('all L1 C++ rules no checker detects or all mandatory MISRA C rules') and gives explicit exclusions with the correct alternatives for free-text lookup and single-rule detail. Nothing about when to pick this tool is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.