Skip to main content
Glama

Get one coding-standard rule

get_rule
Read-onlyIdempotent

Retrieve 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

NameRequiredDescriptionDefault
profileNoReview 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_idYesRule 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_examplesNoInclude code examples in `text` and `examples`.

Output Schema

NameRequiredDescriptionDefault
idYesCanonical rule ID, e.g. EXP34-C or MISRA-C-2012-10.4.
cweYesRelated CWE IDs.
urlYesRule page on the SEI CERT site, or the MISRA/AUTOSAR publication page.
kindYesrule, recommendation (CERT) or directive (MISRA).
langYesc or cpp.
riskYesCERT risk assessment: severity, likelihood, remediation, priority, level, detectable, repairable.
textYesRule 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.
titleYes
profileYesname, override (severity/priority/note), disabled reason or null, idioms[].
categoryYesCERT three-letter category, or the MISRA/AUTOSAR section number.
coverageYestier, tier_runnable, tier_extended and checkers[] {tool, checker, specific, available}.
examplesYesNoncompliant/compliant example pairs; [] when include_examples=false.
standardYescert-c, cert-cpp, misra-c-2012, misra-cpp-2023 or autosar-cpp14.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.1

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world reads, yet the description still adds real context beyond them: that it reads bundled data only, that CERT records are large (median ~10 KB, up to ~80 KB) with an include_examples=false escape hatch, that profile can suppress/adjust a rule, and that an unknown ID errors with close matches. The licensed rule-texts caveat (text appears only if the user loaded a licensed file, with text_source/quote_required) is exactly the sort of non-obvious behavior an agent needs.

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?

It is front-loaded with the purpose, then guidance, then caveats and the error behavior — a sensible ordering. It is dense and slightly over-enumerated: field lists like CWE IDs and related MISRA/AUTOSAR guidelines duplicate what the existing output schema already returns, costing words without adding decision value.

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 read tool with three parameters, full schema coverage, an output schema and rich annotations, the description covers everything an agent needs: purpose, routing, size tradeoff, licensing caveat and failure mode. Nothing material is left ambiguous.

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

Parameters4/5

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

Schema coverage is 100%, so 3 is the baseline, but the description adds meaning the schema does not: profile changes whether and how a rule is presented (adjusted/disabled, official MISRA text conditionally available), and include_examples=false is framed as the way to shrink very large CERT records. The rule_id pattern nuances remain schema-side only, but the prose still earns above baseline.

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?

"Return the full record of one rule" is a specific verb plus resource, and the description goes on to delimit it against discovery tools ("Do not use to discover rules (use search_rules or list_rules)"). An agent can distinguish this from search_rules, list_rules and validate_findings without opening any schema.

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?

It states the positive trigger ("Use before judging or explaining a finding") and a concrete downstream dependency ("to copy the verbatim `quote` validate_findings requires"). It also names the exclusion and the alternatives to use instead, so both when-to-use and when-not-to-use are explicit.

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