No support for structuredContent in tool results (MCP spec 2025-06-18)
まだ誰も着手していません。
評価
調査の方向性
まず as_tool_call_result() を見つけて読み、リスト結果と ellmer Content オブジェクトが現在どのようにシリアライズされているかに注目します。リスト結果に structuredContent を追加し、content 内のシリアライズされたテキストを保持するとともに、Content オブジェクトについては既存の動作を維持します。ツール結果に両方の表現が含まれていることを確認し、issue #103 における outputSchema との関係を検討します。
索引モデルが issue の本文から書いたものです。
説明
Problem
The MCP spec (2025-06-18) defines a structuredContent field on tool results — a JSON object that provides machine-readable structured output alongside the human-readable content text.
Currently, as_tool_call_result() only produces content (text-only). There's no path for structuredContent.
Expected
When a tool returns a list/data structure, the result should include both:
{
"content": [
{"type": "text", "text": "{\"auc\": 0.92, \"tss\": 0.81}"}
],
"structuredContent": {
"auc": 0.92,
"tss": 0.81
}
}
content: Human-readable text (for backwards compatibility)structuredContent: Machine-readable JSON (for clients that support it)
Per spec: "For backwards compatibility, a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block."
Use Case
SDM MCP server with ~70 tools. Each tool produces structured results (model metrics, file paths, area statistics). Clients that understand structuredContent get validated, typed data. Others fall back to text. This is the biggest quality-of-life improvement for tool-heavy servers.
Fix
In as_tool_call_result(), if the tool result is a list (and not an ellmer Content object), include it as structuredContent alongside the text serialization.
Related to #103 (outputSchema) — if a tool declares an outputSchema, the structuredContent should be validated against it.
- 主要言語
- R
- スター
- 204
- フォーク
- 23
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
posit-dev/mcptools のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
posit-dev/mcptools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
OHDSI/PatientLevelPrediction#688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rfordatascience/tidytuesday#1098 ·