azurenoops / azurenoops/spin_agent

[BUG] [MCP/Chat] - SAP, remediation, and gap-analysis intents return 'No assessment data found' with zero tools executed

Open
#574 0 comments 0 reactions 1 assignee Claimed by @jrspinella View on GitHub
agent:oracle area:rmf bug priority:high
Dominant language
C#
Stars
3
Forks
1
Avg merge
18h 9m
Merged PRs (30d)
43

Description

## Bug Description

Multiple MCP chat intents related to assessments, remediation, and gap analysis return `"ℹ️ No assessment data found."` with **zero tools executed**. The agent is not dispatching to the appropriate tools (`compliance_list_saps`, `kanban_task_list`, `compliance_boundary_gap_analysis`) at all — it returns a canned response without calling any MCP tool.

## Affected Intents

| Message | Expected Tool | Actual Behavior |
|---------|--------------|-----------------|
| `"Generate a SAP for Coastal Watch"` | `compliance_list_saps` | "No assessment data found" (0 tools) |
| `"Show remediation tasks for Coastal Watch"` | `kanban_task_list` | "No assessment data found" (0 tools) |
| `"Run boundary gap analysis for Coastal Watch"` | `compliance_boundary_gap_analysis` | "No assessment data found" (0 tools) |
| `"List all SAPs for Coastal Watch"` | `compliance_list_saps` | "No assessment data found" (0 tools) |

## Steps to Reproduce

```bash
BASE="https://ca-ato-copilot-mcp-v2.blackwater-9393aa1a.centralus.azurecontainerapps.io"

curl -s -X POST -H 'Content-Type: application/json' \
-d '{"message":"Generate a SAP for Coastal Watch", "systemId":"92afdc15-bc6f-4648-8073-ad6af396cf97"}' \
"$BASE/mcp/chat"
```

## Expected Behavior

The agent dispatches to `compliance_list_saps` (or creates a new SAP if none exist), returning actual SAP data or a "no SAPs found, would you like to create one?" follow-up.

## Actual Behavior

```json
{
"success": true,
"response": "ℹ️ No assessment data found.",
"toolsExecuted": []
}
```

No tools are invoked. The agent pattern-matches the intent but returns a canned empty-state message instead of calling the tool.

## Note: Distinct from #551

Issue #551 is a UI-layer error ("No control baseline found" when generating SAP in the dashboard). This bug is at the **MCP API layer** — the `/mcp/chat` endpoint itself fails to dispatch to assessment/remediation tools.

## Browser/Environment

Azure Container Apps MCP API
Endpoint: POST /mcp/chat
Date: 2026-06-30T12:15:00Z
Sweep: Automated QA sweep

## Playwright Test Code

```typescript
test('[MCP] SAP generation intent dispatches to compliance_list_saps tool', async ({ request }) => {
const response = await request.post('/mcp/chat', {
data: {
message: 'Generate a SAP for Coastal Watch',
systemId: '92afdc15-bc6f-4648-8073-ad6af396cf97'
}
});
const body = await response.json();
expect(body.success).toBe(true);
expect(body.toolsExecuted.length).toBeGreaterThan(0);
expect(body.toolsExecuted.some(t => t.toolName === 'compliance_list_saps')).toBe(true);
expect(body.response).not.toContain('No assessment data found');
});
```

*Filed by Oracle — Automated 4-hour QA Sweep 2026-06-30T12:15:00Z*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.