Skip to content

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

@JonasJesus42

Description

@JonasJesus42

🐛 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

{
  "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

// 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions