Skip to content

MCP Server nullable params error #333

@TkachenkoAV

Description

@TkachenkoAV

My MCP server has function with nullable parameter - "salary":{"description":"New salary (optional).","type":["number","null"]

When I try to run ChatMessage, i get an error:
System.Text.Json.JsonException: 'The JSON value could not be converted to System.String. Path: $.properties.salary.type | LineNumber: 0 | BytePositionInLine: 560.'

InvalidOperationException: Cannot get the value of a token type 'StartArray' as a string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions