Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Tool annotation default values are not applied

Open
#1,673 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp

Research direction

Start in src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs around lines 165-188, comparing the internal-field nullability checks with the public property getters described in the issue. Reproduce the generated tool annotations and determine whether null values or documented defaults are intended. Done means the chosen behavior is consistent and verified for the affected annotations.

Written by the indexing model from the issue text.

Description

bug needs confirmation P3

I was taking a try at the tool annotations. According to the code XML comments, there are default values for them. I was expecting that those default annotations are attached. But it's not, so I took some investigation on source.

The code checks nullability on internal fields instead of public properties. The public properties getter will use the default values while internal fields won't. So the default values are not applied.

Is this intended? Seems a choice between null annotation vs default values annotation.

https://github.com/modelcontextprotocol/csharp-sdk/blob/d6b1615988d3a73ffb653d08778b14fa695e1318/src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs#L165-L188

Dominant language
C#
Stars
4.5k
Forks
814
Avg merge
9d 19h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/csharp-sdk

All issues in modelcontextprotocol/csharp-sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.