Skip to content

Dictionary<string, JsonElement> overload for CallToolAsync #640

@anuchandy

Description

@anuchandy

Currently, if a caller has a Dictionary<string, JsonElement>, they must convert each JsonElement to object to use the CallToolAsync API since it requires Dictionary<string, object?>. But given internally CallToolAsync already special handles JsonElement and underlying SendRequestAsync supports JsonElement, would it make sense to add an overload that accepts Dictionary<string, JsonElement>? This would avoid requiring callers to perform to-object conversion or rely on implementation details by casting.

We encountered this in Azure MCP Server, and due to the Dictionary<string, object?> constraint, it requires unnecessary conversions or serialization and deserialization operations within hot path

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions