modelcontextprotocol / modelcontextprotocol/java-sdk

Expose Nullable / Nonnull on public properties / methods

オープン
#395 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement P3
主要言語
Java
スター
3.7k
フォーク
1.1k
平均マージ
1日 15時間
マージ済み PR(30日)
9

説明

Expected Behavior

Certain fields in MCP are mandatory, some are optional. I would expect to be able to know whether a certain property or function could be or return null from the Java SDK API.

Current Behavior

It is opaque to me what can be null or not.

Context

One example is CallToolResult, where isError() or Content.priority() are wrapped primitive types that can be null. However, since they don't have an @Nullable annotation, those facts are not obvious to the dev and can cause bugs (most notably null pointer exceptions).

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、ラップされたプリミティブ型を使用しているにもかかわらず nullable であると issue が示している、CallToolResult.isError() と Content.priority() 周辺の公開 Java SDK API を確認します。null を返す可能性のある公開プロパティとメソッドを特定し、その nullability がアノテーションによって明示的に公開されていることを検証して、呼び出し側が nullable な値を識別できるようにします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。