Tool annotation default values are not applied
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
- Domain
- backend-api-design
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
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.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
bug needs response
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
difficulty/starter 🚀 good first issue kind/bug platform/ios 🍎 project/non-ui ⚙️ triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
unoplatform/uno#24650 ·
-
area-ai untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7783 ·
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13095 ·