Draft spec: JSON examples with // comments are labelled json instead of jsonc

未關閉 適合新手
#3,622 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1-3 小時
新手友好度
90/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
json, markdown, typescript
領域
documentation

研究方向

閱讀 basic/patterns/mrtr.mdx、client/elicitation.mdx 和 client/sampling.mdx 中提到的四個範例,接著檢查附近含有註解的範例,確認規格中的 fence 標籤慣例。更新草稿中四個程式碼 fence 的標籤,並確認每個含有註解的區塊都標記為 jsonc,而有效的 JSON 區塊仍標記為 json。

由索引模型根據 Issue 內容生成。

描述

bug
What's broken?

An example in the spec is wrong or won't run

Where in the spec or docs?

https://github.com/modelcontextprotocol/modelcontextprotocol/blob/e1effa02221f6406a7ae04940df16801c9e16351/docs/specification/draft/client/elicitation.mdx#L144

What should happen?

Code blocks that contain // comments should be labelled jsonc, as other commented examples in the spec already are (e.g. the elicitation capabilities example in client/elicitation.mdx). Blocks labelled json should contain valid JSON that can be copied and parsed.

What actually happens?

Four blocks in the draft spec are labelled ```json but contain // comments, so they aren't valid JSON:

  • basic/patterns/mrtr.mdx L132 — InputRequiredResult example (// Elicitation request.)
  • client/elicitation.mdx L144 — number schema ("type": "number", // or "integer")
  • client/elicitation.mdx L440 — response actions ("action": "accept", // or "decline" or "cancel")
  • client/sampling.mdx L618 — model preferences ({ "name": "claude-3-sonnet" }, // Prefer Sonnet-class models)

Copying any of them into a JSON parser fails.

Anything else?

The same blocks are in the 2026-07-28 spec version. I'm only proposing to fix draft, since released versions are usually frozen — happy to include 2026-07-28 too if maintainers prefer.

I'll open a small PR changing the four fence labels to jsonc.

主要語言
TypeScript
星號
9.8k
分支
1.9k
平均合併
2 天 15 小時
30 天內合併 PR
72

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

modelcontextprotocol/modelcontextprotocol 的其他 Issue

查看 modelcontextprotocol/modelcontextprotocol 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。