Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#104 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
r
领域
api

调研方向

首先定位并阅读 as_tool_call_result(),重点关注列表结果和 ellmer Content 对象当前是如何序列化的。为列表结果添加 structuredContent,同时保留 content 中的序列化文本,并保持 Content 对象现有的行为。验证工具结果同时包含这两种表示形式,并考虑 outputSchema 与 issue #103 的关系。

由索引模型根据 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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

posit-dev/mcptools 的其他 Issue

查看 posit-dev/mcptools 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。