deco-cx / deco-cx/apps

[BUG] PNCP MCP Integration - Invalid structuredContent in Multiple Tools

Open
#1,456 0 comments 0 reactions 1 assignee Claimed by @JonasJesus42 View on GitHub
bug mcp-integration pncp triage
Dominant language
TypeScript
Stars
28
Forks
30
Avg merge
1d 16h
Merged PRs (30d)
4

Description

## 🐛 Issue Description

During testing of the PNCP gov br MCP integration, several tools are returning an `invalid_type: structuredContent null` error. The integration works partially - some tools succeed while others fail with schema validation errors.

## 📊 Test Results Summary

- **Success Rate**: 2 out of 7 tools (28.5%)
- **Failure Rate**: 5 out of 7 tools (71.5%)

### ✅ Working Tools
- `PNCP-ListPriceRegistrationRecords` - Successfully returned 499,649 records
- `PNCP-GetProcurementDetails` - Successfully retrieved procurement details

### ❌ Failing Tools

- [ ] `PNCP-SearchPublicContracts` - Error: `invalid_type: structuredContent null`
- [ ] `PNCP-ListProcurementswithOpenProposals` - Error: `invalid_type: structuredContent null`
- [ ] `PNCP-ListContracts` - Error: `invalid_type: structuredContent null`
- [ ] `PNCP-ListProcurementsbyPublicationDate` - Error: `invalid_type: structuredContent null`
- [ ] `PNCP-ListPublicContracts` (if exists) - Error: `invalid_type: structuredContent null`

## 🔍 Error Details

```json
{
"error": "MCP error -32603: [
{
"code": "invalid_type",
"expected": "object",
"received": "null",
"path": ["structuredContent"],
"message": "Expected object, received null"
}
]"
}
```

## 🎯 Root Cause Analysis

The issue appears to be related to:
1. MCP schema validation for the `structuredContent` field
2. Possible inconsistency between input parameters and expected schema
3. Potential missing authentication or authorization requirements for some endpoints

## 📝 Steps to Reproduce

```typescript
// This fails
await CALL_TOOL("PNCP-SearchPublicContracts", {
status: "recebendo_proposta",
q: "tecnologia"
});

// This works
await CALL_TOOL("PNCP-ListPriceRegistrationRecords", {
dataInicial: "20251001",
dataFinal: "20251231"
});
```

## 🔧 Suggested Solution

1. Review the MCP schema definitions for failing tools
2. Verify the `structuredContent` field is properly initialized
3. Check if parameter validation is too strict
4. Test endpoint authentication/authorization requirements
5. Ensure response transformation is working correctly

## 📦 Environment

- Integration ID: `i:c95dc4ff-bc3c-48b8-8d2b-5cd43be07ba1`
- Integration Name: PNCP gov br
- Test Date: 2025-01-07

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.