Skip to content

[BUG] list_agents MCP tool violates OpenAI strict mode (object type without properties) #1889

@pboers1988

Description

@pboers1988

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Controller Service

🚦 Impact/Severity

Minor inconvenience

🐛 Bug Description

When attempting to call list_agents from an MCP client like librechat using OpenAI models (strict mode on) on Foundry we receive the following error:

400 Invalid schema for function 'list_agents_mcp_<server>':                                                                                                                                                    
In context=(), object schema missing properties.

It seems like the mcp response is not setting the properties key inside the inputSchema object. Below a comparison between the list_agents tool and the invoke_agent tool.

🔄 Steps To Reproduce

  1. Port-forward to the kagent-controller
  2. Establish an MCP session
  3. Observer the response of the MCP tools

List Agents

The output does not contain properties in inputSchema

  {                                                                                                                                                                                                                
    "name": "list_agents",                                                                                                                                                                                       
    "description": "List invokable kagent agents (accepted + deploymentReady)",
    "inputSchema": { "type": "object", "additionalProperties": false }
  }                                                                                                                                                                                                                

Compare to the well-formed invoke_agent entry on the same response, which has properties:

{                                                                                                                                                                                                              
  "name": "invoke_agent",
  "inputSchema": {
    "type": "object",
    "properties": { "agent": {...}, "task": {...}, "context_id": {...} },                                                                                                                                        
    "required": ["agent","task"],
    "additionalProperties": false                                                                                                                                                                                
  }                                                                                                                                                                                                            
}

🤔 Expected Behavior

a properties a object in the inputSchema, similar to the invoke_agent

📱 Actual Behavior

see reproduction

💻 Environment

Librechat: v8.6.0-rc0
Agentgateway: v1.2.1
Kagent: 0.9.4

❯ k version
Client Version: v1.36.1
Kustomize Version: v5.8.1
Server Version: v1.33.1

🔧 CLI Bug Report

No response

🔍 Additional Context

Architecture setup:

librechat -> agentgateway (auth handling) -> kagent-controller /mcp endpoint -> (6 agents)

📋 Logs

📷 Screenshots

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions