SDAC Tools
Overview
SDAC tools are organized by validation category and workflow stage. Each tool is focused and short-lived, which keeps individual docs manageable while still covering the full SDAC review process.
Most tools operate on a
report_idand read fromSDAC.data_*tables.
AI vs deterministic tools
Deterministic (rule-based) tools produce consistent results given the same inputs:
- sdac-upload-cost-report
- sdac-validate-file-metadata
- sdac-validate-source-codes
- sdac-validate-function-codes
- sdac-validate-cost-pools
- sdac-validate-salaries
- sdac-validate-fringe
- sdac-validate-replacements
- sdac-validate-full-report
- sdac-compare-quarters
- sdac-compare-multiple-quarters
- sdac-validate-justifications
- sdac-detect-vacant-positions
- sdac-validate-federal-funding-backout
- sdac-validate-indirect-cost-functions
- sdac-cross-reference-replacements
- sdac-link-replacement-comments (optional AI assist)
- sdac-detect-duplicates
- sdac-check-provider-eligibility
- sdac-track-provider-credentials
- sdac-verify-external-licensing
- sdac-generate-sendback-summary
- sdac-generate-district-contact
- sdac-manage-validation-queue
- sdac-log-validation-tracking
- sdac-orchestrate-full-review
AI-assisted tools use a language model and may vary slightly across runs:
- sdac-analyze-comment-quality
- sdac-classify-job-titles
- sdac-analyze-duplicates-context
- sdac-explain-validation-assistant
- sdac-fringe-analysis -- AI-powered fringe benefit rate analysis with contextual explanations
Upload & registration
Core validation
- sdac-validate-source-codes
- sdac-validate-function-codes
- sdac-validate-cost-pools
- sdac-validate-salaries
- sdac-validate-fringe
- sdac-validate-replacements
- sdac-validate-full-report
Review & compliance checks
- sdac-compare-quarters
- sdac-compare-multiple-quarters
- sdac-validate-justifications
- sdac-detect-vacant-positions
- sdac-validate-federal-funding-backout
- sdac-validate-indirect-cost-functions
- sdac-cross-reference-replacements
- sdac-link-replacement-comments
- sdac-generate-sendback-summary
Helper tools
- sdac-explain-validation-error
- sdac-detect-duplicates
- sdac-check-provider-eligibility
- sdac-track-provider-credentials
- sdac-verify-external-licensing
- sdac-manage-validation-queue
- sdac-log-validation-tracking
Analysis & orchestration
- sdac-orchestrate-full-review
- sdac-start-report-analysis -- Starts or reuses the post-ingestion report analysis workflow
- sdac-search-analysis-evidence -- Searches persisted report, finding, and comparison evidence across reports and periods
- sdac-get-analysis-packet -- Retrieves the persisted report analysis packet
- sdac-get-analysis-result -- Retrieves one persisted analysis result
- sdac-run-all-analyses -- Legacy static analysis runner for seven validation categories
- sdac-fringe-analysis -- AI-powered fringe benefit rate analysis with contextual explanations
Communication
Data ingestion
- sdac-fetch-costs -- Syncs SDAC cost data from TherapyLog via the Ingestion Server
Report context
- sdac-get-report-info -- Returns report metadata (district, year, quarter, totals)
Feedback
- sdac-store-feedback -- Store user feedback (rating, category, comment) on agent responses
- sdac-read-feedback -- Read aggregated feedback for prompt tuning analysis
Session management
These tools manage AI Widget conversation state (stored in SDAC.fact_ConversationHistory):
- sdac-start-conversation -- Initialize a new conversation session
- sdac-get-conversation-history -- Retrieve conversation turns for context
- sdac-log-conversation-turn -- Log a user or assistant message
Note: The direct runtime
POST /sdac/chatroute handles session management automatically. Widget browser code calls it through/api/ingestion/sdac/chat. These tools are available for custom integrations.
AI-assisted review tools
These tool IDs use the standard
sdac-prefix. Use the exact tool ID when invoking them.
- sdac-analyze-comment-quality
- sdac-classify-job-titles
- sdac-analyze-duplicates-context
- sdac-explain-validation-assistant
Where these tools live
- TypeScript tools:
packages/domain-sdac/src/tools/ - Tool registry:
sdacToolsinpackages/domain-sdac/src/tools/index.ts
Parallel Validation
Validate multiple categories simultaneously for speed:
const [sourceResult, functionResult, costPoolResult] = await Promise.all([
validateSourceCodesTool.execute({ report_id }),
validateFunctionCodesTool.execute({ report_id }),
validateCostPoolsTool.execute({ report_id })
]);
Comprehensive Validation
Single call for complete validation:
const fullResult = await validateFullReportTool.execute({
report_id: "Q1-2024-District123",
complexity: "VERY_COMPLEX",
include_statistical_analysis: true
});
// Returns comprehensive report with all categories
console.log(`Total errors: ${fullResult.total_errors}`);
console.log(`Errors by category:`, fullResult.errors_by_category);
Error Explanation Flow
Explain specific validation failures:
// 1. Run validation
const result = await validateSourceCodesTool.execute({ report_id });
// 2. If errors found, explain them
for (const error of result.errors) {
const explanation = await explainValidationErrorTool.execute({
rule_id: error.rule_id,
record_id: error.record_id,
report_id: report_id
});
console.log(`Error: ${error.message}`);
console.log(`Explanation: ${explanation.explanation}`);
console.log(`How to fix:`, explanation.correction_steps);
}
Common Validation Scenarios
New Report Upload and Validation
// 1. Upload new report
const uploadResult = await uploadCostReportTool.execute({
file_path: "C:\\Reports\\District123_Q1.xlsx",
district_id: "District123",
quarter: "Q1-2024"
});
const reportId = uploadResult.report_id; // "Q1-2024-District123"
// 2. Run comprehensive validation
const validationResult = await validateFullReportTool.execute({
report_id: reportId,
complexity: "VERY_COMPLEX"
});
// 3. Review results
if (!validationResult.passed) {
console.log(`Found ${validationResult.total_errors} errors`);
console.log('Errors by category:', validationResult.errors_by_category);
}
Focused Category Validation
// Validate only source codes for quick check
const sourceResult = await validateSourceCodesTool.execute({
report_id: "Q1-2024-District123"
});
if (sourceResult.error_count > 0) {
// Fix source code errors before continuing
console.log('Please fix source code errors first:');
sourceResult.errors.forEach(err => {
console.log(`- Row ${err.row_number}: ${err.message}`);
});
}
Duplicate Detection
// Check for suspicious duplicate values
const dupResult = await detectDuplicatesTool.execute({
report_id: "Q1-2024-District123",
field: "both", // Check salary AND fringe
consecutive_only: true,
min_occurrences: 3 // 3+ consecutive duplicates
});
if (dupResult.total_duplicate_groups > 0) {
console.log('Potential data entry errors detected:');
dupResult.duplicates_found.forEach(dup => {
console.log(`- Rows ${dup.row_numbers}: ${dup.value} appears ${dup.occurrences} times`);
});
}
Tool Reference Summary
| Category | Tools | Status |
|---|---|---|
| Deterministic validation | 26 | Implemented in TypeScript |
| AI-assisted analysis | 5 | LLM-backed analysis |
| Analysis & orchestration | 5 | Persisted report-analysis workflow tools plus legacy orchestration |
| Data ingestion | 1 | TherapyLog sync via Ingestion Server |
| Report context | 1 | Report metadata lookup |
| Feedback | 2 | User feedback capture and analysis |
| Session management | 3 | Conversation history |
Total: See packages/domain-sdac/src/tools.ts for the authoritative exported tool list.