Skip to main content
Glama

Build a SEI CERT review packet

build_review_packet
Read-onlyIdempotent

Builds code-hunk review packets with candidate SEI CERT rules for issues analyzers cannot decide, letting you judge each hunk and send findings to validate_findings.

Instructions

Build a packet for reviewing code against SEI CERT rules that analyzers cannot decide: code hunks, each with up to max_rules_per_hunk candidate rules (picked by token/API heuristics and profile idioms, rules fully covered by a specific checker left out) and their text excerpts. Diff mode (repo plus base or diff_text): changed lines with 3 lines of context. Path mode (path): whole files. Hunks are cut into 60-line windows. Use after check_diff or check_files; judge each hunk, then send your findings to validate_findings. Read-only; run_static=true also runs the analyzers (same cost as check_diff/check_files) to mark lines already reported. Output is large, roughly 5-25 KB per hunk.

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": "build_review_packet"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoDiff mode: base git ref; required with repo unless diff_text is given.
headNoDiff mode: head git ref; omit for the working tree.
pathNoPath mode: absolute path of a file or directory. Ignored when diff mode applies.
repoNoDiff mode: absolute path of the git checkout.
compdbNoAbsolute path of the directory that contains compile_commands.json. Strongly recommended: without it files are compiled with guessed flags and often fail to parse. Omitted: auto-detected in root, root/build or root/build-clang.
profileNoReview profile: 'default' (plain SEI CERT), 'ceph' (Ceph severities, suppressions and idioms) or an absolute path to a profile .yaml file.default
diff_textNoDiff mode: unified diff text, paths relative to repo.
run_staticNoAlso run the analyzers and list their findings per hunk so they are not repeated. Set false if you already ran check_diff/check_files.
max_rules_per_hunkNoCandidate rules per hunk. Omit to use the profile's value (6 in both bundled profiles).

Output Schema

NameRequiredDescriptionDefault
hunksYesfile (absolute), start_line, end_line, code (line-numbered), idioms[] {id, hint}, candidate_rules[] {rule_id, title, tier, matched, severity, priority, level, profile_note, text (<= 3500 chars), url}, existing_findings[] {rule_id, line, checker}.
profileYes
instructionsYesHow to review the hunks and what makes a finding acceptable.
rule_databaseYesCommit of the bundled rule database.
skipped_hunksYes[file, start_line, end_line] of hunks with no candidate rule.
finding_schemaYesFields each finding must have: rule_id, file, line, message, quote; optional severity, fix, confidence.
static_findingsYesAnalyzer findings for the same scope; [] when run_static=false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses key behavior: analyzer execution and cost when run_static=true, output size (~5-25 KB per hunk), 60-line hunk windows, 3 lines of diff context, and that candidate rules exclude those fully covered by specific checkers. No annotation contradiction is present.

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

Conciseness5/5

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

The description is dense but front-loaded: purpose first, then mode behavior, workflow placement, and operational caveats. Every sentence adds information needed to choose and invoke the tool, with no filler.

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 complex 9-parameter tool with annotations and an output schema, the description covers the critical context: workflow position, mode selection, analyzer cost, output size, and rule candidate generation. The remaining parameter details are fully covered in the schema, so nothing essential is missing for correct invocation.

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 the schema already carries most parameter detail. The description still adds cross-parameter meaning by grouping diff mode (`repo` plus `base` or `diff_text`) and path mode (`path`), and by explaining max_rules_per_hunk selection and run_static cost; compdb and head details remain in the schema.

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?

The description gives a specific verb and resource: 'Build a packet for reviewing code against SEI CERT rules that analyzers cannot decide,' then clarifies packet structure (code hunks with candidate rules and excerpts). It also explicitly distinguishes this tool from check_diff/check_files and validate_findings by placing it in the workflow.

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 explicitly says to use this after check_diff or check_files, judge each hunk, then send findings to validate_findings. It also explains when to set run_static=false if those checks were already run, and it distinguishes diff mode from path mode by parameter combinations.

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