Skip to content

Tool Reference

Sheriff exposes a single unified sheriff tool with multiple actions. This design minimizes tool discovery overhead while providing full functionality.

All Sheriff operations use this format:

{
"action": "<action_name>",
"target": "<optional_target>",
"scope": { /* optional filters */ },
"limit": 25 // optional, only for 'next'
}
ActionDescriptionWhen to Use
loadLoad a SARIF file and get overview statisticsStart of session, or after restart to restore progress
nextGet the next batch of issues (grouped by file)Ready to fix issues in the next file
doneMark issues as fixed or skippedAfter fixing all issues in a file
progressCheck current session progressTo report status or verify completion
summaryGet breakdown by rule, severity, and filePlanning which issues to tackle first
reopenUndo fixed/skipped marksMade a mistake or need to revisit an issue
exportExport remaining issues to a fileHandoff to another agent or create a report

The next, progress, and export actions support scope filtering to narrow down issues:

{
"rule": "ConstantValue", // Exact match or wildcard: "Constant*"
"severity": "High", // High, Moderate, or Low
"file": "src/**/*.java" // Glob pattern
}

Filter by rule:

{"action": "next", "scope": {"rule": "ConstantValue"}}

Filter by severity:

{"action": "next", "scope": {"severity": "High"}}

Filter by file pattern:

{"action": "next", "scope": {"file": "src/main/**/*.java"}}

Combine filters:

{"action": "next", "scope": {"rule": "unused*", "severity": "Moderate"}}

All responses use abbreviated field names to minimize token usage:

FieldMeaning
fpFingerprint (unique issue ID)
locLocation (line:column)
msgMessage
sevSeverity — H/M/L in issue objects, full names in summary breakdowns
snipCode snippet
remRemaining issues
remFRemaining files (in next response)
filesRemRemaining files (in progress response)
progProgress object
flowchart TD
    load([load])
    next([next])
    fix[Fix Code]
    done([done])
    check{More issues?}
    complete([Complete!])

    load --> next
    next --> fix
    fix --> done
    done --> check
    check -->|Yes| next
    check -->|No| complete

    %% Optional branches
    load -.->|plan first| summary([summary])
    summary -.-> next
    done -.->|check status| progress([progress])
    done -.->|undo| reopen([reopen])
    reopen -.-> next
    complete -.->|save report| export([export])

    %% Styling - semantic colors for different node types
    classDef core fill:#22c55e,stroke:#16a34a,color:#fff
    classDef helper fill:#3b82f6,stroke:#2563eb,color:#fff
    classDef decision fill:#f59e0b,stroke:#d97706,color:#fff
    classDef user fill:#a855f7,stroke:#9333ea,color:#fff
    classDef success fill:#10b981,stroke:#059669,color:#fff

    class load,next,done core
    class summary,progress,reopen,export helper
    class check decision
    class fix user
    class complete success

Core loop: loadnext → fix code → done → repeat until remaining = 0

Optional actions:

  • summary — Plan which issues to tackle first
  • progress — Check how many issues remain
  • reopen — Undo a fixed/skipped mark
  • export — Save remaining issues to file

These errors can occur for any action:

Error CodeCauseSolution
INVALID_ACTIONUnknown action nameUse one of: load, next, done, progress, reopen, summary, export
JSON_ERRORMalformed JSON argumentsCheck argument syntax