Skip to content

Inconsistent naming: Server uses InputSchema/OutputSchema, Client uses JsonSchema/JsonReturnSchema #767

@ChoonForge

Description

@ChoonForge

Update: there are two Tool classes (Protocol.Tool for server, Client.Tool for client). The naming is inconsistent between them, and across SDK versions. Server always uses InputSchema/OutputSchema, while client may expose either JsonSchema/ReturnJsonSchema or the spec-aligned names. This creates confusion for developers switching between server and client code.”

When working with the .NET MCP SDK, the server and client APIs expose schema properties with different names, even though the underlying MCP spec uses consistent terms (inputSchema / outputSchema)

MCP spec: inputSchema, outputSchema
Server API (Tool): InputSchema, OutputSchema
Client API (Tool): JsonSchema, JsonReturnSchema

This inconsistency makes it harder to move between server and client code, since the mental mapping isn’t 1-to-1. Developers have to remember two naming conventions for the same concept.

Proposal:
Standardize property names across server and client to align with the spec (InputSchema / OutputSchema).

Optionally keep the existing names (JsonSchema / JsonReturnSchema) as aliases (obsolete/deprecated) to avoid breaking changes.

Consider adding a SchemaFormat property (e.g., Json, Yaml, Protobuf) if format disambiguation is desired.

Benefit:
Developers don’t need to juggle naming differences across layers.
Easier for new contributors/users to understand the SDK.
Clearer alignment with the MCP spec.

Suggested code change
public class Tool
{
// New spec-aligned properties
[JsonIgnore]
public JsonElement InputSchema
{
get => JsonSchema;
set => JsonSchema = value;
}

[JsonIgnore]
public JsonElement? OutputSchema
{
    get => JsonReturnSchema;
    set => JsonReturnSchema = value;
}

// Old names kept for backward compatibility, but marked Obsolete
[Obsolete("Use InputSchema instead, aligns with MCP spec")]
public JsonElement JsonSchema { get; set; }

[Obsolete("Use OutputSchema instead, aligns with MCP spec")]
public JsonElement? JsonReturnSchema { get; set; }

}

Developer experience

Before:
// current client usage
var input = tool.JsonSchema;
var output = tool.JsonReturnSchema;

After (with warnings):
// compiles, but warns you to switch
var input = tool.JsonSchema; // ⚠️ Obsolete: Use InputSchema instead
var output = tool.JsonReturnSchema; // ⚠️ Obsolete: Use OutputSchema instead

Future-proof usage:
// spec-aligned names
var input = tool.InputSchema;
var output = tool.OutputSchema;

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