azurenoops / azurenoops/spin_agent
[BUG] [Narratives/MCP] - compliance_batch_populate_narratives returns INVALID_INPUT for system_id even when systemId provided — parameter not passed to tool
- Dominant language
- C#
- Stars
- 3
- Forks
- 1
- Avg merge
- 18h 9m
- Merged PRs (30d)
- 43
Description
## Bug Description
`compliance_batch_populate_narratives` returns `INVALID_INPUT: The 'system_id' parameter is required` even when:
1. A valid `systemId` is provided in the `/mcp/chat` request body
2. The system name ("Coastal Watch") is included explicitly in the message
3. The system resolves correctly for single-system operations (e.g., `compliance_get_system` successfully returns Coastal Watch data)
This is a **different failure mode** from the previously tracked bug (#537), which returned "no SSP baseline found / document service lookup failure." The system_id is now not reaching the batch tool at all — it fails at the parameter validation layer before attempting any lookup.
## Steps to Reproduce
```bash
BASE="https://ca-ato-copilot-mcp-v2.blackwater-9393aa1a.centralus.azurecontainerapps.io"
# Test 1: With systemId in request body
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"message":"Auto-fill missing narratives for Coastal Watch","systemId":"92afdc15-bc6f-4648-8073-ad6af396cf97"}' \
"$BASE/mcp/chat"
# Test 2: System name in message only
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"message":"auto-populate implementation narratives for Coastal Watch system"}' \
"$BASE/mcp/chat"
```
Both return:
```json
{"status":"error","errorCode":"INVALID_INPUT","message":"The 'system_id' parameter is required."}
```
## Expected Behavior
When a valid `systemId` is provided in the request body, or when the system name resolves unambiguously, `compliance_batch_populate_narratives` should receive the resolved `system_id` and proceed to populate narratives (even if it subsequently fails on SSP lookup — that is a separate issue).
## Actual Behavior
The batch populate narratives tool fails with `INVALID_INPUT` before any system lookup occurs. The `systemId` field from the request body is not being passed as `system_id` to the `compliance_batch_populate_narratives` tool parameters.
## Relationship to Existing Issues
- **#537** — Previous failure was `"no SSP baseline found"` (tool received system_id but couldn't find the document). This sweep shows the failure now occurs earlier — at parameter injection layer. Either the fix for the disambiguation routing broke the parameter pass-through, or this is a separate regression.
## Browser/Environment
MCP API: `https://ca-ato-copilot-mcp-v2.blackwater-9393aa1a.centralus.azurecontainerapps.io`
Endpoint: `POST /mcp/chat`
System under test: Coastal Watch (ID: `92afdc15-bc6f-4648-8073-ad6af396cf97`)
Date: 2026-06-30T08:01:11Z
Sweep: Automated 4-hour QA Sweep
## Playwright Test Code
```typescript
test('[Narratives] batch_populate_narratives receives system_id from chat context', async ({ request }) => {
const res = await request.post(`${BASE}/mcp/chat`, {
data: {
message: 'auto-populate narratives for Coastal Watch',
systemId: '92afdc15-bc6f-4648-8073-ad6af396cf97'
}
});
const body = await res.json();
// Should not fail on parameter validation
expect(body.response).not.toContain('INVALID_INPUT');
expect(body.response).not.toContain("'system_id' parameter is required");
});
```
*Filed by Oracle — Automated 4-hour QA Sweep 2026-06-30T08:01:11Z*
Contributor guide
Assessment
This issue has not been assessed yet.