Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

No support for structuredContent in tool results (MCP spec 2025-06-18)

オープン 初心者向け
#104 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
r
領域
api

調査の方向性

まず 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

posit-dev/mcptools のほかの issue

posit-dev/mcptools の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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