> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.developerdoc.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema 参考

<div id="schema-reference" />

## JSON-RPC

<div class="type">
  ### `JSONRPCErrorResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">JSONRPCErrorResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#jsonrpcerrorresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcerrorresponse-id">id</a><span class="tsd-signature-symbol">?:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcerrorresponse-error">error</a><span class="tsd-signature-symbol">:</span> <a href="#error" class="tsd-signature-type tsd-kind-interface">Error</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示请求发生错误的响应。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcerrorresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#jsonrpcerrorresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcerrorresponse-id" data-typedoc-h="3"><span>id?: RequestId</span><a href="#jsonrpcerrorresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcerrorresponse-error" data-typedoc-h="3"><span>error: Error</span><a href="#jsonrpcerrorresponse-error" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `JSONRPCMessage`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">JSONRPCMessage</span><span class="tsd-signature-symbol">:</span> <a href="#jsonrpcrequest" class="tsd-signature-type tsd-kind-interface">JSONRPCRequest</a> <span class="tsd-signature-symbol">|</span> <a href="#jsonrpcnotification" class="tsd-signature-type tsd-kind-interface">JSONRPCNotification</a> <span class="tsd-signature-symbol">|</span> <a href="#jsonrpcresponse" class="tsd-signature-type tsd-kind-type-alias">JSONRPCResponse</a></div><div class="tsd-comment tsd-typography"><p>指任何可从传输线上解码或编码后发送的有效 JSON-RPC 对象。</p> </div>
</div>

<div class="type">
  ### `JSONRPCNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">JSONRPCNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#jsonrpcnotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcnotification-params">params</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcnotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>不期望响应的通知。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="jsonrpcnotification-method" data-typedoc-h="3"><span>method: string</span><a href="#jsonrpcnotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 Notification.method</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="jsonrpcnotification-params" data-typedoc-h="3"><span>params?: \{ \[key: string]: any }</span><a href="#jsonrpcnotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 Notification.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcnotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#jsonrpcnotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `JSONRPCRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">JSONRPCRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#jsonrpcrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcrequest-params">params</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>期望响应的请求。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="jsonrpcrequest-method" data-typedoc-h="3"><span>method: string</span><a href="#jsonrpcrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 Request.method</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="jsonrpcrequest-params" data-typedoc-h="3"><span>params?: \{ \[key: string]: any }</span><a href="#jsonrpcrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 Request.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#jsonrpcrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#jsonrpcrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `JSONRPCResponse`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">JSONRPCResponse</span><span class="tsd-signature-symbol">:</span> <a href="#jsonrpcresultresponse" class="tsd-signature-type tsd-kind-interface">JSONRPCResultResponse</a> <span class="tsd-signature-symbol">|</span> <a href="#jsonrpcerrorresponse" class="tsd-signature-type tsd-kind-interface">JSONRPCErrorResponse</a></div><div class="tsd-comment tsd-typography"><p>对请求的响应，包含结果或错误。</p> </div>
</div>

<div class="type">
  ### `JSONRPCResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">JSONRPCResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#jsonrpcresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#result" class="tsd-signature-type tsd-kind-interface">Result</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>对请求的成功（非错误）响应。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#jsonrpcresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#jsonrpcresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="jsonrpcresultresponse-result" data-typedoc-h="3"><span>result: Result</span><a href="#jsonrpcresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## 通用类型

<div class="type">
  ### `Annotations`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Annotations</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#annotations-audience">audience</a><span class="tsd-signature-symbol">?:</span> <a href="#role" class="tsd-signature-type tsd-kind-type-alias">Role</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#annotations-priority">priority</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#annotations-lastmodified">lastModified</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。客户端可以使用注释来辅助决定对象如何被使用或显示。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="annotations-audience" data-typedoc-h="3"><span>audience?: Role\[]</span><a href="#annotations-audience" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>描述此对象或数据的预期受众。</p> <p>可包含多个条目，用于表示内容对多个受众有用（例如 <code>\["user", "assistant"]</code>）。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="annotations-priority" data-typedoc-h="3"><span>priority?: number</span><a href="#annotations-priority" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>描述此数据对服务器运行的重要程度。</p> <p>值为 1 表示“最重要”，并表示该数据实际上是必需的；值为 0 表示“最不重要”，并表示该数据完全可选。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="annotations-lastmodified" data-typedoc-h="3"><span>lastModified?: string</span><a href="#annotations-lastmodified" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>资源最后一次修改的时间，以 ISO 8601 格式字符串表示。</p> <p>应为 ISO 8601 格式字符串（例如 "2025-01-12T15:00:58Z"）。</p> <p>示例：打开文件中的最后活动时间戳、资源附加时的时间戳等。</p> </div></section>
</div>

<div class="type">
  ### `Cursor`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">Cursor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>用于表示分页游标的不透明令牌。</p> </div>
</div>

<div class="type">
  ### `EmptyResult`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">EmptyResult</span><span class="tsd-signature-symbol">:</span> <a href="#result" class="tsd-signature-type tsd-kind-interface">Result</a></div><div class="tsd-comment tsd-typography"><p>表示成功但不携带数据的结果。</p> </div>
</div>

<div class="type">
  ### `Icon`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Icon</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#icon-src">src</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#icon-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#icon-sizes">sizes</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#icon-theme">theme</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">"light"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"dark"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>可在用户界面中显示、可选指定尺寸的图标。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="icon-src" data-typedoc-h="3"><span>src: string</span><a href="#icon-src" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>指向图标资源的标准 URI。可以是 HTTP/HTTPS URL，也可以是带有 Base64 编码图像数据的 <code>data:</code> URI。</p> <p>使用方 SHOULD 采取措施，确保提供图标的 URL 来自与客户端/服务器相同的域或受信任域。</p> <p>使用方在使用 SVG 时 SHOULD 采取适当的预防措施，因为 SVG 可能包含可执行 JavaScript。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="icon-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#icon-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>当源 MIME 类型缺失或过于宽泛时，可选地覆盖 MIME 类型。例如：<code>"image/png"</code>、<code>"image/jpeg"</code> 或 <code>"image/svg+xml"</code>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="icon-sizes" data-typedoc-h="3"><span>sizes?: string\[]</span><a href="#icon-sizes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选的字符串数组，用于指定图标可使用的尺寸。每个字符串应采用 WxH 格式（例如 <code>"48x48"</code>、<code>"96x96"</code>），对于 SVG 等可缩放格式则使用 <code>"any"</code>。</p> <p>如果未提供，客户端应假定该图标可用于任意尺寸。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="icon-theme" data-typedoc-h="3"><span>theme?: "light" | "dark"</span><a href="#icon-theme" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选说明此图标设计面向的主题。<code>"light"</code> 表示该图标设计用于浅色背景，<code>"dark"</code> 表示该图标设计用于深色背景。</p> <p>如果未提供，客户端应假定该图标可用于任何主题。</p> </div></section>
</div>

<div class="type">
  ### `InputResponseRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">InputResponseRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#inputresponserequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#inputresponserequestparams-inputresponses">inputResponses</a><span class="tsd-signature-symbol">?:</span> <a href="#inputresponses" class="tsd-signature-type tsd-kind-interface">InputResponses</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#inputresponserequestparams-requeststate">requestState</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>任何请求的通用参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="inputresponserequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#inputresponserequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#requestparams">RequestParams</a>.<a href="#requestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="inputresponserequestparams-inputresponses" data-typedoc-h="3"><span>inputResponses?: InputResponses</span><a href="#inputresponserequestparams-inputresponses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="inputresponserequestparams-requeststate" data-typedoc-h="3"><span>requestState?: string</span><a href="#inputresponserequestparams-requeststate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `JSONArray`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">JSONArray</span><span class="tsd-signature-symbol">:</span> <a href="#jsonvalue" class="tsd-signature-type tsd-kind-type-alias">JSONValue</a><span class="tsd-signature-symbol">\[]</span></div>
</div>

<div class="type">
  ### `JSONObject`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">JSONObject</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonvalue" class="tsd-signature-type tsd-kind-type-alias">JSONValue</a> <span class="tsd-signature-symbol">}</span></div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><div data-typedoc-h="5"><span class="tsd-signature-symbol">\[</span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonvalue" class="tsd-signature-type tsd-kind-type-alias">JSONValue</a></div></li></ul></div>
</div>

<div class="type">
  ### `JSONValue`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">JSONValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">|</span> <a href="#jsonarray" class="tsd-signature-type tsd-kind-type-alias">JSONArray</a></div>
</div>

<div class="type">
  ### `LoggingLevel`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">LoggingLevel</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"debug"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"info"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"notice"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"warning"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"error"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"critical"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"alert"</span><br />  <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"emergency"</span></div><div class="tsd-comment tsd-typography"><p>日志消息的严重级别。</p> <p>这些级别映射到 RFC-5424 中规定的 syslog 消息严重级别：<a href="https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1">[https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1](https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1)</a></p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div>
</div>

<div class="type">
  ### `MetaObject`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">MetaObject</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">\<</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>表示 <code>\_meta</code> 字段的内容，客户端和服务器使用该字段为其交互附加额外元数据。</p> <p>某些键名由 MCP 保留用于协议级元数据；实现 MUST NOT 对这些键上的值作出假设。此外，特定 schema 定义可按其声明为特定用途的元数据保留特定名称。</p> <p>有效键包含两个部分：</p> <p><strong>前缀：</strong></p> <ul> <li>可选 — 如果指定，MUST 是一系列由点（<code>.</code>）分隔的<em>标签</em>，后跟斜杠（<code>/</code>）。</li> <li>标签 MUST 以字母开头，并以字母或数字结尾。内部字符可以是字母、数字或连字符（<code>-</code>）。</li> <li>实现 SHOULD 使用反向 DNS 表示法（例如 <code>com.example/</code>，而不是 <code>example.com/</code>）。</li> <li>第二个标签为 <code>modelcontextprotocol</code> 或 <code>mcp</code> 的任何前缀都为 MCP 使用而<strong>保留</strong>。例如：<code>io.modelcontextprotocol/</code>、<code>dev.mcp/</code>、<code>org.modelcontextprotocol.api/</code> 和 <code>com.mcp.tools/</code> 都是保留的。但是，<code>com.example.mcp/</code> 不是保留的，因为第二个标签是 <code>example</code>。</li> </ul> <p><strong>名称：</strong></p> <ul> <li>除非为空，否则 MUST 以字母数字字符（<code>\[a-z0-9A-Z]</code>）开头和结尾。</li> <li>内部字符可以是字母数字字符、连字符（<code>-</code>）、下划线（<code>\_</code>）或点（<code>.</code>）。</li> </ul> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p>更多详情请参见<a href="/specification/draft/basic/index#meta">通用字段：<code>\_meta</code></a>。</p> </div></div>
</div>

<div class="type">
  ### `NotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">NotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#notificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>任何通知的通用参数。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="notificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#notificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `PaginatedRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">PaginatedRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#paginatedrequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#paginatedrequestparams-cursor">cursor</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>分页请求的通用参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带游标的列表请求<a href="#paginatedrequestparams-example-list-request-with-cursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="paginatedrequestparams-example-list-request-with-cursor"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"cursor"</span><span class="hl-0">: </span><span class="hl-2">"eyJwYWdlIjogMn0="</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="paginatedrequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#paginatedrequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#requestparams">RequestParams</a>.<a href="#requestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="paginatedrequestparams-cursor" data-typedoc-h="3"><span>cursor?: string</span><a href="#paginatedrequestparams-cursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示当前分页位置的不透明令牌。如果提供，服务器应返回从该游标之后开始的结果。</p> </div></section>
</div>

<div class="type">
  ### `ProgressToken`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">ProgressToken</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>进度令牌，用于将进度通知与原始请求关联。</p> </div>
</div>

<div class="type">
  ### `RequestId`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">RequestId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>JSON-RPC 中用于唯一标识请求的 ID。</p> </div>
</div>

<div class="type">
  ### `RequestMetaObject`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">RequestMetaObject</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#requestmetaobject-progresstoken">progressToken</a><span class="tsd-signature-symbol">?:</span> <a href="#progresstoken" class="tsd-signature-type tsd-kind-type-alias">ProgressToken</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#requestmetaobject-iomodelcontextprotocolprotocolversion">"io.modelcontextprotocol/protocolVersion"</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#requestmetaobject-iomodelcontextprotocolclientinfo">"io.modelcontextprotocol/clientInfo"</a><span class="tsd-signature-symbol">:</span> <a href="#implementation" class="tsd-signature-type tsd-kind-interface">Implementation</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#requestmetaobject-iomodelcontextprotocolclientcapabilities">"io.modelcontextprotocol/clientCapabilities"</a><span class="tsd-signature-symbol">:</span> <a href="#clientcapabilities" class="tsd-signature-type tsd-kind-interface">ClientCapabilities</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#requestmetaobject-iomodelcontextprotocolloglevel">"io.modelcontextprotocol/logLevel"</a><span class="tsd-signature-symbol">?:</span> <a href="#logginglevel" class="tsd-signature-type tsd-kind-type-alias">LoggingLevel</a><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>使用额外的请求专用字段扩展 <a href="#metaobject" class="tsd-kind-type-alias">MetaObject</a>。<code>MetaObject</code> 的所有键命名规则均适用。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><ul> <li><a href="#metaobject" class="tsd-kind-type-alias">MetaObject</a>，用于了解键命名规则和保留前缀。</li> <li><a href="/specification/draft/basic/index#meta">通用字段：<code>\_meta</code></a>，用于了解更多详情。</li> </ul> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestmetaobject-progresstoken" data-typedoc-h="3"><span>progressToken?: ProgressToken</span><a href="#requestmetaobject-progresstoken" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果指定，调用方请求接收此请求的带外进度通知（由 <a href="#progressnotification" class="tsd-kind-interface">notifications/progress</a> 表示）。该参数的值是不透明令牌，将附加到任何后续通知中。接收方没有义务提供这些通知。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestmetaobject-iomodelcontextprotocolprotocolversion" data-typedoc-h="3"><span>"io.modelcontextprotocol/protocolVersion": string</span><a href="#requestmetaobject-iomodelcontextprotocolprotocolversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此请求使用的 MCP 协议版本。必需。</p> <p>对于 HTTP 传输，此值 MUST 与 <code>MCP-Protocol-Version</code> 标头匹配；否则服务器 MUST 返回 <code>400 Bad Request</code>。如果服务器不支持请求的版本，则 MUST 返回 <a href="#unsupportedprotocolversionerror" class="tsd-kind-interface">UnsupportedProtocolVersionError</a>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestmetaobject-iomodelcontextprotocolclientinfo" data-typedoc-h="3"><span>"io.modelcontextprotocol/clientInfo": Implementation</span><a href="#requestmetaobject-iomodelcontextprotocolclientinfo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>标识发出请求的客户端软件。必需。</p> <p><a href="#implementation" class="tsd-kind-interface">Implementation</a> schema 要求包含 <code>name</code> 和 <code>version</code>；其他字段可选。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestmetaobject-iomodelcontextprotocolclientcapabilities" data-typedoc-h="3"><span>"io.modelcontextprotocol/clientCapabilities": ClientCapabilities</span><a href="#requestmetaobject-iomodelcontextprotocolclientcapabilities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端针对此特定请求的能力。必需。</p> <p>能力按请求声明，而不是在初始化时只声明一次；空对象表示客户端不支持任何可选能力。服务器 MUST NOT 根据之前的请求推断能力。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestmetaobject-iomodelcontextprotocolloglevel" data-typedoc-h="3"><span class="deprecated">"io.modelcontextprotocol/logLevel"?: LoggingLevel</span><a href="#requestmetaobject-iomodelcontextprotocolloglevel" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此请求期望的日志级别。可选。</p> <p>如果不存在，服务器 MUST NOT 为此请求发送任何 <a href="#loggingmessagenotification" class="tsd-kind-interface">notifications/message</a> 通知。客户端通过显式设置级别来选择接收日志消息。取代以前的 <code>logging/setLevel</code> RPC。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div></section>
</div>

<div class="type">
  ### `RequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">RequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#requestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>任何请求的通用参数。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="requestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#requestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `Result`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Result</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#result-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#result-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>通用结果字段。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="result-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#result-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="result-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#result-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div></section>
</div>

<div class="type">
  ### `ResultType`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">ResultType</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"complete"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"input\_required"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>表示 <a href="#result" class="tsd-kind-interface">Result</a> 对象的类型，使客户端能够确定如何解析响应。</p> <p>complete - 请求已成功完成，结果包含最终内容。
  input\_required - 请求需要额外输入，结果包含一个 <a href="#inputrequiredresult" class="tsd-kind-interface">InputRequiredResult</a> 对象，其中包含让客户端在重试原始请求前提供额外输入的指令。</p> </div>
</div>

<div class="type">
  ### `Role`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">Role</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"user"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"assistant"</span></div><div class="tsd-comment tsd-typography"><p>对话中消息和数据的发送方或接收方。</p> </div>
</div>

## 错误

<div class="type">
  ### `Error`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Error</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#error-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#error-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#error-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="error-code" data-typedoc-h="3"><span>code: number</span><a href="#error-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="error-message" data-typedoc-h="3"><span>message: string</span><a href="#error-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="error-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#error-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div></section>
</div>

<div class="type">
  ### `InternalError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">InternalError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#internalerror-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#internalerror-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#internalerror-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32603</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示接收方发生内部错误的 JSON-RPC 错误。当接收方遇到阻止其完成请求的意外状况时返回此错误。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p><a href="https://www.jsonrpc.org/specification#error_object">JSON-RPC 2.0 错误对象</a></p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：意外错误<a href="#internalerror-example-unexpected-error" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="internalerror-example-unexpected-error"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32603</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Internal error"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="internalerror-message" data-typedoc-h="3"><span>message: string</span><a href="#internalerror-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-message">message</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="internalerror-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#internalerror-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-data">data</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="internalerror-code" data-typedoc-h="3"><span>code: -32603</span><a href="#internalerror-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div><aside class="tsd-sources"><p>重写 <a href="#error">Error</a>.<a href="#error-code">code</a></p></aside></section>
</div>

<div class="type">
  ### `InvalidParamsError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">InvalidParamsError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#invalidparamserror-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#invalidparamserror-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#invalidparamserror-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32602</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示方法参数无效或格式不正确的 JSON-RPC 错误。</p> <p>在 MCP 中，当请求参数验证失败时，会在多种上下文中返回此错误：</p> <ul> <li><strong>工具</strong>：未知工具名称或无效工具参数</li> <li><strong>提示</strong>：未知提示名称或缺少必需参数</li> <li><strong>分页</strong>：无效或过期的游标值</li> <li><strong>日志</strong>：无效日志级别</li> <li><strong>引出</strong>：服务器请求了客户端能力中未声明的引出模式</li> <li><strong>采样</strong>：缺少工具结果，或工具结果与其他内容混合</li> </ul> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p><a href="https://www.jsonrpc.org/specification#error_object">JSON-RPC 2.0 错误对象</a></p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：未知工具<a href="#invalidparamserror-example-unknown-tool" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="invalidparamserror-example-unknown-tool"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32602</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Unknown tool: invalid\_tool\_name"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：无效工具参数<a href="#invalidparamserror-example-invalid-tool-arguments" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="invalidparamserror-example-invalid-tool-arguments"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32602</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Invalid arguments for tool calculate: Missing required property 'expression'"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：未知提示<a href="#invalidparamserror-example-unknown-prompt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="invalidparamserror-example-unknown-prompt"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32602</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Unknown prompt: invalid\_prompt\_name"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：无效游标<a href="#invalidparamserror-example-invalid-cursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="invalidparamserror-example-invalid-cursor"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32602</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Invalid cursor"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="invalidparamserror-message" data-typedoc-h="3"><span>message: string</span><a href="#invalidparamserror-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-message">message</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="invalidparamserror-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#invalidparamserror-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-data">data</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="invalidparamserror-code" data-typedoc-h="3"><span>code: -32602</span><a href="#invalidparamserror-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div><aside class="tsd-sources"><p>重写 <a href="#error">Error</a>.<a href="#error-code">code</a></p></aside></section>
</div>

<div class="type">
  ### `InvalidRequestError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">InvalidRequestError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#invalidrequesterror-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#invalidrequesterror-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#invalidrequesterror-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32600</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示请求不是有效请求对象的 JSON-RPC 错误。当消息结构不符合 JSON-RPC 2.0 规范对请求的要求时返回此错误（例如缺少 <code>jsonrpc</code> 或 <code>method</code> 等必需字段，或这些字段使用了无效类型）。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p><a href="https://www.jsonrpc.org/specification#error_object">JSON-RPC 2.0 错误对象</a></p> </div></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="invalidrequesterror-message" data-typedoc-h="3"><span>message: string</span><a href="#invalidrequesterror-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-message">message</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="invalidrequesterror-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#invalidrequesterror-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-data">data</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="invalidrequesterror-code" data-typedoc-h="3"><span>code: -32600</span><a href="#invalidrequesterror-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div><aside class="tsd-sources"><p>重写 <a href="#error">Error</a>.<a href="#error-code">code</a></p></aside></section>
</div>

<div class="type">
  ### `MethodNotFoundError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">MethodNotFoundError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#methodnotfounderror-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#methodnotfounderror-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#methodnotfounderror-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32601</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示所请求方法不存在或不可用的 JSON-RPC 错误。</p> <p>在 MCP 中，当客户端调用服务器未实现的方法时，服务器会返回此错误——该方法可能是真正未知的方法，也可能受服务器未声明的能力限制（例如在未声明 <code>prompts</code> 能力时调用 <code>prompts/list</code>）。</p> <p>如果请求需要客户端未声明的客户端能力，则改用 <a href="#missingrequiredclientcapabilityerror" class="tsd-kind-interface">MissingRequiredClientCapabilityError</a>（<code>-32003</code>）表示。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p><a href="https://www.jsonrpc.org/specification#error_object">JSON-RPC 2.0 错误对象</a></p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：不支持提示<a href="#methodnotfounderror-example-prompts-not-supported" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="methodnotfounderror-example-prompts-not-supported"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32601</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Prompts not supported"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"data"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"reason"</span><span class="hl-0">: </span><span class="hl-2">"Server does not support the prompts capability"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="methodnotfounderror-message" data-typedoc-h="3"><span>message: string</span><a href="#methodnotfounderror-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-message">message</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="methodnotfounderror-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#methodnotfounderror-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-data">data</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="methodnotfounderror-code" data-typedoc-h="3"><span>code: -32601</span><a href="#methodnotfounderror-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div><aside class="tsd-sources"><p>重写 <a href="#error">Error</a>.<a href="#error-code">code</a></p></aside></section>
</div>

<div class="type">
  ### `MISSING_REQUIRED_CLIENT_CAPABILITY`

  <div class="tsd-signature"><span class="tsd-kind-variable">MISSING\_REQUIRED\_CLIENT\_CAPABILITY</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32003</span></div><div class="tsd-comment tsd-typography"><p>当服务器需要某项客户端能力，而该能力未在请求的 <code>clientCapabilities</code> 中声明时返回的错误代码。</p> </div>
</div>

<div class="type">
  ### `MissingRequiredClientCapabilityError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">MissingRequiredClientCapabilityError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#missingrequiredclientcapabilityerror-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#missingrequiredclientcapabilityerror-id">id</a><span class="tsd-signature-symbol">?:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#missingrequiredclientcapabilityerror-error">error</a><span class="tsd-signature-symbol">:</span> <a href="#error" class="tsd-signature-type tsd-kind-interface">Error</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-symbol">\{</span><br />    <span class="tsd-kind-property">code</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32003</span><span class="tsd-signature-symbol">;</span><br />    <span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">requiredCapabilities</span><span class="tsd-signature-symbol">:</span> <a href="#clientcapabilities" class="tsd-signature-type tsd-kind-interface">ClientCapabilities</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>当处理请求需要客户端未在 <code>clientCapabilities</code> 中声明的能力时返回。对于 HTTP，响应状态码 MUST 为 <code>400 Bad Request</code>。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：缺少引出能力<a href="#missingrequiredclientcapabilityerror-example-missing-elicitation-capability" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="missingrequiredclientcapabilityerror-example-missing-elicitation-capability"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"error"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32003</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Server requires the elicitation capability for this request"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"data"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"requiredCapabilities"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"elicitation"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="missingrequiredclientcapabilityerror-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#missingrequiredclientcapabilityerror-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcerrorresponse">JSONRPCErrorResponse</a>.<a href="#jsonrpcerrorresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="missingrequiredclientcapabilityerror-id" data-typedoc-h="3"><span>id?: RequestId</span><a href="#missingrequiredclientcapabilityerror-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcerrorresponse">JSONRPCErrorResponse</a>.<a href="#jsonrpcerrorresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="missingrequiredclientcapabilityerror-error" data-typedoc-h="3"><span>error: Error & \{    code: -32003;    data: \{ requiredCapabilities: ClientCapabilities }; }</span><a href="#missingrequiredclientcapabilityerror-error" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ParseError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ParseError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#parseerror-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#parseerror-data">data</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#parseerror-code">code</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32700</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示服务器收到了无效 JSON 的 JSON-RPC 错误。当服务器无法解析消息的 JSON 文本时返回此错误。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><div class="tsd-anchor-link" data-typedoc-h="4">参见</div><p><a href="https://www.jsonrpc.org/specification#error_object">JSON-RPC 2.0 错误对象</a></p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：无效 JSON<a href="#parseerror-example-invalid-json" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="parseerror-example-invalid-json"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32700</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Parse error: Invalid JSON"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="parseerror-message" data-typedoc-h="3"><span>message: string</span><a href="#parseerror-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>错误的简短描述。消息 SHOULD 限制为简洁的单句。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-message">message</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="parseerror-data" data-typedoc-h="3"><span>data?: unknown</span><a href="#parseerror-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于错误的附加信息。此成员的值由发送方定义（例如详细错误信息、嵌套错误等）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#error">Error</a>.<a href="#error-data">data</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="parseerror-code" data-typedoc-h="3"><span>code: -32700</span><a href="#parseerror-code" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发生的错误类型。</p> </div><aside class="tsd-sources"><p>重写 <a href="#error">Error</a>.<a href="#error-code">code</a></p></aside></section>
</div>

<div class="type">
  ### `UNSUPPORTED_PROTOCOL_VERSION`

  <div class="tsd-signature"><span class="tsd-kind-variable">UNSUPPORTED\_PROTOCOL\_VERSION</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32004</span></div><div class="tsd-comment tsd-typography"><p>当服务器不支持请求的协议版本时返回的错误代码。</p> </div>
</div>

<div class="type">
  ### `UnsupportedProtocolVersionError`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">UnsupportedProtocolVersionError</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#unsupportedprotocolversionerror-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#unsupportedprotocolversionerror-id">id</a><span class="tsd-signature-symbol">?:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#unsupportedprotocolversionerror-error">error</a><span class="tsd-signature-symbol">:</span> <a href="#error" class="tsd-signature-type tsd-kind-interface">Error</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-symbol">\{</span><br />    <span class="tsd-kind-property">code</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-32004</span><span class="tsd-signature-symbol">;</span><br />    <span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">supported</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">requested</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>当请求的协议版本对服务器未知或不受支持时返回（例如服务器选择不实现的已知实验版或草案版本）。对于 HTTP，响应状态码 MUST 为 <code>400 Bad Request</code>。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：不支持的协议版本<a href="#unsupportedprotocolversionerror-example-unsupported-protocol-version" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="unsupportedprotocolversionerror-example-unsupported-protocol-version"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"error"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-3">-32004</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Unsupported protocol version"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"data"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"supported"</span><span class="hl-0">: \[</span><span class="hl-2">"2026-07-28"</span><span class="hl-0">, </span><span class="hl-2">"2025-11-25"</span><span class="hl-0">],</span><br /><span class="hl-0">      </span><span class="hl-1">"requested"</span><span class="hl-0">: </span><span class="hl-2">"1900-01-01"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="unsupportedprotocolversionerror-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#unsupportedprotocolversionerror-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcerrorresponse">JSONRPCErrorResponse</a>.<a href="#jsonrpcerrorresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="unsupportedprotocolversionerror-id" data-typedoc-h="3"><span>id?: RequestId</span><a href="#unsupportedprotocolversionerror-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcerrorresponse">JSONRPCErrorResponse</a>.<a href="#jsonrpcerrorresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="unsupportedprotocolversionerror-error" data-typedoc-h="3"><span>error: Error & \{    code: -32004;    data: \{ supported: string\[]; requested: string }; }</span><a href="#unsupportedprotocolversionerror-error" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## 内容

<div class="type">
  ### `AudioContent`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">AudioContent</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#audiocontent-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"audio"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#audiocontent-data">data</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#audiocontent-mimetype">mimeType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#audiocontent-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#audiocontent-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>提供给 LLM 或由 LLM 提供的音频。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：\`audio/wav\` 内容<a href="#audiocontent-example-audiowav-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="audiocontent-example-audiowav-content"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"audio"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"data"</span><span class="hl-0">: </span><span class="hl-2">"UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA="</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"audio/wav"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="audiocontent-type" data-typedoc-h="3"><span>type: "audio"</span><a href="#audiocontent-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="audiocontent-data" data-typedoc-h="3"><span>data: string</span><a href="#audiocontent-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>Base64 编码的音频数据。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="audiocontent-mimetype" data-typedoc-h="3"><span>mimeType: string</span><a href="#audiocontent-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>音频的 MIME 类型。不同提供商可能支持不同的音频类型。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="audiocontent-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#audiocontent-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="audiocontent-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#audiocontent-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `BlobResourceContents`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">BlobResourceContents</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#blobresourcecontents-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#blobresourcecontents-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#blobresourcecontents-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#blobresourcecontents-blob">blob</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：图像文件内容<a href="#blobresourcecontents-example-image-file-contents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="blobresourcecontents-example-image-file-contents"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///example.png"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"blob"</span><span class="hl-0">: </span><span class="hl-2">"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="blobresourcecontents-uri" data-typedoc-h="3"><span>uri: string</span><a href="#blobresourcecontents-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 URI。</p> </div><aside class="tsd-sources"><p>继承自 ResourceContents.uri</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="blobresourcecontents-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#blobresourcecontents-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 MIME 类型（如果已知）。</p> </div><aside class="tsd-sources"><p>继承自 ResourceContents.mimeType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="blobresourcecontents-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#blobresourcecontents-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 ResourceContents.\_meta</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="blobresourcecontents-blob" data-typedoc-h="3"><span>blob: string</span><a href="#blobresourcecontents-blob" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示该项二进制数据的 Base64 编码字符串。</p> </div></section>
</div>

<div class="type">
  ### `ContentBlock`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">ContentBlock</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#textcontent" class="tsd-signature-type tsd-kind-interface">TextContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#imagecontent" class="tsd-signature-type tsd-kind-interface">ImageContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#audiocontent" class="tsd-signature-type tsd-kind-interface">AudioContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#resourcelink" class="tsd-signature-type tsd-kind-interface">ResourceLink</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#embeddedresource" class="tsd-signature-type tsd-kind-interface">EmbeddedResource</a></div>
</div>

<div class="type">
  ### `EmbeddedResource`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">EmbeddedResource</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#embeddedresource-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"resource"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#embeddedresource-resource">resource</a><span class="tsd-signature-symbol">:</span> <a href="#textresourcecontents" class="tsd-signature-type tsd-kind-interface">TextResourceContents</a> <span class="tsd-signature-symbol">|</span> <a href="#blobresourcecontents" class="tsd-signature-type tsd-kind-interface">BlobResourceContents</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#embeddedresource-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#embeddedresource-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>嵌入到提示或工具调用结果中的资源内容。</p> <p>客户端自行决定如何最佳地渲染嵌入资源，以便 LLM 和/或用户使用。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带注释的嵌入文件资源<a href="#embeddedresource-example-embedded-file-resource-with-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="embeddedresource-example-embedded-file-resource-with-annotations"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"resource"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"resource"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"fn main() \{</span><span class="hl-4">\n</span><span class="hl-2">    println!(</span><span class="hl-4">\\"</span><span class="hl-2">Hello world!</span><span class="hl-4">\\"</span><span class="hl-2">);</span><span class="hl-4">\n</span><span class="hl-2">}"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"annotations"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"audience"</span><span class="hl-0">: \[</span><span class="hl-2">"user"</span><span class="hl-0">, </span><span class="hl-2">"assistant"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"priority"</span><span class="hl-0">: </span><span class="hl-3">0.7</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"lastModified"</span><span class="hl-0">: </span><span class="hl-2">"2025-05-03T14:30:00Z"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="embeddedresource-type" data-typedoc-h="3"><span>type: "resource"</span><a href="#embeddedresource-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="embeddedresource-resource" data-typedoc-h="3"><span>resource: TextResourceContents | BlobResourceContents</span><a href="#embeddedresource-resource" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="embeddedresource-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#embeddedresource-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="embeddedresource-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#embeddedresource-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ImageContent`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ImageContent</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#imagecontent-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#imagecontent-data">data</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#imagecontent-mimetype">mimeType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#imagecontent-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#imagecontent-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>提供给 LLM 或由 LLM 提供的图像。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带注释的 \`image/png\` 内容<a href="#imagecontent-example-imagepng-content-with-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="imagecontent-example-imagepng-content-with-annotations"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"image"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"data"</span><span class="hl-0">: </span><span class="hl-2">"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"annotations"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"audience"</span><span class="hl-0">: \[</span><span class="hl-2">"user"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"priority"</span><span class="hl-0">: </span><span class="hl-3">0.9</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="imagecontent-type" data-typedoc-h="3"><span>type: "image"</span><a href="#imagecontent-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="imagecontent-data" data-typedoc-h="3"><span>data: string</span><a href="#imagecontent-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>Base64 编码的图像数据。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="imagecontent-mimetype" data-typedoc-h="3"><span>mimeType: string</span><a href="#imagecontent-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>图像的 MIME 类型。不同提供商可能支持不同的图像类型。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="imagecontent-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#imagecontent-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="imagecontent-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#imagecontent-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ResourceLink`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceLink</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourcelink-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-size">size</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelink-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"resource\_link"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器能够读取并包含在提示或工具调用结果中的资源。</p> <p>注意：工具返回的资源链接不保证会出现在 <a href="#listresourcesrequest" class="tsd-kind-interface">resources/list</a> 请求的结果中。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文件资源链接<a href="#resourcelink-example-file-resource-link" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="resourcelink-example-file-resource-link"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"resource\_link"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Primary application entry point"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#resourcelink-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-icons">icons</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-name" data-typedoc-h="3"><span>name: string</span><a href="#resourcelink-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-name">name</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-title" data-typedoc-h="3"><span>title?: string</span><a href="#resourcelink-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-title">title</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-uri" data-typedoc-h="3"><span>uri: string</span><a href="#resourcelink-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 URI。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-uri">uri</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-description" data-typedoc-h="3"><span>description?: string</span><a href="#resourcelink-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>对此资源所表示内容的描述。</p> <p>客户端可使用此信息改进 LLM 对可用资源的理解。可将其视为给模型的“提示”。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-description">description</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#resourcelink-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 MIME 类型（如果已知）。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-mimetype">mimeType</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#resourcelink-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-annotations">annotations</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-size" data-typedoc-h="3"><span>size?: number</span><a href="#resourcelink-size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>原始资源内容的大小（以字节为单位，即 Base64 编码或任何分词之前），如果已知。</p> <p>Host 可使用此信息显示文件大小并估算上下文窗口使用量。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-size">size</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelink-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#resourcelink-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#resource">Resource</a>.<a href="#resource-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcelink-type" data-typedoc-h="3"><span>type: "resource\_link"</span><a href="#resourcelink-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `TextContent`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">TextContent</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#textcontent-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"text"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textcontent-text">text</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textcontent-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textcontent-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>提供给 LLM 或由 LLM 提供的文本。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文本内容<a href="#textcontent-example-text-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="textcontent-example-text-content"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Tool result text"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="textcontent-type" data-typedoc-h="3"><span>type: "text"</span><a href="#textcontent-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="textcontent-text" data-typedoc-h="3"><span>text: string</span><a href="#textcontent-text" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>消息的文本内容。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="textcontent-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#textcontent-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="textcontent-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#textcontent-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `TextResourceContents`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">TextResourceContents</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#textresourcecontents-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textresourcecontents-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textresourcecontents-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#textresourcecontents-text">text</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文本文件内容<a href="#textresourcecontents-example-text-file-contents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="textresourcecontents-example-text-file-contents"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///example.txt"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/plain"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Resource content"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="textresourcecontents-uri" data-typedoc-h="3"><span>uri: string</span><a href="#textresourcecontents-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 URI。</p> </div><aside class="tsd-sources"><p>继承自 ResourceContents.uri</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="textresourcecontents-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#textresourcecontents-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 MIME 类型（如果已知）。</p> </div><aside class="tsd-sources"><p>继承自 ResourceContents.mimeType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="textresourcecontents-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#textresourcecontents-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 ResourceContents.\_meta</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="textresourcecontents-text" data-typedoc-h="3"><span>text: string</span><a href="#textresourcecontents-text" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>该项的文本。仅当该项确实可以表示为文本（而非二进制数据）时才必须设置。</p> </div></section>
</div>

## `completion/complete`

<div class="type">
  ### `CompleteRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CompleteRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#completerequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"completion/complete"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#completerequestparams" class="tsd-signature-type tsd-kind-interface">CompleteRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送给服务器、用于请求补全选项的请求。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：补全请求<a href="#completerequest-example-completion-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completerequest-example-completion-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"completion-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"completion/complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"ref"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"ref/prompt"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"argument"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"language"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"value"</span><span class="hl-0">: </span><span class="hl-2">"py"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completerequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#completerequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completerequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#completerequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completerequest-method" data-typedoc-h="3"><span>method: "completion/complete"</span><a href="#completerequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completerequest-params" data-typedoc-h="3"><span>params: CompleteRequestParams</span><a href="#completerequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `CompleteRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CompleteRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#completerequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequestparams-ref">ref</a><span class="tsd-signature-symbol">:</span> <a href="#promptreference" class="tsd-signature-type tsd-kind-interface">PromptReference</a> <span class="tsd-signature-symbol">|</span> <a href="#resourcetemplatereference" class="tsd-signature-type tsd-kind-interface">ResourceTemplateReference</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequestparams-argument">argument</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">value</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completerequestparams-context">context</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">arguments</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>completion/complete</code> 请求的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：提示参数补全<a href="#completerequestparams-example-prompt-argument-completion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completerequestparams-example-prompt-argument-completion"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"ref"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"ref/prompt"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"argument"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"language"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"value"</span><span class="hl-0">: </span><span class="hl-2">"py"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带上下文的提示参数补全<a href="#completerequestparams-example-prompt-argument-completion-with-context" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completerequestparams-example-prompt-argument-completion-with-context"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"ref"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"ref/prompt"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"argument"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"framework"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"value"</span><span class="hl-0">: </span><span class="hl-2">"fla"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"context"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"language"</span><span class="hl-0">: </span><span class="hl-2">"python"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completerequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#completerequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#requestparams">RequestParams</a>.<a href="#requestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completerequestparams-ref" data-typedoc-h="3"><span>ref: PromptReference | ResourceTemplateReference</span><a href="#completerequestparams-ref" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completerequestparams-argument" data-typedoc-h="3"><span>argument: \{ name: string; value: string }</span><a href="#completerequestparams-argument" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>参数的信息。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>参数的名称。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">value</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>用于补全匹配的参数值。</p> </div></li></ul></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completerequestparams-context" data-typedoc-h="3"><span>context?: \{ arguments?: \{ \[key: string]: string } }</span><a href="#completerequestparams-context" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于补全的额外可选上下文。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">arguments</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>URI 模板或提示中先前已解析的变量。</p> </div></li></ul></div></section>
</div>

<div class="type">
  ### `CompleteResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CompleteResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#completeresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completeresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completeresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#completeresult" class="tsd-signature-type tsd-kind-interface">CompleteResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#completerequest" class="tsd-kind-interface">completion/complete</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：补全结果响应<a href="#completeresultresponse-example-completion-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completeresultresponse-example-completion-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"completion-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"completion"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"values"</span><span class="hl-0">: \[</span><span class="hl-2">"flask"</span><span class="hl-0">],</span><br /><span class="hl-0">      </span><span class="hl-1">"total"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"hasMore"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completeresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#completeresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completeresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#completeresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completeresultresponse-result" data-typedoc-h="3"><span>result: CompleteResult</span><a href="#completeresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `CompleteResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CompleteResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#completeresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completeresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#completeresult-completion">completion</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">values</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">total</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">hasMore</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#completerequest" class="tsd-kind-interface">completion/complete</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：单个补全值<a href="#completeresult-example-single-completion-value" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completeresult-example-single-completion-value"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"completion"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"values"</span><span class="hl-0">: \[</span><span class="hl-2">"flask"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"total"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"hasMore"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：多个补全值且还有更多可用<a href="#completeresult-example-multiple-completion-values-with-more-available" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="completeresult-example-multiple-completion-values-with-more-available"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"completion"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"values"</span><span class="hl-0">: \[</span><span class="hl-2">"python"</span><span class="hl-0">, </span><span class="hl-2">"pytorch"</span><span class="hl-0">, </span><span class="hl-2">"pyside"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"total"</span><span class="hl-0">: </span><span class="hl-3">10</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"hasMore"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completeresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#completeresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="completeresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#completeresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-resulttype">resultType</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="completeresult-completion" data-typedoc-h="3"><span>completion: \{ values: string\[]; total?: number; hasMore?: boolean }</span><a href="#completeresult-completion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">values</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span></div><div class="tsd-comment tsd-typography"><p>补全值数组。不得超过 100 项。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">total</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>可用补全选项总数。该数量可能超过响应中实际发送的值数量。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">hasMore</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>表示除当前响应中提供的补全选项外是否还有更多选项，即使确切总数未知。</p> </div></li></ul></div></section>
</div>

<div class="type">
  ### `PromptReference`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">PromptReference</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#promptreference-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptreference-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptreference-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"ref/prompt"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>标识一个提示。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="promptreference-name" data-typedoc-h="3"><span>name: string</span><a href="#promptreference-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="promptreference-title" data-typedoc-h="3"><span>title?: string</span><a href="#promptreference-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptreference-type" data-typedoc-h="3"><span>type: "ref/prompt"</span><a href="#promptreference-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ResourceTemplateReference`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceTemplateReference</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourcetemplatereference-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"ref/resource"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplatereference-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>对资源或资源模板定义的引用。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplatereference-type" data-typedoc-h="3"><span>type: "ref/resource"</span><a href="#resourcetemplatereference-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplatereference-uri" data-typedoc-h="3"><span>uri: string</span><a href="#resourcetemplatereference-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>资源的 URI 或 URI 模板。</p> </div></section>
</div>

## `elicitation/create`

<div class="type">
  ### `ElicitRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"elicitation/create"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#elicitrequestparams" class="tsd-signature-type tsd-kind-type-alias">ElicitRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器通过客户端向用户引出额外信息的请求。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出请求<a href="#elicitrequest-example-elicitation-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitrequest-example-elicitation-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"elicitation/create"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"form"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your GitHub username"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"requestedSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"GitHub Username"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Your GitHub username"</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"name"</span><span class="hl-0">]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequest-method" data-typedoc-h="3"><span>method: "elicitation/create"</span><a href="#elicitrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequest-params" data-typedoc-h="3"><span>params: ElicitRequestParams</span><a href="#elicitrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ElicitRequestParams`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">ElicitRequestParams</span><span class="tsd-signature-symbol">:</span> <a href="#elicitrequestformparams" class="tsd-signature-type tsd-kind-interface">ElicitRequestFormParams</a> <span class="tsd-signature-symbol">|</span> <a href="#elicitrequesturlparams" class="tsd-signature-type tsd-kind-interface">ElicitRequestURLParams</a></div><div class="tsd-comment tsd-typography"><p>通过客户端向用户引出额外信息的请求参数。</p> </div>
</div>

<div class="type">
  ### `ElicitResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitresult-action">action</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"accept"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"decline"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"cancel"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitresult-content">content</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端针对 <a href="#elicitrequest" class="tsd-kind-interface">elicitation/create</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：输入单个字段<a href="#elicitresult-example-input-single-field" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitresult-example-input-single-field"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"action"</span><span class="hl-0">: </span><span class="hl-2">"accept"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"octocat"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：输入多个字段<a href="#elicitresult-example-input-multiple-fields" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitresult-example-input-multiple-fields"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"action"</span><span class="hl-0">: </span><span class="hl-2">"accept"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"Monalisa Octocat"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"email"</span><span class="hl-0">: </span><span class="hl-2">"[octocat@github.com](mailto:octocat@github.com)"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"age"</span><span class="hl-0">: </span><span class="hl-3">30</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：接受 URL 模式（无内容）<a href="#elicitresult-example-accept-url-mode-no-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitresult-example-accept-url-mode-no-content"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"action"</span><span class="hl-0">: </span><span class="hl-2">"accept"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitresult-action" data-typedoc-h="3"><span>action: "accept" | "decline" | "cancel"</span><a href="#elicitresult-action" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用户对引出的响应动作。</p> <ul> <li><code>"accept"</code>：用户提交了表单/确认了操作</li> <li><code>"decline"</code>：用户明确拒绝了操作</li> <li><code>"cancel"</code>：用户在未作出明确选择的情况下关闭</li> </ul> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitresult-content" data-typedoc-h="3"><span>content?: \{ \[key: string]: string | number | boolean | string\[] }</span><a href="#elicitresult-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>提交的表单数据，仅在 action 为 <code>"accept"</code> 且 mode 为 <code>"form"</code> 时存在。包含与请求 schema 匹配的值。对于带外模式响应则省略。</p> </div></section>
</div>

<div class="type">
  ### `BooleanSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">BooleanSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#booleanschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"boolean"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#booleanschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#booleanschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#booleanschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：布尔输入 schema<a href="#booleanschema-example-boolean-input-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="booleanschema-example-boolean-input-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"boolean"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Display Name"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Description text"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="booleanschema-type" data-typedoc-h="3"><span>type: "boolean"</span><a href="#booleanschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="booleanschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#booleanschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="booleanschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#booleanschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="booleanschema-default" data-typedoc-h="3"><span>default?: boolean</span><a href="#booleanschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ElicitRequestFormParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitRequestFormParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitrequestformparams-mode">mode</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">"form"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequestformparams-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequestformparams-requestedschema">requestedSchema</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span><br />    <span class="tsd-kind-property">\$schema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />    <span class="tsd-kind-property">type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"object"</span><span class="tsd-signature-symbol">;</span><br />    <span class="tsd-kind-property">properties</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#primitiveschemadefinition" class="tsd-signature-type tsd-kind-type-alias">PrimitiveSchemaDefinition</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />    <span class="tsd-kind-property">required</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>通过客户端中的表单向用户引出非敏感信息的请求参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出单个字段<a href="#elicitrequestformparams-example-elicit-single-field" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitrequestformparams-example-elicit-single-field"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"form"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your GitHub username"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"requestedSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"name"</span><span class="hl-0">]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出多个字段<a href="#elicitrequestformparams-example-elicit-multiple-fields" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitrequestformparams-example-elicit-multiple-fields"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"form"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your contact information"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"requestedSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Your full name"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"email"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"format"</span><span class="hl-0">: </span><span class="hl-2">"email"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Your email address"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"age"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"minimum"</span><span class="hl-0">: </span><span class="hl-3">18</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Your age"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"name"</span><span class="hl-0">, </span><span class="hl-2">"email"</span><span class="hl-0">]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequestformparams-mode" data-typedoc-h="3"><span>mode?: "form"</span><a href="#elicitrequestformparams-mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>引出模式。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequestformparams-message" data-typedoc-h="3"><span>message: string</span><a href="#elicitrequestformparams-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>向用户展示的消息，用于描述正在请求哪些信息。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequestformparams-requestedschema" data-typedoc-h="3"><span>requestedSchema: \{    \$schema?: string;    type: "object";    properties: \{ \[key: string]: PrimitiveSchemaDefinition };    required?: string\[]; }</span><a href="#elicitrequestformparams-requestedschema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>JSON Schema 的受限子集。仅允许顶层属性，不允许嵌套。</p> </div></section>
</div>

<div class="type">
  ### `ElicitRequestURLParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitRequestURLParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitrequesturlparams-mode">mode</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"url"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequesturlparams-message">message</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequesturlparams-elicitationid">elicitationId</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitrequesturlparams-url">url</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>通过客户端中的 URL 向用户引出信息的请求参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出敏感数据<a href="#elicitrequesturlparams-example-elicit-sensitive-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitrequesturlparams-example-elicit-sensitive-data"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"url"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"elicitationId"</span><span class="hl-0">: </span><span class="hl-2">"550e8400-e29b-41d4-a716-446655440000"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"url"</span><span class="hl-0">: </span><span class="hl-2">"[https://mcp.example.com/ui/set\&#x5F;api\&#x5F;key](https://mcp.example.com/ui/set\&#x5F;api\&#x5F;key)"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your API key to continue."</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequesturlparams-mode" data-typedoc-h="3"><span>mode: "url"</span><a href="#elicitrequesturlparams-mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>引出模式。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequesturlparams-message" data-typedoc-h="3"><span>message: string</span><a href="#elicitrequesturlparams-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>向用户展示的消息，用于解释为什么需要此次交互。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequesturlparams-elicitationid" data-typedoc-h="3"><span>elicitationId: string</span><a href="#elicitrequesturlparams-elicitationid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>引出的 ID，在服务器上下文中必须唯一。客户端 MUST 将此 ID 视为不透明值。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitrequesturlparams-url" data-typedoc-h="3"><span>url: string</span><a href="#elicitrequesturlparams-url" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用户应导航到的 URL。</p> </div></section>
</div>

<div class="type">
  ### `EnumSchema`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">EnumSchema</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#singleselectenumschema" class="tsd-signature-type tsd-kind-type-alias">SingleSelectEnumSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#multiselectenumschema" class="tsd-signature-type tsd-kind-type-alias">MultiSelectEnumSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#legacytitledenumschema" class="tsd-signature-type tsd-kind-interface">LegacyTitledEnumSchema</a></div>
</div>

<div class="type">
  ### `LegacyTitledEnumSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">LegacyTitledEnumSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"string"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-enum">enum</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-enumnames">enumNames</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#legacytitledenumschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>请改用 <a href="#titledsingleselectenumschema" class="tsd-kind-interface">TitledSingleSelectEnumSchema</a>。此接口将在未来版本中移除。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-type" data-typedoc-h="3"><span>type: "string"</span><a href="#legacytitledenumschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#legacytitledenumschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#legacytitledenumschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-enum" data-typedoc-h="3"><span>enum: string\[]</span><a href="#legacytitledenumschema-enum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-enumnames" data-typedoc-h="3"><span>enumNames?: string\[]</span><a href="#legacytitledenumschema-enumnames" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>（旧版）枚举值的显示名称。根据 JSON Schema 2020-12，这不是标准用法。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="legacytitledenumschema-default" data-typedoc-h="3"><span>default?: string</span><a href="#legacytitledenumschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `MultiSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">MultiSelectEnumSchema</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#untitledmultiselectenumschema" class="tsd-signature-type tsd-kind-interface">UntitledMultiSelectEnumSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#titledmultiselectenumschema" class="tsd-signature-type tsd-kind-interface">TitledMultiSelectEnumSchema</a></div>
</div>

<div class="type">
  ### `NumberSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">NumberSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#numberschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"number"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"integer"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#numberschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#numberschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#numberschema-minimum">minimum</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#numberschema-maximum">maximum</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#numberschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：数字输入 schema<a href="#numberschema-example-number-input-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="numberschema-example-number-input-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Display Name"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Description text"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"minimum"</span><span class="hl-0">: </span><span class="hl-3">0</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"maximum"</span><span class="hl-0">: </span><span class="hl-3">100</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: </span><span class="hl-3">50</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-type" data-typedoc-h="3"><span>type: "number" | "integer"</span><a href="#numberschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#numberschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#numberschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-minimum" data-typedoc-h="3"><span>minimum?: number</span><a href="#numberschema-minimum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-maximum" data-typedoc-h="3"><span>maximum?: number</span><a href="#numberschema-maximum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="numberschema-default" data-typedoc-h="3"><span>default?: number</span><a href="#numberschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `PrimitiveSchemaDefinition`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">PrimitiveSchemaDefinition</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#stringschema" class="tsd-signature-type tsd-kind-interface">StringSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#numberschema" class="tsd-signature-type tsd-kind-interface">NumberSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#booleanschema" class="tsd-signature-type tsd-kind-interface">BooleanSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#enumschema" class="tsd-signature-type tsd-kind-type-alias">EnumSchema</a></div><div class="tsd-comment tsd-typography"><p>受限的 schema 定义，仅允许原始类型，不包含嵌套对象或数组。</p> </div>
</div>

<div class="type">
  ### `SingleSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">SingleSelectEnumSchema</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#untitledsingleselectenumschema" class="tsd-signature-type tsd-kind-interface">UntitledSingleSelectEnumSchema</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#titledsingleselectenumschema" class="tsd-signature-type tsd-kind-interface">TitledSingleSelectEnumSchema</a></div>
</div>

<div class="type">
  ### `StringSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">StringSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#stringschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"string"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-minlength">minLength</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-maxlength">maxLength</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-format">format</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">"uri"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"email"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"date"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"date-time"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#stringschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：电子邮件输入 schema<a href="#stringschema-example-email-input-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="stringschema-example-email-input-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Display Name"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Description text"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"minLength"</span><span class="hl-0">: </span><span class="hl-3">3</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"maxLength"</span><span class="hl-0">: </span><span class="hl-3">50</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"format"</span><span class="hl-0">: </span><span class="hl-2">"email"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: </span><span class="hl-2">"[user@example.com](mailto:user@example.com)"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-type" data-typedoc-h="3"><span>type: "string"</span><a href="#stringschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#stringschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#stringschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-minlength" data-typedoc-h="3"><span>minLength?: number</span><a href="#stringschema-minlength" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-maxlength" data-typedoc-h="3"><span>maxLength?: number</span><a href="#stringschema-maxlength" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-format" data-typedoc-h="3"><span>format?: "uri" | "email" | "date" | "date-time"</span><a href="#stringschema-format" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="stringschema-default" data-typedoc-h="3"><span>default?: string</span><a href="#stringschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `TitledMultiSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">TitledMultiSelectEnumSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"array"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-minitems">minItems</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-maxitems">maxItems</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-items">items</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">anyOf</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">const</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">title</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">\[]</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledmultiselectenumschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>多选枚举的 schema，每个选项都有显示标题。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带标题的颜色多选 schema<a href="#titledmultiselectenumschema-example-titled-color-multi-select-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="titledmultiselectenumschema-example-titled-color-multi-select-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"array"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Color Selection"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Choose your favorite colors"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"minItems"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"maxItems"</span><span class="hl-0">: </span><span class="hl-3">2</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"items"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"anyOf"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#FF0000"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Red"</span><span class="hl-0"> },</span><br /><span class="hl-0">      \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#00FF00"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Green"</span><span class="hl-0"> },</span><br /><span class="hl-0">      \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#0000FF"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Blue"</span><span class="hl-0"> }</span><br /><span class="hl-0">    ]</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: \[</span><span class="hl-2">"#FF0000"</span><span class="hl-0">, </span><span class="hl-2">"#00FF00"</span><span class="hl-0">]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-type" data-typedoc-h="3"><span>type: "array"</span><a href="#titledmultiselectenumschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#titledmultiselectenumschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选标题。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#titledmultiselectenumschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-minitems" data-typedoc-h="3"><span>minItems?: number</span><a href="#titledmultiselectenumschema-minitems" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要选择的最少项数。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-maxitems" data-typedoc-h="3"><span>maxItems?: number</span><a href="#titledmultiselectenumschema-maxitems" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要选择的最多项数。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-items" data-typedoc-h="3"><span>items: \{ anyOf: \{ const: string; title: string }\[] }</span><a href="#titledmultiselectenumschema-items" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>数组项的 schema，包含枚举选项和显示标签。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">anyOf</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">const</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">title</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">\[]</span></div><div class="tsd-comment tsd-typography"><p>包含值和显示标签的枚举选项数组。</p> </div></li></ul></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledmultiselectenumschema-default" data-typedoc-h="3"><span>default?: string\[]</span><a href="#titledmultiselectenumschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选默认值。</p> </div></section>
</div>

<div class="type">
  ### `TitledSingleSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">TitledSingleSelectEnumSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#titledsingleselectenumschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"string"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledsingleselectenumschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledsingleselectenumschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledsingleselectenumschema-oneof">oneOf</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">const</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">title</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#titledsingleselectenumschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>单选枚举的 schema，每个选项都有显示标题。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带标题的颜色选择 schema<a href="#titledsingleselectenumschema-example-titled-color-select-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="titledsingleselectenumschema-example-titled-color-select-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Color Selection"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Choose your favorite color"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"oneOf"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#FF0000"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Red"</span><span class="hl-0"> },</span><br /><span class="hl-0">    \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#00FF00"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Green"</span><span class="hl-0"> },</span><br /><span class="hl-0">    \{ </span><span class="hl-1">"const"</span><span class="hl-0">: </span><span class="hl-2">"#0000FF"</span><span class="hl-0">, </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Blue"</span><span class="hl-0"> }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: </span><span class="hl-2">"#FF0000"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledsingleselectenumschema-type" data-typedoc-h="3"><span>type: "string"</span><a href="#titledsingleselectenumschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledsingleselectenumschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#titledsingleselectenumschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选标题。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledsingleselectenumschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#titledsingleselectenumschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledsingleselectenumschema-oneof" data-typedoc-h="3"><span>oneOf: \{ const: string; title: string }\[]</span><a href="#titledsingleselectenumschema-oneof" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>包含值和显示标签的枚举选项数组。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">const</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>枚举值。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">title</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>此选项的显示标签。</p> </div></li></ul></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="titledsingleselectenumschema-default" data-typedoc-h="3"><span>default?: string</span><a href="#titledsingleselectenumschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选默认值。</p> </div></section>
</div>

<div class="type">
  ### `UntitledMultiSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">UntitledMultiSelectEnumSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"array"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-minitems">minItems</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-maxitems">maxItems</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-items">items</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"string"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">enum</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledmultiselectenumschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>不带选项显示标题的多选枚举 schema。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：颜色多选 schema<a href="#untitledmultiselectenumschema-example-color-multi-select-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="untitledmultiselectenumschema-example-color-multi-select-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"array"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Color Selection"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Choose your favorite colors"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"minItems"</span><span class="hl-0">: </span><span class="hl-3">1</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"maxItems"</span><span class="hl-0">: </span><span class="hl-3">2</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"items"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"enum"</span><span class="hl-0">: \[</span><span class="hl-2">"Red"</span><span class="hl-0">, </span><span class="hl-2">"Green"</span><span class="hl-0">, </span><span class="hl-2">"Blue"</span><span class="hl-0">]</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: \[</span><span class="hl-2">"Red"</span><span class="hl-0">, </span><span class="hl-2">"Green"</span><span class="hl-0">]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-type" data-typedoc-h="3"><span>type: "array"</span><a href="#untitledmultiselectenumschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#untitledmultiselectenumschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选标题。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#untitledmultiselectenumschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-minitems" data-typedoc-h="3"><span>minItems?: number</span><a href="#untitledmultiselectenumschema-minitems" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要选择的最少项数。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-maxitems" data-typedoc-h="3"><span>maxItems?: number</span><a href="#untitledmultiselectenumschema-maxitems" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要选择的最多项数。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-items" data-typedoc-h="3"><span>items: \{ type: "string"; enum: string\[] }</span><a href="#untitledmultiselectenumschema-items" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>数组项的 schema。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">type</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"string"</span></div></li><li class="tsd-parameter"><div data-typedoc-h="5"><span class="tsd-kind-property">enum</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span></div><div class="tsd-comment tsd-typography"><p>可供选择的枚举值数组。</p> </div></li></ul></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledmultiselectenumschema-default" data-typedoc-h="3"><span>default?: string\[]</span><a href="#untitledmultiselectenumschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选默认值。</p> </div></section>
</div>

<div class="type">
  ### `UntitledSingleSelectEnumSchema`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">UntitledSingleSelectEnumSchema</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#untitledsingleselectenumschema-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"string"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledsingleselectenumschema-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledsingleselectenumschema-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledsingleselectenumschema-enum">enum</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#untitledsingleselectenumschema-default">default</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>不带选项显示标题的单选枚举 schema。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：颜色选择 schema<a href="#untitledsingleselectenumschema-example-color-select-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="untitledsingleselectenumschema-example-color-select-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Color Selection"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Choose your favorite color"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"enum"</span><span class="hl-0">: \[</span><span class="hl-2">"Red"</span><span class="hl-0">, </span><span class="hl-2">"Green"</span><span class="hl-0">, </span><span class="hl-2">"Blue"</span><span class="hl-0">],</span><br /><span class="hl-0">  </span><span class="hl-1">"default"</span><span class="hl-0">: </span><span class="hl-2">"Red"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledsingleselectenumschema-type" data-typedoc-h="3"><span>type: "string"</span><a href="#untitledsingleselectenumschema-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledsingleselectenumschema-title" data-typedoc-h="3"><span>title?: string</span><a href="#untitledsingleselectenumschema-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选标题。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledsingleselectenumschema-description" data-typedoc-h="3"><span>description?: string</span><a href="#untitledsingleselectenumschema-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>枚举字段的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledsingleselectenumschema-enum" data-typedoc-h="3"><span>enum: string\[]</span><a href="#untitledsingleselectenumschema-enum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可供选择的枚举值数组。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="untitledsingleselectenumschema-default" data-typedoc-h="3"><span>default?: string</span><a href="#untitledsingleselectenumschema-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选默认值。</p> </div></section>
</div>

## `notifications/cancelled`

<div class="type">
  ### `CancelledNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CancelledNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#cancellednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#cancellednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/cancelled"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#cancellednotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#cancellednotificationparams" class="tsd-signature-type tsd-kind-interface">CancelledNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>任一方都可以发送此通知，表示正在取消先前发出的请求。</p> <p>该请求 SHOULD 仍处于进行中，但由于通信延迟，此通知始终 MAY 在请求已经完成后到达。</p> <p>此通知表示结果将不会被使用，因此任何相关处理 SHOULD 停止。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：用户请求的取消<a href="#cancellednotification-example-user-requested-cancellation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="cancellednotification-example-user-requested-cancellation"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/cancelled"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"requestId"</span><span class="hl-0">: </span><span class="hl-2">"123"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"reason"</span><span class="hl-0">: </span><span class="hl-2">"User requested cancellation"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="cancellednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#cancellednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="cancellednotification-method" data-typedoc-h="3"><span>method: "notifications/cancelled"</span><a href="#cancellednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="cancellednotification-params" data-typedoc-h="3"><span>params: CancelledNotificationParams</span><a href="#cancellednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `CancelledNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CancelledNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#cancellednotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#cancellednotificationparams-requestid">requestId</a><span class="tsd-signature-symbol">?:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#cancellednotificationparams-reason">reason</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>notifications/cancelled</code> 通知的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：用户请求的取消<a href="#cancellednotificationparams-example-user-requested-cancellation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="cancellednotificationparams-example-user-requested-cancellation"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"requestId"</span><span class="hl-0">: </span><span class="hl-2">"123"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"reason"</span><span class="hl-0">: </span><span class="hl-2">"User requested cancellation"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="cancellednotificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#cancellednotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="cancellednotificationparams-requestid" data-typedoc-h="3"><span>requestId?: RequestId</span><a href="#cancellednotificationparams-requestid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要取消的请求 ID。</p> <p>这 MUST 对应同一方向上先前发出请求的 ID。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="cancellednotificationparams-reason" data-typedoc-h="3"><span>reason?: string</span><a href="#cancellednotificationparams-reason" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>描述取消原因的可选字符串。该字符串 MAY 被记录或展示给用户。</p> </div></section>
</div>

## `notifications/message`

<div class="type">
  ### `LoggingMessageNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">LoggingMessageNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/message"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#loggingmessagenotificationparams" class="tsd-signature-type tsd-kind-interface">LoggingMessageNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>从服务器传递给客户端的日志消息 JSONRPCNotification。客户端通过在请求的 <code>\_meta</code> 中设置 <code>"io.modelcontextprotocol/logLevel"</code> 来选择接收。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：记录数据库连接失败<a href="#loggingmessagenotification-example-log-database-connection-failed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="loggingmessagenotification-example-log-database-connection-failed"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/message"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"level"</span><span class="hl-0">: </span><span class="hl-2">"error"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"logger"</span><span class="hl-0">: </span><span class="hl-2">"database"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"data"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"error"</span><span class="hl-0">: </span><span class="hl-2">"Connection failed"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"details"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"host"</span><span class="hl-0">: </span><span class="hl-2">"localhost"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"port"</span><span class="hl-0">: </span><span class="hl-3">5432</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="loggingmessagenotification-jsonrpc" data-typedoc-h="3"><span class="deprecated">jsonrpc: "2.0"</span><a href="#loggingmessagenotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="loggingmessagenotification-method" data-typedoc-h="3"><span class="deprecated">method: "notifications/message"</span><a href="#loggingmessagenotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="loggingmessagenotification-params" data-typedoc-h="3"><span class="deprecated">params: LoggingMessageNotificationParams</span><a href="#loggingmessagenotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `LoggingMessageNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">LoggingMessageNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotificationparams-level">level</a><span class="tsd-signature-symbol">:</span> <a href="#logginglevel" class="tsd-signature-type tsd-kind-type-alias">LoggingLevel</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotificationparams-logger">logger</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#loggingmessagenotificationparams-data">data</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>notifications/message</code> 通知的参数。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：记录数据库连接失败<a href="#loggingmessagenotificationparams-example-log-database-connection-failed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="loggingmessagenotificationparams-example-log-database-connection-failed"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"level"</span><span class="hl-0">: </span><span class="hl-2">"error"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"logger"</span><span class="hl-0">: </span><span class="hl-2">"database"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"data"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"error"</span><span class="hl-0">: </span><span class="hl-2">"Connection failed"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"details"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"host"</span><span class="hl-0">: </span><span class="hl-2">"localhost"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"port"</span><span class="hl-0">: </span><span class="hl-3">5432</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="loggingmessagenotificationparams-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#loggingmessagenotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="loggingmessagenotificationparams-level" data-typedoc-h="3"><span class="deprecated">level: LoggingLevel</span><a href="#loggingmessagenotificationparams-level" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此日志消息的严重级别。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="loggingmessagenotificationparams-logger" data-typedoc-h="3"><span class="deprecated">logger?: string</span><a href="#loggingmessagenotificationparams-logger" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>发出此消息的日志记录器的可选名称。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="loggingmessagenotificationparams-data" data-typedoc-h="3"><span class="deprecated">data: unknown</span><a href="#loggingmessagenotificationparams-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要记录的数据，例如字符串消息或对象。这里允许任何可 JSON 序列化的类型。</p> </div></section>
</div>

## `notifications/progress`

<div class="type">
  ### `ProgressNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ProgressNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#progressnotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/progress"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#progressnotificationparams" class="tsd-signature-type tsd-kind-interface">ProgressNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>用于向接收方告知长时间运行请求进度更新的带外通知。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：进度消息<a href="#progressnotification-example-progress-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="progressnotification-example-progress-message"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/progress"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"progressToken"</span><span class="hl-0">: </span><span class="hl-2">"oivaizmir"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"progress"</span><span class="hl-0">: </span><span class="hl-3">50</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"total"</span><span class="hl-0">: </span><span class="hl-3">100</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Reticulating splines..."</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="progressnotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#progressnotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotification-method" data-typedoc-h="3"><span>method: "notifications/progress"</span><a href="#progressnotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotification-params" data-typedoc-h="3"><span>params: ProgressNotificationParams</span><a href="#progressnotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `ProgressNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ProgressNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#progressnotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotificationparams-progresstoken">progressToken</a><span class="tsd-signature-symbol">:</span> <a href="#progresstoken" class="tsd-signature-type tsd-kind-type-alias">ProgressToken</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotificationparams-progress">progress</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotificationparams-total">total</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#progressnotificationparams-message">message</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><a href="#progressnotification" class="tsd-kind-interface">notifications/progress</a> 通知的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：进度消息<a href="#progressnotificationparams-example-progress-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="progressnotificationparams-example-progress-message"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"progressToken"</span><span class="hl-0">: </span><span class="hl-2">"oivaizmir"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"progress"</span><span class="hl-0">: </span><span class="hl-3">50</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"total"</span><span class="hl-0">: </span><span class="hl-3">100</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Reticulating splines..."</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="progressnotificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#progressnotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotificationparams-progresstoken" data-typedoc-h="3"><span>progressToken: ProgressToken</span><a href="#progressnotificationparams-progresstoken" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>初始请求中给出的进度令牌，用于将此通知与正在进行的请求关联。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotificationparams-progress" data-typedoc-h="3"><span>progress: number</span><a href="#progressnotificationparams-progress" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>到目前为止的进度。即使总量未知，每次取得进展时该值也应增加。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotificationparams-total" data-typedoc-h="3"><span>total?: number</span><a href="#progressnotificationparams-total" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要处理的总项数（或所需总进度），如果已知。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="progressnotificationparams-message" data-typedoc-h="3"><span>message?: string</span><a href="#progressnotificationparams-message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>描述当前进度的可选消息。</p> </div></section>
</div>

## `notifications/prompts/list_changed`

<div class="type">
  ### `PromptListChangedNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">PromptListChangedNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#promptlistchangednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptlistchangednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/prompts/list\_changed"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptlistchangednotification-params">params</a><span class="tsd-signature-symbol">?:</span> <a href="#notificationparams" class="tsd-signature-type tsd-kind-interface">NotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送给客户端的可选通知，告知其提供的提示列表已更改。服务器可以在客户端没有任何先前订阅的情况下发出此通知。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：提示列表已更改<a href="#promptlistchangednotification-example-prompts-list-changed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="promptlistchangednotification-example-prompts-list-changed"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/prompts/list\_changed"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="promptlistchangednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#promptlistchangednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptlistchangednotification-method" data-typedoc-h="3"><span>method: "notifications/prompts/list\_changed"</span><a href="#promptlistchangednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptlistchangednotification-params" data-typedoc-h="3"><span>params?: NotificationParams</span><a href="#promptlistchangednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

## `notifications/resources/list_changed`

<div class="type">
  ### `ResourceListChangedNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceListChangedNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourcelistchangednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelistchangednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/resources/list\_changed"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcelistchangednotification-params">params</a><span class="tsd-signature-symbol">?:</span> <a href="#notificationparams" class="tsd-signature-type tsd-kind-interface">NotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送给客户端的可选通知，告知其可读取的资源列表已更改。服务器可以在客户端没有任何先前订阅的情况下发出此通知。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：资源列表已更改<a href="#resourcelistchangednotification-example-resources-list-changed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="resourcelistchangednotification-example-resources-list-changed"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/resources/list\_changed"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcelistchangednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#resourcelistchangednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcelistchangednotification-method" data-typedoc-h="3"><span>method: "notifications/resources/list\_changed"</span><a href="#resourcelistchangednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcelistchangednotification-params" data-typedoc-h="3"><span>params?: NotificationParams</span><a href="#resourcelistchangednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

## `notifications/resources/updated`

<div class="type">
  ### `ResourceUpdatedNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceUpdatedNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourceupdatednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourceupdatednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/resources/updated"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourceupdatednotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#resourceupdatednotificationparams" class="tsd-signature-type tsd-kind-interface">ResourceUpdatedNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送给客户端的通知，告知某个资源已更改并且可能需要重新读取。仅针对客户端通过 <a href="#subscriptionslistenrequest" class="tsd-kind-interface">subscriptions/listen</a> 请求中的 <code>resourceSubscriptions</code> 字段选择接收的资源发送。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文件资源更新通知<a href="#resourceupdatednotification-example-file-resource-updated-notification" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="resourceupdatednotification-example-file-resource-updated-notification"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/resources/updated"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourceupdatednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#resourceupdatednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourceupdatednotification-method" data-typedoc-h="3"><span>method: "notifications/resources/updated"</span><a href="#resourceupdatednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourceupdatednotification-params" data-typedoc-h="3"><span>params: ResourceUpdatedNotificationParams</span><a href="#resourceupdatednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `ResourceUpdatedNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceUpdatedNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourceupdatednotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourceupdatednotificationparams-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>notifications/resources/updated</code> 通知的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文件资源已更新<a href="#resourceupdatednotificationparams-example-file-resource-updated" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="resourceupdatednotificationparams-example-file-resource-updated"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourceupdatednotificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#resourceupdatednotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourceupdatednotificationparams-uri" data-typedoc-h="3"><span>uri: string</span><a href="#resourceupdatednotificationparams-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>已更新资源的 URI。这可能是客户端实际订阅资源的子资源。</p> </div></section>
</div>

## `notifications/subscriptions/acknowledged`

<div class="type">
  ### `SubscriptionsAcknowledgedNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SubscriptionsAcknowledgedNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#subscriptionsacknowledgednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionsacknowledgednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/subscriptions/acknowledged"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionsacknowledgednotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#subscriptionsacknowledgednotificationparams" class="tsd-signature-type tsd-kind-interface">SubscriptionsAcknowledgedNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>由服务器作为 <a href="#subscriptionslistenrequest" class="tsd-kind-interface">subscriptions/listen</a> 流上的第一条消息发送，用于确认订阅已建立，并报告其同意履行哪些通知类型。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：监听已确认<a href="#subscriptionsacknowledgednotification-example-listen-acknowledged" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="subscriptionsacknowledgednotification-example-listen-acknowledged"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/subscriptions/acknowledged"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/subscriptionId"</span><span class="hl-0">: </span><span class="hl-2">"listen-1"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"notifications"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"toolsListChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"resourceSubscriptions"</span><span class="hl-0">: \[</span><span class="hl-2">"file:///project/config.json"</span><span class="hl-0">]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="subscriptionsacknowledgednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#subscriptionsacknowledgednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionsacknowledgednotification-method" data-typedoc-h="3"><span>method: "notifications/subscriptions/acknowledged"</span><a href="#subscriptionsacknowledgednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionsacknowledgednotification-params" data-typedoc-h="3"><span>params: SubscriptionsAcknowledgedNotificationParams</span><a href="#subscriptionsacknowledgednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `SubscriptionsAcknowledgedNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SubscriptionsAcknowledgedNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#subscriptionsacknowledgednotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionsacknowledgednotificationparams-notifications">notifications</a><span class="tsd-signature-symbol">:</span> <a href="#subscriptionfilter" class="tsd-signature-type tsd-kind-interface">SubscriptionFilter</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><a href="#subscriptionsacknowledgednotification" class="tsd-kind-interface">notifications/subscriptions/acknowledged</a> 通知的参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="subscriptionsacknowledgednotificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#subscriptionsacknowledgednotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionsacknowledgednotificationparams-notifications" data-typedoc-h="3"><span>notifications: SubscriptionFilter</span><a href="#subscriptionsacknowledgednotificationparams-notifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器同意履行的请求通知类型子集。仅包含服务器实际支持的通知类型；如果客户端请求了不支持的类型（例如服务器没有提示时的 <code>promptsListChanged</code>），该类型会从此集合中省略。</p> </div></section>
</div>

## `notifications/tools/list_changed`

<div class="type">
  ### `ToolListChangedNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ToolListChangedNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#toollistchangednotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toollistchangednotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/tools/list\_changed"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toollistchangednotification-params">params</a><span class="tsd-signature-symbol">?:</span> <a href="#notificationparams" class="tsd-signature-type tsd-kind-interface">NotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送给客户端的可选通知，告知其提供的工具列表已更改。服务器可以在客户端没有任何先前订阅的情况下发出此通知。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：工具列表已更改<a href="#toollistchangednotification-example-tools-list-changed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="toollistchangednotification-example-tools-list-changed"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/tools/list\_changed"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="toollistchangednotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#toollistchangednotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toollistchangednotification-method" data-typedoc-h="3"><span>method: "notifications/tools/list\_changed"</span><a href="#toollistchangednotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toollistchangednotification-params" data-typedoc-h="3"><span>params?: NotificationParams</span><a href="#toollistchangednotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

## `notifications/elicitation/complete`

<div class="type">
  ### `ElicitationCompleteNotification`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitationCompleteNotification</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitationcompletenotification-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitationcompletenotification-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"notifications/elicitation/complete"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitationcompletenotification-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#elicitationcompletenotificationparams" class="tsd-signature-type tsd-kind-interface">ElicitationCompleteNotificationParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送给客户端的可选通知，告知带外引出请求已完成。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出完成<a href="#elicitationcompletenotification-example-elicitation-complete" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="elicitationcompletenotification-example-elicitation-complete"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"notifications/elicitation/complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"elicitationId"</span><span class="hl-0">: </span><span class="hl-2">"550e8400-e29b-41d4-a716-446655440000"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="elicitationcompletenotification-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#elicitationcompletenotification-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitationcompletenotification-method" data-typedoc-h="3"><span>method: "notifications/elicitation/complete"</span><a href="#elicitationcompletenotification-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitationcompletenotification-params" data-typedoc-h="3"><span>params: ElicitationCompleteNotificationParams</span><a href="#elicitationcompletenotification-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcnotification">JSONRPCNotification</a>.<a href="#jsonrpcnotification-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `ElicitationCompleteNotificationParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ElicitationCompleteNotificationParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#elicitationcompletenotificationparams-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#elicitationcompletenotificationparams-elicitationid">elicitationId</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><a href="#elicitationcompletenotification" class="tsd-kind-interface">notifications/elicitation/complete</a> 通知的参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="elicitationcompletenotificationparams-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#elicitationcompletenotificationparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#notificationparams">NotificationParams</a>.<a href="#notificationparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="elicitationcompletenotificationparams-elicitationid" data-typedoc-h="3"><span>elicitationId: string</span><a href="#elicitationcompletenotificationparams-elicitationid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>已完成引出的 ID。</p> </div></section>
</div>

## 多轮往返

<div class="type">
  ### `InputRequests`

  <div class="tsd-signature"><span class="tsd-kind-interface">InputRequests</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><div class="tsd-comment tsd-typography"><p>客户端必须满足的服务器发起请求映射。键是服务器分配的标识符；值是请求对象。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出和采样输入请求<a href="#inputrequests-example-elicitation-and-sampling-input-requests" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="inputrequests-example-elicitation-and-sampling-input-requests"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"github\_login"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"elicitation/create"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"form"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your GitHub username"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"requestedSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"name"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"name"</span><span class="hl-0">]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"capital\_of\_france"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"sampling/createMessage"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What is the capital of France?"</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ],</span><br /><span class="hl-0">      </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">100</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div>
</div>

<div class="type">
  ### `InputRequiredResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">InputRequiredResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#inputrequiredresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#inputrequiredresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#inputrequiredresult-inputrequests">inputRequests</a><span class="tsd-signature-symbol">?:</span> <a href="#inputrequests" class="tsd-signature-type tsd-kind-interface">InputRequests</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#inputrequiredresult-requeststate">requestState</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送的 InputRequiredResult，表示在请求完成前需要额外输入。</p> <p><code>inputRequests</code> 或 <code>requestState</code> 中至少一个 MUST 存在。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带引出和采样输入请求及请求状态的 InputRequiredResult<a href="#inputrequiredresult-example-inputrequiredresult-with-elicitation-and-sampling-input-requests-and-request-state" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="inputrequiredresult-example-inputrequiredresult-with-elicitation-and-sampling-input-requests-and-request-state"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"input\_required"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"inputRequests"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"github\_login"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"elicitation/create"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"message"</span><span class="hl-0">: </span><span class="hl-2">"Please provide your GitHub username"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"requestedSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"name"</span><span class="hl-0">: \{</span><br /><span class="hl-0">              </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><br /><span class="hl-0">            }</span><br /><span class="hl-0">          },</span><br /><span class="hl-0">          </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"name"</span><span class="hl-0">]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"capital\_of\_france"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"sampling/createMessage"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">              </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">              </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What is the capital of France?"</span><br /><span class="hl-0">            }</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ],</span><br /><span class="hl-0">        </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">100</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"requestState"</span><span class="hl-0">: </span><span class="hl-2">"eyJsb2NhdGlvbiI6Ik5ldyBZb3JrIn0"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：仅带请求状态的 InputRequiredResult（负载削减）<a href="#inputrequiredresult-example-inputrequiredresult-with-request-state-only-load-shedding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="inputrequiredresult-example-inputrequiredresult-with-request-state-only-load-shedding"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"input\_required"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"requestState"</span><span class="hl-0">: </span><span class="hl-2">"eyJwcm9ncmVzcyI6IjUwJSIsInN0YXRlIjoicHJvY2Vzc2luZyJ9"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="inputrequiredresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#inputrequiredresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="inputrequiredresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#inputrequiredresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-resulttype">resultType</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="inputrequiredresult-inputrequests" data-typedoc-h="3"><span>inputRequests?: InputRequests</span><a href="#inputrequiredresult-inputrequests" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="inputrequiredresult-requeststate" data-typedoc-h="3"><span>requestState?: string</span><a href="#inputrequiredresult-requeststate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `InputResponses`

  <div class="tsd-signature"><span class="tsd-kind-interface">InputResponses</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><div class="tsd-comment tsd-typography"><p>客户端对服务器发起请求的响应映射。键对应 <a href="#inputrequests" class="tsd-kind-interface">InputRequests</a> 映射中的键；值是客户端对每个请求的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出和采样输入响应<a href="#inputresponses-example-elicitation-and-sampling-input-responses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="inputresponses-example-elicitation-and-sampling-input-responses"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"github\_login"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"action"</span><span class="hl-0">: </span><span class="hl-2">"accept"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"octocat"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"capital\_of\_france"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"assistant"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"The capital of France is Paris."</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"model"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet-20240307"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"stopReason"</span><span class="hl-0">: </span><span class="hl-2">"endTurn"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div>
</div>

## `prompts/get`

<div class="type">
  ### `GetPromptRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">GetPromptRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#getpromptrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"prompts/get"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#getpromptrequestparams" class="tsd-signature-type tsd-kind-interface">GetPromptRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端用于获取服务器提供的提示。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：获取提示请求<a href="#getpromptrequest-example-get-prompt-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="getpromptrequest-example-get-prompt-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"get-prompt-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"prompts/get"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-2">"def hello():</span><span class="hl-4">\n</span><span class="hl-2">    print('world')"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#getpromptrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#getpromptrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptrequest-method" data-typedoc-h="3"><span>method: "prompts/get"</span><a href="#getpromptrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptrequest-params" data-typedoc-h="3"><span>params: GetPromptRequestParams</span><a href="#getpromptrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `GetPromptRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">GetPromptRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#getpromptrequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequestparams-inputresponses">inputResponses</a><span class="tsd-signature-symbol">?:</span> <a href="#inputresponses" class="tsd-signature-type tsd-kind-interface">InputResponses</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequestparams-requeststate">requestState</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequestparams-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptrequestparams-arguments">arguments</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>prompts/get</code> 请求的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：获取代码审查提示<a href="#getpromptrequestparams-example-get-code-review-prompt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="getpromptrequestparams-example-get-code-review-prompt"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"code"</span><span class="hl-0">: </span><span class="hl-2">"def hello():</span><span class="hl-4">\n</span><span class="hl-2">    print('world')"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptrequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#getpromptrequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptrequestparams-inputresponses" data-typedoc-h="3"><span>inputResponses?: InputResponses</span><a href="#getpromptrequestparams-inputresponses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-inputresponses">inputResponses</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptrequestparams-requeststate" data-typedoc-h="3"><span>requestState?: string</span><a href="#getpromptrequestparams-requeststate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-requeststate">requestState</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptrequestparams-name" data-typedoc-h="3"><span>name: string</span><a href="#getpromptrequestparams-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>提示或提示模板的名称。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptrequestparams-arguments" data-typedoc-h="3"><span>arguments?: \{ \[key: string]: string }</span><a href="#getpromptrequestparams-arguments" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于模板化提示的参数。</p> </div></section>
</div>

<div class="type">
  ### `GetPromptResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">GetPromptResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#getpromptresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#inputrequiredresult" class="tsd-signature-type tsd-kind-interface">InputRequiredResult</a> <span class="tsd-signature-symbol">|</span> <a href="#getpromptresult" class="tsd-signature-type tsd-kind-interface">GetPromptResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#getpromptrequest" class="tsd-kind-interface">prompts/get</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：获取提示结果响应<a href="#getpromptresultresponse-example-get-prompt-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="getpromptresultresponse-example-get-prompt-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"get-prompt-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Code review prompt"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Please review this Python code:</span><span class="hl-4">\n</span><span class="hl-2">def hello():</span><span class="hl-4">\n</span><span class="hl-2">    print('world')"</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#getpromptresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#getpromptresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptresultresponse-result" data-typedoc-h="3"><span>result: InputRequiredResult | GetPromptResult</span><a href="#getpromptresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `GetPromptResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">GetPromptResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#getpromptresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptresult-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#getpromptresult-messages">messages</a><span class="tsd-signature-symbol">:</span> <a href="#promptmessage" class="tsd-signature-type tsd-kind-interface">PromptMessage</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#getpromptrequest" class="tsd-kind-interface">prompts/get</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：代码审查提示<a href="#getpromptresult-example-code-review-prompt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="getpromptresult-example-code-review-prompt"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Code review prompt"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Please review this Python code:</span><span class="hl-4">\n</span><span class="hl-2">def hello():</span><span class="hl-4">\n</span><span class="hl-2">    print('world')"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#getpromptresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="getpromptresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#getpromptresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-resulttype">resultType</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptresult-description" data-typedoc-h="3"><span>description?: string</span><a href="#getpromptresult-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>提示的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="getpromptresult-messages" data-typedoc-h="3"><span>messages: PromptMessage\[]</span><a href="#getpromptresult-messages" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `PromptMessage`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">PromptMessage</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#promptmessage-role">role</a><span class="tsd-signature-symbol">:</span> <a href="#role" class="tsd-signature-type tsd-kind-type-alias">Role</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptmessage-content">content</a><span class="tsd-signature-symbol">:</span> <a href="#contentblock" class="tsd-signature-type tsd-kind-type-alias">ContentBlock</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>描述作为提示一部分返回的消息。</p> <p>这类似于 <a href="#samplingmessage" class="tsd-kind-interface">SamplingMessage</a>，但也支持嵌入来自 MCP 服务器的资源。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptmessage-role" data-typedoc-h="3"><span>role: Role</span><a href="#promptmessage-role" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptmessage-content" data-typedoc-h="3"><span>content: ContentBlock</span><a href="#promptmessage-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## `prompts/list`

<div class="type">
  ### `ListPromptsRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListPromptsRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listpromptsrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#paginatedrequestparams" class="tsd-signature-type tsd-kind-interface">PaginatedRequestParams</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"prompts/list"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送，用于请求服务器拥有的提示和提示模板列表。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出提示请求<a href="#listpromptsrequest-example-list-prompts-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listpromptsrequest-example-list-prompts-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-prompts-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"prompts/list"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listpromptsrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.jsonrpc</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listpromptsrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.id</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsrequest-params" data-typedoc-h="3"><span>params: PaginatedRequestParams</span><a href="#listpromptsrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listpromptsrequest-method" data-typedoc-h="3"><span>method: "prompts/list"</span><a href="#listpromptsrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 PaginatedRequest.method</p></aside></section>
</div>

<div class="type">
  ### `ListPromptsResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListPromptsResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listpromptsresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#listpromptsresult" class="tsd-signature-type tsd-kind-interface">ListPromptsResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listpromptsrequest" class="tsd-kind-interface">prompts/list</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出提示结果响应<a href="#listpromptsresultresponse-example-list-prompts-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listpromptsresultresponse-example-list-prompts-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-prompts-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"prompts"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Request Code Review"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Asks the LLM to analyze code quality and suggest improvements"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"arguments"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"The code to review"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"required"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ],</span><br /><span class="hl-0">        </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/review-icon.svg](https://example.com/review-icon.svg)"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/svg+xml"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"any"</span><span class="hl-0">]</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"next-page-cursor"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">600000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listpromptsresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listpromptsresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listpromptsresultresponse-result" data-typedoc-h="3"><span>result: ListPromptsResult</span><a href="#listpromptsresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `ListPromptsResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListPromptsResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-nextcursor">nextCursor</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listpromptsresult-prompts">prompts</a><span class="tsd-signature-symbol">:</span> <a href="#prompt" class="tsd-signature-type tsd-kind-interface">Prompt</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listpromptsrequest" class="tsd-kind-interface">prompts/list</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带游标和 TTL 的提示列表<a href="#listpromptsresult-example-prompts-list-with-cursor-and-ttl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listpromptsresult-example-prompts-list-with-cursor-and-ttl"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"prompts"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code\_review"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Request Code Review"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Asks the LLM to analyze code quality and suggest improvements"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"arguments"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"code"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"The code to review"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"required"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ],</span><br /><span class="hl-0">      </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/review-icon.svg](https://example.com/review-icon.svg)"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/svg+xml"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"any"</span><span class="hl-0">]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"next-page-cursor"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">600000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#listpromptsresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#listpromptsresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.resultType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresult-nextcursor" data-typedoc-h="3"><span>nextCursor?: string</span><a href="#listpromptsresult-nextcursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示最后一个返回结果之后分页位置的不透明令牌。如果存在，可能还有更多结果可用。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.nextCursor</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#listpromptsresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listpromptsresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#listpromptsresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listpromptsresult-prompts" data-typedoc-h="3"><span>prompts: Prompt\[]</span><a href="#listpromptsresult-prompts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `Prompt`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Prompt</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#prompt-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#prompt-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#prompt-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#prompt-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#prompt-arguments">arguments</a><span class="tsd-signature-symbol">?:</span> <a href="#promptargument" class="tsd-signature-type tsd-kind-interface">PromptArgument</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#prompt-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示或提示模板。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="prompt-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#prompt-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 Icons.icons</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="prompt-name" data-typedoc-h="3"><span>name: string</span><a href="#prompt-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="prompt-title" data-typedoc-h="3"><span>title?: string</span><a href="#prompt-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="prompt-description" data-typedoc-h="3"><span>description?: string</span><a href="#prompt-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>对此提示所提供内容的可选描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="prompt-arguments" data-typedoc-h="3"><span>arguments?: PromptArgument\[]</span><a href="#prompt-arguments" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于模板化提示的参数列表。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="prompt-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#prompt-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `PromptArgument`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">PromptArgument</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#promptargument-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptargument-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptargument-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#promptargument-required">required</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>描述提示可接受的参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="promptargument-name" data-typedoc-h="3"><span>name: string</span><a href="#promptargument-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="promptargument-title" data-typedoc-h="3"><span>title?: string</span><a href="#promptargument-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptargument-description" data-typedoc-h="3"><span>description?: string</span><a href="#promptargument-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>参数的人类可读描述。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="promptargument-required" data-typedoc-h="3"><span>required?: boolean</span><a href="#promptargument-required" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>是否必须提供此参数。</p> </div></section>
</div>

## `resources/list`

<div class="type">
  ### `ListResourcesRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourcesRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcesrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#paginatedrequestparams" class="tsd-signature-type tsd-kind-interface">PaginatedRequestParams</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"resources/list"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送，用于请求服务器拥有的资源列表。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出资源请求<a href="#listresourcesrequest-example-list-resources-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcesrequest-example-list-resources-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-resources-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"resources/list"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listresourcesrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.jsonrpc</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listresourcesrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.id</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesrequest-params" data-typedoc-h="3"><span>params: PaginatedRequestParams</span><a href="#listresourcesrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcesrequest-method" data-typedoc-h="3"><span>method: "resources/list"</span><a href="#listresourcesrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 PaginatedRequest.method</p></aside></section>
</div>

<div class="type">
  ### `ListResourcesResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourcesResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcesresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#listresourcesresult" class="tsd-signature-type tsd-kind-interface">ListResourcesResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listresourcesrequest" class="tsd-kind-interface">resources/list</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出资源结果响应<a href="#listresourcesresultresponse-example-list-resources-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcesresultresponse-example-list-resources-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-resources-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"resources"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Rust Software Application Main File"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Primary application entry point"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/rust-file-icon.png](https://example.com/rust-file-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"eyJwYWdlIjogM30="</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">600000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"private"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listresourcesresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listresourcesresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcesresultresponse-result" data-typedoc-h="3"><span>result: ListResourcesResult</span><a href="#listresourcesresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `ListResourcesResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourcesResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-nextcursor">nextCursor</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcesresult-resources">resources</a><span class="tsd-signature-symbol">:</span> <a href="#resource" class="tsd-signature-type tsd-kind-interface">Resource</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listresourcesrequest" class="tsd-kind-interface">resources/list</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带游标和 TTL 的资源列表<a href="#listresourcesresult-example-resources-list-with-cursor-and-ttl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcesresult-example-resources-list-with-cursor-and-ttl"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"resources"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Rust Software Application Main File"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Primary application entry point"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/rust-file-icon.png](https://example.com/rust-file-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"eyJwYWdlIjogM30="</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">600000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"private"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#listresourcesresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#listresourcesresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.resultType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresult-nextcursor" data-typedoc-h="3"><span>nextCursor?: string</span><a href="#listresourcesresult-nextcursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示最后一个返回结果之后分页位置的不透明令牌。如果存在，可能还有更多结果可用。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.nextCursor</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#listresourcesresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcesresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#listresourcesresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcesresult-resources" data-typedoc-h="3"><span>resources: Resource\[]</span><a href="#listresourcesresult-resources" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `Resource`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Resource</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resource-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-size">size</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resource-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器能够读取的已知资源。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带注释的文件资源<a href="#resource-example-file-resource-with-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="resource-example-file-resource-with-annotations"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/README.md"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"README.md"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Project Documentation"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/markdown"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"annotations"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"audience"</span><span class="hl-0">: \[</span><span class="hl-2">"user"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"priority"</span><span class="hl-0">: </span><span class="hl-3">0.8</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"lastModified"</span><span class="hl-0">: </span><span class="hl-2">"2025-01-12T15:00:58Z"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resource-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#resource-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 Icons.icons</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resource-name" data-typedoc-h="3"><span>name: string</span><a href="#resource-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resource-title" data-typedoc-h="3"><span>title?: string</span><a href="#resource-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-uri" data-typedoc-h="3"><span>uri: string</span><a href="#resource-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 URI。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-description" data-typedoc-h="3"><span>description?: string</span><a href="#resource-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>对此资源所表示内容的描述。</p> <p>客户端可使用此信息改进 LLM 对可用资源的理解。可将其视为给模型的“提示”。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#resource-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此资源的 MIME 类型（如果已知）。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#resource-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-size" data-typedoc-h="3"><span>size?: number</span><a href="#resource-size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>原始资源内容的大小（以字节为单位，即 Base64 编码或任何分词之前），如果已知。</p> <p>Host 可使用此信息显示文件大小并估算上下文窗口使用量。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resource-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#resource-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## `resources/read`

<div class="type">
  ### `ReadResourceRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ReadResourceRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#readresourcerequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"resources/read"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#readresourcerequestparams" class="tsd-signature-type tsd-kind-interface">ReadResourceRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送给服务器，用于读取特定资源 URI。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：读取资源请求<a href="#readresourcerequest-example-read-resource-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="readresourcerequest-example-read-resource-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"read-resource-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"resources/read"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#readresourcerequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#readresourcerequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="readresourcerequest-method" data-typedoc-h="3"><span>method: "resources/read"</span><a href="#readresourcerequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="readresourcerequest-params" data-typedoc-h="3"><span>params: ReadResourceRequestParams</span><a href="#readresourcerequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `ReadResourceRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ReadResourceRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#readresourcerequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequestparams-inputresponses">inputResponses</a><span class="tsd-signature-symbol">?:</span> <a href="#inputresponses" class="tsd-signature-type tsd-kind-interface">InputResponses</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequestparams-requeststate">requestState</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourcerequestparams-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>resources/read</code> 请求的参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#readresourcerequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequestparams-inputresponses" data-typedoc-h="3"><span>inputResponses?: InputResponses</span><a href="#readresourcerequestparams-inputresponses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-inputresponses">inputResponses</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequestparams-requeststate" data-typedoc-h="3"><span>requestState?: string</span><a href="#readresourcerequestparams-requeststate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-requeststate">requestState</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourcerequestparams-uri" data-typedoc-h="3"><span>uri: string</span><a href="#readresourcerequestparams-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>资源的 URI。URI 可以使用任何协议；如何解释由服务器决定。</p> </div><aside class="tsd-sources"><p>继承自 ResourceRequestParams.uri</p></aside></section>
</div>

<div class="type">
  ### `ReadResourceResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ReadResourceResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#readresourceresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#inputrequiredresult" class="tsd-signature-type tsd-kind-interface">InputRequiredResult</a> <span class="tsd-signature-symbol">|</span> <a href="#readresourceresult" class="tsd-signature-type tsd-kind-interface">ReadResourceResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#readresourcerequest" class="tsd-kind-interface">resources/read</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：读取资源结果响应<a href="#readresourceresultresponse-example-read-resource-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="readresourceresultresponse-example-read-resource-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"read-resource-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"contents"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"fn main() \{</span><span class="hl-4">\n</span><span class="hl-2">    println!(</span><span class="hl-4">\\"</span><span class="hl-2">Hello world!</span><span class="hl-4">\\"</span><span class="hl-2">);</span><span class="hl-4">\n</span><span class="hl-2">}"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带 TTL 的读取资源结果响应<a href="#readresourceresultresponse-example-read-resource-result-response-with-ttl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="readresourceresultresponse-example-read-resource-result-response-with-ttl"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"read-resource-with-ttl-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"contents"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"fn main() \{</span><span class="hl-4">\n</span><span class="hl-2">    println!(</span><span class="hl-4">\\"</span><span class="hl-2">Hello world!</span><span class="hl-4">\\"</span><span class="hl-2">);</span><span class="hl-4">\n</span><span class="hl-2">}"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">60000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"private"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#readresourceresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#readresourceresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="readresourceresultresponse-result" data-typedoc-h="3"><span>result: InputRequiredResult | ReadResourceResult</span><a href="#readresourceresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `ReadResourceResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ReadResourceResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#readresourceresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#readresourceresult-contents">contents</a><span class="tsd-signature-symbol">:</span> (<a href="#textresourcecontents" class="tsd-signature-type tsd-kind-interface">TextResourceContents</a> <span class="tsd-signature-symbol">|</span> <a href="#blobresourcecontents" class="tsd-signature-type tsd-kind-interface">BlobResourceContents</a>)<span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#readresourcerequest" class="tsd-kind-interface">resources/read</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文件资源内容<a href="#readresourceresult-example-file-resource-contents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="readresourceresult-example-file-resource-contents"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"contents"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///project/src/main.rs"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"text/x-rust"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"fn main() \{</span><span class="hl-4">\n</span><span class="hl-2">    println!(</span><span class="hl-4">\\"</span><span class="hl-2">Hello world!</span><span class="hl-4">\\"</span><span class="hl-2">);</span><span class="hl-4">\n</span><span class="hl-2">}"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">60000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"private"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#readresourceresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 CacheableResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#readresourceresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 CacheableResult.resultType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#readresourceresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="readresourceresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#readresourceresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="readresourceresult-contents" data-typedoc-h="3"><span>contents: (TextResourceContents | BlobResourceContents)\[]</span><a href="#readresourceresult-contents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## `resources/templates/list`

<div class="type">
  ### `ListResourceTemplatesRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourceTemplatesRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#paginatedrequestparams" class="tsd-signature-type tsd-kind-interface">PaginatedRequestParams</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"resources/templates/list"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送，用于请求服务器拥有的资源模板列表。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出资源模板请求<a href="#listresourcetemplatesrequest-example-list-resource-templates-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcetemplatesrequest-example-list-resource-templates-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-resource-templates-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"resources/templates/list"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listresourcetemplatesrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.jsonrpc</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listresourcetemplatesrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.id</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesrequest-params" data-typedoc-h="3"><span>params: PaginatedRequestParams</span><a href="#listresourcetemplatesrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcetemplatesrequest-method" data-typedoc-h="3"><span>method: "resources/templates/list"</span><a href="#listresourcetemplatesrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 PaginatedRequest.method</p></aside></section>
</div>

<div class="type">
  ### `ListResourceTemplatesResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourceTemplatesResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#listresourcetemplatesresult" class="tsd-signature-type tsd-kind-interface">ListResourceTemplatesResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listresourcetemplatesrequest" class="tsd-kind-interface">resources/templates/list</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出资源模板结果响应<a href="#listresourcetemplatesresultresponse-example-list-resource-templates-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcetemplatesresultresponse-example-list-resource-templates-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-resource-templates-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"resourceTemplates"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"uriTemplate"</span><span class="hl-0">: </span><span class="hl-2">"file:///\{path}"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"Project Files"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Project Files"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Access files in the project directory"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"application/octet-stream"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/folder-icon.png](https://example.com/folder-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">3600000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listresourcetemplatesresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listresourcetemplatesresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcetemplatesresultresponse-result" data-typedoc-h="3"><span>result: ListResourceTemplatesResult</span><a href="#listresourcetemplatesresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `ListResourceTemplatesResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListResourceTemplatesResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-nextcursor">nextCursor</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listresourcetemplatesresult-resourcetemplates">resourceTemplates</a><span class="tsd-signature-symbol">:</span> <a href="#resourcetemplate" class="tsd-signature-type tsd-kind-interface">ResourceTemplate</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listresourcetemplatesrequest" class="tsd-kind-interface">resources/templates/list</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带游标和 TTL 的资源模板列表<a href="#listresourcetemplatesresult-example-resource-templates-list-with-cursor-and-ttl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listresourcetemplatesresult-example-resource-templates-list-with-cursor-and-ttl"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"resourceTemplates"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uriTemplate"</span><span class="hl-0">: </span><span class="hl-2">"file:///\{path}"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"Project Files"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"📁 Project Files"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Access files in the project directory"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"application/octet-stream"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/folder-icon.png](https://example.com/folder-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"next-page-cursor"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">3600000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#listresourcetemplatesresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#listresourcetemplatesresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.resultType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresult-nextcursor" data-typedoc-h="3"><span>nextCursor?: string</span><a href="#listresourcetemplatesresult-nextcursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示最后一个返回结果之后分页位置的不透明令牌。如果存在，可能还有更多结果可用。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.nextCursor</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#listresourcetemplatesresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listresourcetemplatesresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#listresourcetemplatesresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listresourcetemplatesresult-resourcetemplates" data-typedoc-h="3"><span>resourceTemplates: ResourceTemplate\[]</span><a href="#listresourcetemplatesresult-resourcetemplates" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ResourceTemplate`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ResourceTemplate</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-uritemplate">uriTemplate</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-mimetype">mimeType</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#annotations" class="tsd-signature-type tsd-kind-interface">Annotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#resourcetemplate-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器上可用资源的模板描述。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcetemplate-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#resourcetemplate-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 Icons.icons</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcetemplate-name" data-typedoc-h="3"><span>name: string</span><a href="#resourcetemplate-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="resourcetemplate-title" data-typedoc-h="3"><span>title?: string</span><a href="#resourcetemplate-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplate-uritemplate" data-typedoc-h="3"><span>uriTemplate: string</span><a href="#resourcetemplate-uritemplate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可用于构造资源 URI 的 URI 模板（依据 RFC 6570）。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplate-description" data-typedoc-h="3"><span>description?: string</span><a href="#resourcetemplate-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>对此模板用途的描述。</p> <p>客户端可使用此信息改进 LLM 对可用资源的理解。可将其视为给模型的“提示”。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplate-mimetype" data-typedoc-h="3"><span>mimeType?: string</span><a href="#resourcetemplate-mimetype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>匹配此模板的所有资源的 MIME 类型。仅当所有匹配此模板的资源具有相同类型时才应包含。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplate-annotations" data-typedoc-h="3"><span>annotations?: Annotations</span><a href="#resourcetemplate-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>供客户端使用的可选注释。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="resourcetemplate-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#resourcetemplate-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## `roots/list`

<div class="type">
  ### `ListRootsRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListRootsRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listrootsrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"roots/list"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listrootsrequest-params">params</a><span class="tsd-signature-symbol">?:</span> <a href="#requestparams" class="tsd-signature-type tsd-kind-interface">RequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器发送，用于向客户端请求根 URI 列表。根目录允许服务器请求可操作的特定目录或文件。根目录的常见示例是提供一组服务器应操作的仓库或目录。</p> <p>当服务器需要了解文件系统结构，或访问客户端有权限读取的特定位置时，通常使用此请求。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出根目录请求<a href="#listrootsrequest-example-list-roots-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listrootsrequest-example-list-roots-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-roots-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"roots/list"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listrootsrequest-method" data-typedoc-h="3"><span class="deprecated">method: "roots/list"</span><a href="#listrootsrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listrootsrequest-params" data-typedoc-h="3"><span class="deprecated">params?: RequestParams</span><a href="#listrootsrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ListRootsResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListRootsResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listrootsresult-roots">roots</a><span class="tsd-signature-symbol">:</span> <a href="#root" class="tsd-signature-type tsd-kind-interface">Root</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端针对 <a href="#listrootsrequest" class="tsd-kind-interface">roots/list</a> 请求返回的结果。此结果包含一个 <a href="#root" class="tsd-kind-interface">Root</a> 对象数组，每个对象表示服务器可操作的根目录或文件。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：单个根目录<a href="#listrootsresult-example-single-root-directory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listrootsresult-example-single-root-directory"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"roots"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///home/user/projects/myproject"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"My Project"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：多个根目录<a href="#listrootsresult-example-multiple-root-directories" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listrootsresult-example-multiple-root-directories"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"roots"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///home/user/repos/frontend"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"Frontend Repository"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///home/user/repos/backend"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"Backend Repository"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listrootsresult-roots" data-typedoc-h="3"><span class="deprecated">roots: Root\[]</span><a href="#listrootsresult-roots" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `Root`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Root</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#root-uri">uri</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#root-name">name</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#root-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>表示服务器可操作的根目录或文件。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：项目目录根目录<a href="#root-example-project-directory-root" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="root-example-project-directory-root"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"uri"</span><span class="hl-0">: </span><span class="hl-2">"file:///home/user/projects/myproject"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"My Project"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="root-uri" data-typedoc-h="3"><span class="deprecated">uri: string</span><a href="#root-uri" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>标识根目录的 URI。目前它<em>必须</em>以 <code>file://</code> 开头。未来协议版本可能会放宽此限制，以允许其他 URI 方案。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="root-name" data-typedoc-h="3"><span class="deprecated">name?: string</span><a href="#root-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>根目录的可选名称。可用于为根目录提供人类可读标识符，这对显示用途或在应用程序其他部分引用根目录可能有用。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="root-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#root-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

## `sampling/createMessage`

<div class="type">
  ### `CreateMessageRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CreateMessageRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#createmessagerequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"sampling/createMessage"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#createmessagerequestparams" class="tsd-signature-type tsd-kind-interface">CreateMessageRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器通过客户端对 LLM 进行采样的请求。客户端可完全自行决定选择哪个模型。客户端还应在开始采样前通知用户，使其能够检查请求（人在环路中）并决定是否批准。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：采样请求<a href="#createmessagerequest-example-sampling-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessagerequest-example-sampling-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"sampling/createMessage"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What is the capital of France?"</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"modelPreferences"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"hints"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet"</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ],</span><br /><span class="hl-0">      </span><span class="hl-1">"intelligencePriority"</span><span class="hl-0">: </span><span class="hl-3">0.8</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"speedPriority"</span><span class="hl-0">: </span><span class="hl-3">0.5</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"systemPrompt"</span><span class="hl-0">: </span><span class="hl-2">"You are a helpful assistant."</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">100</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequest-method" data-typedoc-h="3"><span class="deprecated">method: "sampling/createMessage"</span><a href="#createmessagerequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequest-params" data-typedoc-h="3"><span class="deprecated">params: CreateMessageRequestParams</span><a href="#createmessagerequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `CreateMessageRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CreateMessageRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-messages">messages</a><span class="tsd-signature-symbol">:</span> <a href="#samplingmessage" class="tsd-signature-type tsd-kind-interface">SamplingMessage</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-modelpreferences">modelPreferences</a><span class="tsd-signature-symbol">?:</span> <a href="#modelpreferences" class="tsd-signature-type tsd-kind-interface">ModelPreferences</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-systemprompt">systemPrompt</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-includecontext">includeContext</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">"none"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"thisServer"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"allServers"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-temperature">temperature</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-maxtokens">maxTokens</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-stopsequences">stopSequences</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-metadata">metadata</a><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-tools">tools</a><span class="tsd-signature-symbol">?:</span> <a href="#tool" class="tsd-signature-type tsd-kind-interface">Tool</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessagerequestparams-toolchoice">toolChoice</a><span class="tsd-signature-symbol">?:</span> <a href="#toolchoice" class="tsd-signature-type tsd-kind-interface">ToolChoice</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>sampling/createMessage</code> 请求的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：基础请求<a href="#createmessagerequestparams-example-basic-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessagerequestparams-example-basic-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What is the capital of France?"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"modelPreferences"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"hints"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"intelligencePriority"</span><span class="hl-0">: </span><span class="hl-3">0.8</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"speedPriority"</span><span class="hl-0">: </span><span class="hl-3">0.5</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"systemPrompt"</span><span class="hl-0">: </span><span class="hl-2">"You are a helpful assistant."</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">100</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带工具的请求<a href="#createmessagerequestparams-example-request-with-tools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessagerequestparams-example-request-with-tools"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What's the weather like in Paris and London?"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"tools"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Get current weather for a city"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"city"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"City name"</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"city"</span><span class="hl-0">]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"toolChoice"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"mode"</span><span class="hl-0">: </span><span class="hl-2">"auto"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">1000</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带工具结果的后续请求<a href="#createmessagerequestparams-example-follow-up-request-with-tool-results" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessagerequestparams-example-follow-up-request-with-tool-results"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"messages"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What's the weather like in Paris and London?"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"assistant"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_use"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call\_abc123"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"input"</span><span class="hl-0">: \{ </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"Paris"</span><span class="hl-0"> }</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_use"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call\_def456"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"input"</span><span class="hl-0">: \{ </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"London"</span><span class="hl-0"> }</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_result"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"toolUseId"</span><span class="hl-0">: </span><span class="hl-2">"call\_abc123"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">            \{</span><br /><span class="hl-0">              </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">              </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Weather in Paris: 18°C, partly cloudy"</span><br /><span class="hl-0">            }</span><br /><span class="hl-0">          ]</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_result"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"toolUseId"</span><span class="hl-0">: </span><span class="hl-2">"call\_def456"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">            \{</span><br /><span class="hl-0">              </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">              </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Weather in London: 15°C, rainy"</span><br /><span class="hl-0">            }</span><br /><span class="hl-0">          ]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"tools"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Get current weather for a city"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"city"</span><span class="hl-0">: \{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0"> }</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"city"</span><span class="hl-0">]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"maxTokens"</span><span class="hl-0">: </span><span class="hl-3">1000</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-messages" data-typedoc-h="3"><span class="deprecated">messages: SamplingMessage\[]</span><a href="#createmessagerequestparams-messages" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-modelpreferences" data-typedoc-h="3"><span class="deprecated">modelPreferences?: ModelPreferences</span><a href="#createmessagerequestparams-modelpreferences" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器对模型选择的偏好。客户端 MAY 忽略这些偏好。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-systemprompt" data-typedoc-h="3"><span class="deprecated">systemPrompt?: string</span><a href="#createmessagerequestparams-systemprompt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器希望用于采样的可选系统提示。客户端 MAY 修改或省略此提示。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-includecontext" data-typedoc-h="3"><span class="deprecated">includeContext?: "none" | "thisServer" | "allServers"</span><a href="#createmessagerequestparams-includecontext" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>请求包含来自一个或多个 MCP 服务器（包括调用方）的上下文，并将其附加到提示中。客户端 MAY 忽略此请求。</p> <p>默认值为 <code>"none"</code>。<code>"thisServer"</code> 和 <code>"allServers"</code> 值已弃用（SEP-2596）：服务器 SHOULD 省略此字段或使用 <code>"none"</code>，并且 SHOULD 仅在客户端声明 <a href="#clientcapabilities-sampling" class="tsd-kind-property">ClientCapabilities.sampling.context</a> 时使用已弃用的值。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p><code>"thisServer"</code> 和 <code>"allServers"</code> 值自协议版本 2025-11-25（SEP-2596）起弃用，并且最晚会随采样功能本身（SEP-2577）一起移除。请省略此字段或使用 <code>"none"</code>。</p> </div></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-temperature" data-typedoc-h="3"><span class="deprecated">temperature?: number</span><a href="#createmessagerequestparams-temperature" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-maxtokens" data-typedoc-h="3"><span class="deprecated">maxTokens: number</span><a href="#createmessagerequestparams-maxtokens" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>请求采样的最大 token 数（用于防止补全失控）。</p> <p>客户端 MAY 选择采样少于请求上限的 token。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-stopsequences" data-typedoc-h="3"><span class="deprecated">stopSequences?: string\[]</span><a href="#createmessagerequestparams-stopsequences" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-metadata" data-typedoc-h="3"><span class="deprecated">metadata?: JSONObject</span><a href="#createmessagerequestparams-metadata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>传递给 LLM 提供商的可选元数据。此元数据的格式由提供商决定。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-tools" data-typedoc-h="3"><span class="deprecated">tools?: Tool\[]</span><a href="#createmessagerequestparams-tools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>模型在生成期间可使用的工具。如果提供了此字段但未声明 <a href="#clientcapabilities-sampling" class="tsd-kind-property">ClientCapabilities.sampling.tools</a>，客户端 MUST 返回错误。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessagerequestparams-toolchoice" data-typedoc-h="3"><span class="deprecated">toolChoice?: ToolChoice</span><a href="#createmessagerequestparams-toolchoice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>控制模型如何使用工具。如果提供了此字段但未声明 <a href="#clientcapabilities-sampling" class="tsd-kind-property">ClientCapabilities.sampling.tools</a>，客户端 MUST 返回错误。默认值为 <code>\{ mode: "auto" }</code>。</p> </div></section>
</div>

<div class="type">
  ### `CreateMessageResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CreateMessageResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#createmessageresult-model">model</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessageresult-stopreason">stopReason</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessageresult-role">role</a><span class="tsd-signature-symbol">:</span> <a href="#role" class="tsd-signature-type tsd-kind-type-alias">Role</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessageresult-content">content</a><span class="tsd-signature-symbol">:</span> <a href="#samplingmessagecontentblock" class="tsd-signature-type tsd-kind-type-alias">SamplingMessageContentBlock</a> <span class="tsd-signature-symbol">|</span> <a href="#samplingmessagecontentblock" class="tsd-signature-type tsd-kind-type-alias">SamplingMessageContentBlock</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#createmessageresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端针对 <a href="#createmessagerequest" class="tsd-kind-interface">sampling/createMessage</a> 请求返回的结果。客户端应在返回采样消息前通知用户，使其能够检查响应（人在环路中）并决定是否允许服务器看到它。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：文本响应<a href="#createmessageresult-example-text-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessageresult-example-text-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"assistant"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"The capital of France is Paris."</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"model"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet-20240307"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"stopReason"</span><span class="hl-0">: </span><span class="hl-2">"endTurn"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：工具使用响应<a href="#createmessageresult-example-tool-use-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessageresult-example-tool-use-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"assistant"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_use"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call\_abc123"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"input"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"Paris"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_use"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call\_def456"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"input"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"London"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"model"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet-20240307"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"stopReason"</span><span class="hl-0">: </span><span class="hl-2">"toolUse"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：工具使用后的最终响应<a href="#createmessageresult-example-final-response-after-tool-use" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="createmessageresult-example-final-response-after-tool-use"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"assistant"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Based on the current weather data:</span><span class="hl-4">\n\n</span><span class="hl-2">- \*\*Paris\*\*: 18°C and partly cloudy - quite pleasant!</span><span class="hl-4">\n</span><span class="hl-2">- \*\*London\*\*: 15°C and rainy - you'll want an umbrella.</span><span class="hl-4">\n\n</span><span class="hl-2">Paris has slightly warmer and drier conditions today."</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"model"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet-20240307"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"stopReason"</span><span class="hl-0">: </span><span class="hl-2">"endTurn"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessageresult-model" data-typedoc-h="3"><span class="deprecated">model: string</span><a href="#createmessageresult-model" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>生成该消息的模型名称。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="createmessageresult-stopreason" data-typedoc-h="3"><span class="deprecated">stopReason?: string</span><a href="#createmessageresult-stopreason" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>采样停止的原因（如果已知）。</p> <p>标准值：</p> <ul> <li><code>"endTurn"</code>：助手回合自然结束</li> <li><code>"stopSequence"</code>：遇到停止序列</li> <li><code>"maxTokens"</code>：达到最大 token 限制</li> <li><code>"toolUse"</code>：模型希望使用一个或多个工具</li> </ul> <p>此字段是开放字符串，用于允许提供商特定的停止原因。</p> </div></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="createmessageresult-role" data-typedoc-h="3"><span class="deprecated">role: Role</span><a href="#createmessageresult-role" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#samplingmessage">SamplingMessage</a>.<a href="#samplingmessage-role">role</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="createmessageresult-content" data-typedoc-h="3"><span class="deprecated">content: SamplingMessageContentBlock | SamplingMessageContentBlock\[]</span><a href="#createmessageresult-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#samplingmessage">SamplingMessage</a>.<a href="#samplingmessage-content">content</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="createmessageresult-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#createmessageresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#samplingmessage">SamplingMessage</a>.<a href="#samplingmessage-_meta">\_meta</a></p></aside></section>
</div>

<div class="type">
  ### `ModelHint`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ModelHint</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#modelhint-name">name</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>用于模型选择的提示。</p> <p>此处未声明的键目前在规范中未指定，由客户端解释。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="modelhint-name" data-typedoc-h="3"><span class="deprecated">name?: string</span><a href="#modelhint-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>模型名称提示。</p> <p>客户端 SHOULD 将其视为模型名称的子字符串；例如：</p> <ul> <li><code>claude-3-5-sonnet</code> 应匹配 <code>claude-3-5-sonnet-20241022</code></li> <li><code>sonnet</code> 应匹配 <code>claude-3-5-sonnet-20241022</code>、<code>claude-3-sonnet-20240229</code> 等。</li> <li><code>claude</code> 应匹配任何 Claude 模型</li> </ul> <p>只要用途相近，客户端 MAY 也可将该字符串映射到其他提供商的模型名称或不同模型系列；例如：</p> <ul> <li><code>gemini-1.5-flash</code> 可匹配 <code>claude-3-haiku-20240307</code></li> </ul> </div></section>
</div>

<div class="type">
  ### `ModelPreferences`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ModelPreferences</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#modelpreferences-hints">hints</a><span class="tsd-signature-symbol">?:</span> <a href="#modelhint" class="tsd-signature-type tsd-kind-interface">ModelHint</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#modelpreferences-costpriority">costPriority</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#modelpreferences-speedpriority">speedPriority</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#modelpreferences-intelligencepriority">intelligencePriority</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器在采样期间向客户端请求的模型选择偏好。</p> <p>由于 LLM 可能在多个维度上存在差异，选择“最佳”模型很少是直接明了的。不同模型擅长不同方面——有些更快但能力较弱，有些能力更强但更昂贵，等等。此接口允许服务器表达多个维度上的优先级，帮助客户端为其用例做出适当选择。</p> <p>这些偏好始终仅供参考。客户端 MAY 忽略它们。客户端也自行决定如何解释这些偏好，以及如何将其与其他考虑因素进行权衡。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带提示和优先级<a href="#modelpreferences-example-with-hints-and-priorities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="modelpreferences-example-with-hints-and-priorities"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"hints"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{ </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"claude-3-sonnet"</span><span class="hl-0"> },</span><br /><span class="hl-0">    \{ </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"claude"</span><span class="hl-0"> }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"costPriority"</span><span class="hl-0">: </span><span class="hl-3">0.3</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"speedPriority"</span><span class="hl-0">: </span><span class="hl-3">0.8</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"intelligencePriority"</span><span class="hl-0">: </span><span class="hl-3">0.5</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="modelpreferences-hints" data-typedoc-h="3"><span class="deprecated">hints?: ModelHint\[]</span><a href="#modelpreferences-hints" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于模型选择的可选提示。</p> <p>如果指定了多个提示，客户端 MUST 按顺序评估它们（采用第一个匹配项）。</p> <p>客户端 SHOULD 优先考虑这些提示而非数值优先级，但 MAY 仍使用优先级从模糊匹配中进行选择。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="modelpreferences-costpriority" data-typedoc-h="3"><span class="deprecated">costPriority?: number</span><a href="#modelpreferences-costpriority" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>选择模型时对成本的优先程度。值为 0 表示成本不重要，值为 1 表示成本是最重要的因素。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="modelpreferences-speedpriority" data-typedoc-h="3"><span class="deprecated">speedPriority?: number</span><a href="#modelpreferences-speedpriority" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>选择模型时对采样速度（延迟）的优先程度。值为 0 表示速度不重要，值为 1 表示速度是最重要的因素。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="modelpreferences-intelligencepriority" data-typedoc-h="3"><span class="deprecated">intelligencePriority?: number</span><a href="#modelpreferences-intelligencepriority" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>选择模型时对智能和能力的优先程度。值为 0 表示智能不重要，值为 1 表示智能是最重要的因素。</p> </div></section>
</div>

<div class="type">
  ### `SamplingMessage`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SamplingMessage</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#samplingmessage-role">role</a><span class="tsd-signature-symbol">:</span> <a href="#role" class="tsd-signature-type tsd-kind-type-alias">Role</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#samplingmessage-content">content</a><span class="tsd-signature-symbol">:</span> <a href="#samplingmessagecontentblock" class="tsd-signature-type tsd-kind-type-alias">SamplingMessageContentBlock</a> <span class="tsd-signature-symbol">|</span> <a href="#samplingmessagecontentblock" class="tsd-signature-type tsd-kind-type-alias">SamplingMessageContentBlock</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#samplingmessage-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>描述发送给 LLM API 或从 LLM API 接收的消息。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：单个内容块<a href="#samplingmessage-example-single-content-block" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="samplingmessage-example-single-content-block"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"What is the capital of France?"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：多个内容块<a href="#samplingmessage-example-multiple-content-blocks" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="samplingmessage-example-multiple-content-blocks"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"role"</span><span class="hl-0">: </span><span class="hl-2">"user"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_result"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"toolUseId"</span><span class="hl-0">: </span><span class="hl-2">"call\_123"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \[\{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">, </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Result 1"</span><span class="hl-0"> }]</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_result"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"toolUseId"</span><span class="hl-0">: </span><span class="hl-2">"call\_456"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"content"</span><span class="hl-0">: \[\{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">, </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Result 2"</span><span class="hl-0"> }]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="samplingmessage-role" data-typedoc-h="3"><span class="deprecated">role: Role</span><a href="#samplingmessage-role" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="samplingmessage-content" data-typedoc-h="3"><span class="deprecated">content: SamplingMessageContentBlock | SamplingMessageContentBlock\[]</span><a href="#samplingmessage-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="samplingmessage-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#samplingmessage-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `SamplingMessageContentBlock`

  <div class="tsd-signature"><span class="tsd-kind-type-alias">SamplingMessageContentBlock</span><span class="tsd-signature-symbol">:</span><br />  <span class="tsd-signature-symbol">|</span> <a href="#textcontent" class="tsd-signature-type tsd-kind-interface">TextContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#imagecontent" class="tsd-signature-type tsd-kind-interface">ImageContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#audiocontent" class="tsd-signature-type tsd-kind-interface">AudioContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#toolusecontent" class="tsd-signature-type tsd-kind-interface">ToolUseContent</a><br />  <span class="tsd-signature-symbol">|</span> <a href="#toolresultcontent" class="tsd-signature-type tsd-kind-interface">ToolResultContent</a></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div>
</div>

<div class="type">
  ### `ToolChoice`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ToolChoice</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#toolchoice-mode">mode</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">"none"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"required"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"auto"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>控制采样请求的工具选择行为。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolchoice-mode" data-typedoc-h="3"><span class="deprecated">mode?: "none" | "required" | "auto"</span><a href="#toolchoice-mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>控制模型使用工具的能力：</p> <ul> <li><code>"auto"</code>：模型决定是否使用工具（默认）</li> <li><code>"required"</code>：模型 MUST 在完成前使用至少一个工具</li> <li><code>"none"</code>：模型 MUST NOT 使用任何工具</li> </ul> </div></section>
</div>

<div class="type">
  ### `ToolResultContent`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ToolResultContent</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"tool\_result"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-tooluseid">toolUseId</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-content">content</a><span class="tsd-signature-symbol">:</span> <a href="#contentblock" class="tsd-signature-type tsd-kind-type-alias">ContentBlock</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-structuredcontent">structuredContent</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-iserror">isError</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolresultcontent-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>工具使用的结果，由用户提供回助手。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：\`get\_weather\` 工具结果<a href="#toolresultcontent-example-get_weather-tool-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="toolresultcontent-example-get_weather-tool-result"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_result"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"toolUseId"</span><span class="hl-0">: </span><span class="hl-2">"call\_abc123"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Weather in Paris: 18°C, partly cloudy"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ]</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-type" data-typedoc-h="3"><span class="deprecated">type: "tool\_result"</span><a href="#toolresultcontent-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-tooluseid" data-typedoc-h="3"><span class="deprecated">toolUseId: string</span><a href="#toolresultcontent-tooluseid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此结果对应的工具使用 ID。</p> <p>这 MUST 与先前 <a href="#toolusecontent" class="tsd-kind-interface">ToolUseContent</a> 中的 ID 匹配。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-content" data-typedoc-h="3"><span class="deprecated">content: ContentBlock\[]</span><a href="#toolresultcontent-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具使用的非结构化结果内容。</p> <p>其格式与 <a href="#calltoolresult-content" class="tsd-kind-property">CallToolResult.content</a> 相同，可包含文本、图像、音频、资源链接和嵌入资源。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-structuredcontent" data-typedoc-h="3"><span class="deprecated">structuredContent?: unknown</span><a href="#toolresultcontent-structuredcontent" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选的结构化结果值。</p> <p>可以是任何 JSON 值（对象、数组、字符串、数字、布尔值或 null）。如果工具定义了 <a href="#tool-outputschema" class="tsd-kind-property">Tool.outputSchema</a>，则此值 SHOULD 符合该 schema。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-iserror" data-typedoc-h="3"><span class="deprecated">isError?: boolean</span><a href="#toolresultcontent-iserror" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具使用是否产生错误。</p> <p>如果为 true，内容通常描述发生的错误。
  默认值：false</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolresultcontent-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#toolresultcontent-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于工具结果的可选元数据。客户端在后续采样请求中包含工具结果时 SHOULD 保留此字段，以启用缓存优化。</p> </div></section>
</div>

<div class="type">
  ### `ToolUseContent`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ToolUseContent</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#toolusecontent-type">type</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"tool\_use"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolusecontent-id">id</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolusecontent-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolusecontent-input">input</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolusecontent-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>助手发出的调用工具请求。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：\`get\_weather\` 工具使用<a href="#toolusecontent-example-get_weather-tool-use" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="toolusecontent-example-get_weather-tool-use"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"tool\_use"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call\_abc123"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"input"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"Paris"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div></div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolusecontent-type" data-typedoc-h="3"><span class="deprecated">type: "tool\_use"</span><a href="#toolusecontent-type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolusecontent-id" data-typedoc-h="3"><span class="deprecated">id: string</span><a href="#toolusecontent-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此工具使用的唯一标识符。</p> <p>此 ID 用于将工具结果与对应的工具使用进行匹配。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolusecontent-name" data-typedoc-h="3"><span class="deprecated">name: string</span><a href="#toolusecontent-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>要调用的工具名称。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolusecontent-input" data-typedoc-h="3"><span class="deprecated">input: \{ \[key: string]: unknown }</span><a href="#toolusecontent-input" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>传递给工具的参数，符合该工具的输入 schema。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolusecontent-_meta" data-typedoc-h="3"><span class="deprecated">\_meta?: MetaObject</span><a href="#toolusecontent-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于工具使用的可选元数据。客户端在后续采样请求中包含工具使用时 SHOULD 保留此字段，以启用缓存优化。</p> </div></section>
</div>

## `server/discover`

<div class="type">
  ### `DiscoverRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">DiscoverRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#discoverrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"server/discover"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#requestparams" class="tsd-signature-type tsd-kind-interface">RequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端请求服务器公布其支持的协议版本、能力和其他元数据的请求。服务器 <strong>MUST</strong> 实现 <code>server/discover</code>。客户端 <strong>MAY</strong> 调用它，但不是必需的——版本协商也可以通过每个请求的 <code>\_meta</code> 内联发生。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：发现请求<a href="#discoverrequest-example-discover-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="discoverrequest-example-discover-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"discover-1"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"server/discover"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#discoverrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#discoverrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverrequest-method" data-typedoc-h="3"><span>method: "server/discover"</span><a href="#discoverrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverrequest-params" data-typedoc-h="3"><span>params: RequestParams</span><a href="#discoverrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `DiscoverResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">DiscoverResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#discoverresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#discoverresult" class="tsd-signature-type tsd-kind-interface">DiscoverResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#discoverrequest" class="tsd-kind-interface">server/discover</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：发现结果响应<a href="#discoverresultresponse-example-discover-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="discoverresultresponse-example-discover-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"discover-1"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"supportedVersions"</span><span class="hl-0">: \[</span><span class="hl-2">"2026-07-28"</span><span class="hl-0">],</span><br /><span class="hl-0">    </span><span class="hl-1">"capabilities"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"tools"</span><span class="hl-0">: \{},</span><br /><span class="hl-0">      </span><span class="hl-1">"resources"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"serverInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleServer"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">3600000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#discoverresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#discoverresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverresultresponse-result" data-typedoc-h="3"><span>result: DiscoverResult</span><a href="#discoverresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `DiscoverResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">DiscoverResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#discoverresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-supportedversions">supportedVersions</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-capabilities">capabilities</a><span class="tsd-signature-symbol">:</span> <a href="#servercapabilities" class="tsd-signature-type tsd-kind-interface">ServerCapabilities</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-serverinfo">serverInfo</a><span class="tsd-signature-symbol">:</span> <a href="#implementation" class="tsd-signature-type tsd-kind-interface">Implementation</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-instructions">instructions</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#discoverresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#discoverrequest" class="tsd-kind-interface">server/discover</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：服务器能力发现<a href="#discoverresult-example-server-capabilities-discovery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="discoverresult-example-server-capabilities-discovery"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"supportedVersions"</span><span class="hl-0">: \[</span><span class="hl-2">"2026-07-28"</span><span class="hl-0">],</span><br /><span class="hl-0">  </span><span class="hl-1">"capabilities"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"tools"</span><span class="hl-0">: \{},</span><br /><span class="hl-0">    </span><span class="hl-1">"resources"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"serverInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleServer"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"instructions"</span><span class="hl-0">: </span><span class="hl-2">"This server provides weather and resource utilities. Prefer \`get\_weather\` for forecast lookups."</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">3600000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#discoverresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 CacheableResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#discoverresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 CacheableResult.resultType</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverresult-supportedversions" data-typedoc-h="3"><span>supportedVersions: string\[]</span><a href="#discoverresult-supportedversions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此服务器支持的 MCP 协议版本。客户端应从此列表中选择一个版本用于后续请求。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverresult-capabilities" data-typedoc-h="3"><span>capabilities: ServerCapabilities</span><a href="#discoverresult-capabilities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器的能力。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverresult-serverinfo" data-typedoc-h="3"><span>serverInfo: Implementation</span><a href="#discoverresult-serverinfo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>关于服务器软件实现的信息。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="discoverresult-instructions" data-typedoc-h="3"><span>instructions?: string</span><a href="#discoverresult-instructions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>描述服务器及其功能的自然语言指导。</p> <p>客户端可使用此信息改进 LLM 对可用工具的理解（例如将其包含在系统提示中）。它应专注于帮助模型有效使用服务器的信息，并且不应重复工具描述中已有的信息。</p> </div></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#discoverresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="discoverresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#discoverresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section>
</div>

<div class="type">
  ### `ClientCapabilities`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ClientCapabilities</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#clientcapabilities-experimental">experimental</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#clientcapabilities-roots">roots</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#clientcapabilities-sampling">sampling</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">context</span><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">tools</span><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#clientcapabilities-elicitation">elicitation</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">form</span><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">url</span><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#clientcapabilities-extensions">extensions</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端可能支持的能力。已知能力在此 schema 中定义，但这不是封闭集合：任何客户端都可以定义自己的附加能力。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="clientcapabilities-experimental" data-typedoc-h="3"><span>experimental?: \{ \[key: string]: JSONObject }</span><a href="#clientcapabilities-experimental" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端支持的实验性非标准能力。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="clientcapabilities-roots" data-typedoc-h="3"><span class="deprecated">roots?: \{}</span><a href="#clientcapabilities-roots" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果客户端支持列出根目录，则存在。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：根目录 — 最低基线支持<a href="#clientcapabilities-example-roots-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-roots-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"roots"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="clientcapabilities-sampling" data-typedoc-h="3"><span class="deprecated">sampling?: \{ context?: JSONObject; tools?: JSONObject }</span><a href="#clientcapabilities-sampling" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果客户端支持从 LLM 采样，则存在。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">context</span><span class="tsd-signature-symbol">?: </span><a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a></div><div class="tsd-comment tsd-typography"><p>客户端是否支持通过 <code>includeContext</code> 参数包含上下文。如果未声明，服务器 SHOULD 只使用 <code>includeContext: "none"</code>（或省略它）。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">tools</span><span class="tsd-signature-symbol">?: </span><a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a></div><div class="tsd-comment tsd-typography"><p>客户端是否支持通过 <code>tools</code> 和 <code>toolChoice</code> 参数使用工具。</p> </div></li></ul></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：采样 — 最低基线支持<a href="#clientcapabilities-example-sampling-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-sampling-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"sampling"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：采样 — 工具使用支持<a href="#clientcapabilities-example-sampling-tool-use-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-sampling-tool-use-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"sampling"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"tools"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：采样 — 上下文包含支持（已弃用）<a href="#clientcapabilities-example-sampling-context-inclusion-support-deprecated" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-sampling-context-inclusion-support-deprecated"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"sampling"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"context"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="clientcapabilities-elicitation" data-typedoc-h="3"><span>elicitation?: \{ form?: JSONObject; url?: JSONObject }</span><a href="#clientcapabilities-elicitation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果客户端支持来自服务器的引出，则存在。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出 — 表单和 URL 模式支持<a href="#clientcapabilities-example-elicitation-form-and-url-mode-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-elicitation-form-and-url-mode-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"elicitation"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"form"</span><span class="hl-0">: \{},</span><br /><span class="hl-0">    </span><span class="hl-1">"url"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：引出 — 仅表单模式（隐式）<a href="#clientcapabilities-example-elicitation-form-mode-only-implicit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-elicitation-form-mode-only-implicit"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"elicitation"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="clientcapabilities-extensions" data-typedoc-h="3"><span>extensions?: \{ \[key: string]: JSONObject }</span><a href="#clientcapabilities-extensions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端支持的可选 MCP 扩展。键是扩展标识符（例如 "io.modelcontextprotocol/oauth-client-credentials"），值是每个扩展的设置对象。空对象表示支持但没有设置。</p> <p>键 MUST 遵循 <a href="#metaobject" class="tsd-kind-type-alias"><code>\_meta</code> 键命名规则</a>，并带有强制前缀。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：扩展 — 带 MIME 类型支持的 MCP Apps（UI）扩展<a href="#clientcapabilities-example-extensions-mcp-apps-ui-extension-with-mime-type-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="clientcapabilities-example-extensions-mcp-apps-ui-extension-with-mime-type-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"extensions"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/ui"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"mimeTypes"</span><span class="hl-0">: \[</span><span class="hl-2">"text/html;profile=mcp-app"</span><span class="hl-0">]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section>
</div>

<div class="type">
  ### `Implementation`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Implementation</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#implementation-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#implementation-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#implementation-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#implementation-version">version</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#implementation-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#implementation-websiteurl">websiteUrl</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>描述 MCP 实现。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="implementation-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#implementation-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 Icons.icons</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="implementation-name" data-typedoc-h="3"><span>name: string</span><a href="#implementation-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="implementation-title" data-typedoc-h="3"><span>title?: string</span><a href="#implementation-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#tool" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="implementation-version" data-typedoc-h="3"><span>version: string</span><a href="#implementation-version" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此实现的版本。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="implementation-description" data-typedoc-h="3"><span>description?: string</span><a href="#implementation-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>对此实现功能的人类可读可选描述。</p> <p>客户端或服务器可使用此信息提供有关其用途和能力的上下文。例如，服务器可描述其提供的资源或工具类型，而客户端可描述其预期用例。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="implementation-websiteurl" data-typedoc-h="3"><span>websiteUrl?: string</span><a href="#implementation-websiteurl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>此实现网站的可选 URL。</p> </div></section>
</div>

<div class="type">
  ### `ServerCapabilities`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ServerCapabilities</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#servercapabilities-experimental">experimental</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-logging">logging</a><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-completions">completions</a><span class="tsd-signature-symbol">?:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-prompts">prompts</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-resources">resources</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">subscribe</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-tools">tools</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#servercapabilities-extensions">extensions</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <a href="#jsonobject" class="tsd-signature-type tsd-kind-type-alias">JSONObject</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器可能支持的能力。已知能力在此 schema 中定义，但这不是封闭集合：任何服务器都可以定义自己的附加能力。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-experimental" data-typedoc-h="3"><span>experimental?: \{ \[key: string]: JSONObject }</span><a href="#servercapabilities-experimental" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器支持的实验性非标准能力。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-logging" data-typedoc-h="3"><span class="deprecated">logging?: JSONObject</span><a href="#servercapabilities-logging" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果服务器支持向客户端发送日志消息，则存在。</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><div class="tsd-anchor-link" data-typedoc-h="4">已弃用</div><p>自协议版本 2026-07-28（SEP-2577）起弃用。将在规范中至少保留十二个月；请参见已弃用功能注册表。</p> </div><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：日志 — 最低基线支持<a href="#servercapabilities-example-logging-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-logging-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"logging"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-completions" data-typedoc-h="3"><span>completions?: JSONObject</span><a href="#servercapabilities-completions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果服务器支持参数自动补全建议，则存在。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：补全 — 最低基线支持<a href="#servercapabilities-example-completions-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-completions-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"completions"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-prompts" data-typedoc-h="3"><span>prompts?: \{ listChanged?: boolean }</span><a href="#servercapabilities-prompts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果服务器提供任何提示模板，则存在。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>此服务器是否支持提示列表更改通知。</p> </div></li></ul></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：提示 — 最低基线支持<a href="#servercapabilities-example-prompts-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-prompts-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"prompts"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：提示 — 列表更改通知<a href="#servercapabilities-example-prompts-list-changed-notifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-prompts-list-changed-notifications"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"prompts"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"listChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-resources" data-typedoc-h="3"><span>resources?: \{ subscribe?: boolean; listChanged?: boolean }</span><a href="#servercapabilities-resources" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果服务器提供任何可读取资源，则存在。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">subscribe</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>此服务器是否支持订阅资源更新。</p> </div></li><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>此服务器是否支持资源列表更改通知。</p> </div></li></ul></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：资源 — 最低基线支持<a href="#servercapabilities-example-resources-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-resources-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resources"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：资源 — 订阅单个资源更新（仅）<a href="#servercapabilities-example-resources-subscription-to-individual-resource-updates-only" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-resources-subscription-to-individual-resource-updates-only"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resources"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"subscribe"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：资源 — 列表更改通知（仅）<a href="#servercapabilities-example-resources-list-changed-notifications-only" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-resources-list-changed-notifications-only"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resources"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"listChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：资源 — 所有通知<a href="#servercapabilities-example-resources-all-notifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-resources-all-notifications"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resources"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"subscribe"</span><span class="hl-0">: </span><span class="hl-5">true</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"listChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-tools" data-typedoc-h="3"><span>tools?: \{ listChanged?: boolean }</span><a href="#servercapabilities-tools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果服务器提供任何可调用工具，则存在。</p> </div><div class="tsd-type-declaration"><div data-typedoc-h="4">Type Declaration</div><ul class="tsd-parameters"><li class="tsd-parameter"><div data-typedoc-h="5"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">listChanged</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>此服务器是否支持工具列表更改通知。</p> </div></li></ul></div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：工具 — 最低基线支持<a href="#servercapabilities-example-tools-minimum-baseline-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-tools-minimum-baseline-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"tools"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：工具 — 列表更改通知<a href="#servercapabilities-example-tools-list-changed-notifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-tools-list-changed-notifications"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"tools"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"listChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="servercapabilities-extensions" data-typedoc-h="3"><span>extensions?: \{ \[key: string]: JSONObject }</span><a href="#servercapabilities-extensions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器支持的可选 MCP 扩展。键是扩展标识符（例如 "io.modelcontextprotocol/tasks"），值是每个扩展的设置对象。空对象表示支持但没有设置。</p> <p>键 MUST 遵循 <a href="#metaobject" class="tsd-kind-type-alias"><code>\_meta</code> 键命名规则</a>，并带有强制前缀。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：扩展 — Tasks 扩展支持<a href="#servercapabilities-example-extensions-tasks-extension-support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="servercapabilities-example-extensions-tasks-extension-support"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"extensions"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/tasks"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div></section>
</div>

## `subscriptions/listen`

<div class="type">
  ### `SubscriptionsListenRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SubscriptionsListenRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"subscriptions/listen"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#subscriptionslistenrequestparams" class="tsd-signature-type tsd-kind-interface">SubscriptionsListenRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送，用于打开一个长生命周期通道，以接收特定请求上下文之外的通知。取代之前的 HTTP GET 端点，并确保 HTTP 与 STDIO 之间行为一致。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：监听工具和资源列表更改<a href="#subscriptionslistenrequest-example-listen-for-tools-and-resource-list-changes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="subscriptionslistenrequest-example-listen-for-tools-and-resource-list-changes"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"listen-1"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"subscriptions/listen"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"notifications"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"toolsListChanged"</span><span class="hl-0">: </span><span class="hl-5">true</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"resourceSubscriptions"</span><span class="hl-0">: \[</span><span class="hl-2">"file:///project/config.json"</span><span class="hl-0">]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="subscriptionslistenrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#subscriptionslistenrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="subscriptionslistenrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#subscriptionslistenrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionslistenrequest-method" data-typedoc-h="3"><span>method: "subscriptions/listen"</span><a href="#subscriptionslistenrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionslistenrequest-params" data-typedoc-h="3"><span>params: SubscriptionsListenRequestParams</span><a href="#subscriptionslistenrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `SubscriptionsListenRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SubscriptionsListenRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionslistenrequestparams-notifications">notifications</a><span class="tsd-signature-symbol">:</span> <a href="#subscriptionfilter" class="tsd-signature-type tsd-kind-interface">SubscriptionFilter</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><a href="#subscriptionslistenrequest" class="tsd-kind-interface">subscriptions/listen</a> 请求的参数。</p> </div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="subscriptionslistenrequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#subscriptionslistenrequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#requestparams">RequestParams</a>.<a href="#requestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionslistenrequestparams-notifications" data-typedoc-h="3"><span>notifications: SubscriptionFilter</span><a href="#subscriptionslistenrequestparams-notifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端在此流上选择接收的通知。服务器 <strong>MUST NOT</strong> 发送客户端未明确请求的通知类型。</p> </div></section>
</div>

<div class="type">
  ### `SubscriptionFilter`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">SubscriptionFilter</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#subscriptionfilter-toolslistchanged">toolsListChanged</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionfilter-promptslistchanged">promptsListChanged</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionfilter-resourceslistchanged">resourcesListChanged</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#subscriptionfilter-resourcesubscriptions">resourceSubscriptions</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端可在 <a href="#subscriptionslistenrequest" class="tsd-kind-interface">subscriptions/listen</a> 请求中选择接收的通知类型集合。</p> <p>每种通知类型都是<strong>选择接收</strong>；服务器 <strong>MUST NOT</strong> 发送客户端未在此明确请求的通知类型。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionfilter-toolslistchanged" data-typedoc-h="3"><span>toolsListChanged?: boolean</span><a href="#subscriptionfilter-toolslistchanged" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，则接收 <a href="#toollistchangednotification" class="tsd-kind-interface">notifications/tools/list\_changed</a>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionfilter-promptslistchanged" data-typedoc-h="3"><span>promptsListChanged?: boolean</span><a href="#subscriptionfilter-promptslistchanged" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，则接收 <a href="#promptlistchangednotification" class="tsd-kind-interface">notifications/prompts/list\_changed</a>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionfilter-resourceslistchanged" data-typedoc-h="3"><span>resourcesListChanged?: boolean</span><a href="#subscriptionfilter-resourceslistchanged" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，则接收 <a href="#resourcelistchangednotification" class="tsd-kind-interface">notifications/resources/list\_changed</a>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="subscriptionfilter-resourcesubscriptions" data-typedoc-h="3"><span>resourceSubscriptions?: string\[]</span><a href="#subscriptionfilter-resourcesubscriptions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>为这些资源 URI 订阅 <a href="#resourceupdatednotification" class="tsd-kind-interface">notifications/resources/updated</a>。取代以前的 <code>resources/subscribe</code> RPC。</p> </div></section>
</div>

## `tools/call`

<div class="type">
  ### `CallToolRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CallToolRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#calltoolrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"tools/call"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#calltoolrequestparams" class="tsd-signature-type tsd-kind-interface">CallToolRequestParams</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端用于调用服务器提供的工具。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：调用工具请求<a href="#calltoolrequest-example-call-tool-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolrequest-example-call-tool-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call-tool-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"tools/call"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"location"</span><span class="hl-0">: </span><span class="hl-2">"New York"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#calltoolrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#calltoolrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolrequest-method" data-typedoc-h="3"><span>method: "tools/call"</span><a href="#calltoolrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-method">method</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolrequest-params" data-typedoc-h="3"><span>params: CallToolRequestParams</span><a href="#calltoolrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcrequest">JSONRPCRequest</a>.<a href="#jsonrpcrequest-params">params</a></p></aside></section>
</div>

<div class="type">
  ### `CallToolRequestParams`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CallToolRequestParams</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#calltoolrequestparams-_meta">\_meta</a><span class="tsd-signature-symbol">:</span> <a href="#requestmetaobject" class="tsd-signature-type tsd-kind-interface">RequestMetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequestparams-inputresponses">inputResponses</a><span class="tsd-signature-symbol">?:</span> <a href="#inputresponses" class="tsd-signature-type tsd-kind-interface">InputResponses</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequestparams-requeststate">requestState</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequestparams-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolrequestparams-arguments">arguments</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p><code>tools/call</code> 请求的参数。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：\`get\_weather\` 工具调用参数<a href="#calltoolrequestparams-example-get_weather-tool-call-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolrequestparams-example-get_weather-tool-call-params"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"location"</span><span class="hl-0">: </span><span class="hl-2">"New York"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带进度令牌的工具调用参数<a href="#calltoolrequestparams-example-tool-call-params-with-progress-token" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolrequestparams-example-tool-call-params-with-progress-token"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{},</span><br /><span class="hl-0">    </span><span class="hl-1">"progressToken"</span><span class="hl-0">: </span><span class="hl-2">"oivaizmir"</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"build\_simulation"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"arguments"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"city"</span><span class="hl-0">: </span><span class="hl-2">"Micropolis"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolrequestparams-_meta" data-typedoc-h="3"><span>\_meta: RequestMetaObject</span><a href="#calltoolrequestparams-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolrequestparams-inputresponses" data-typedoc-h="3"><span>inputResponses?: InputResponses</span><a href="#calltoolrequestparams-inputresponses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-inputresponses">inputResponses</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolrequestparams-requeststate" data-typedoc-h="3"><span>requestState?: string</span><a href="#calltoolrequestparams-requeststate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#inputresponserequestparams">InputResponseRequestParams</a>.<a href="#inputresponserequestparams-requeststate">requestState</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolrequestparams-name" data-typedoc-h="3"><span>name: string</span><a href="#calltoolrequestparams-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具的名称。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolrequestparams-arguments" data-typedoc-h="3"><span>arguments?: \{ \[key: string]: unknown }</span><a href="#calltoolrequestparams-arguments" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于工具调用的参数。</p> </div></section>
</div>

<div class="type">
  ### `CallToolResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CallToolResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#calltoolresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#inputrequiredresult" class="tsd-signature-type tsd-kind-interface">InputRequiredResult</a> <span class="tsd-signature-symbol">|</span> <a href="#calltoolresult" class="tsd-signature-type tsd-kind-interface">CallToolResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#calltoolrequest" class="tsd-kind-interface">tools/call</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：调用工具结果响应<a href="#calltoolresultresponse-example-call-tool-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolresultresponse-example-call-tool-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"call-tool-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Current weather in New York:</span><span class="hl-4">\n</span><span class="hl-2">Temperature: 72°F</span><span class="hl-4">\n</span><span class="hl-2">Conditions: Partly cloudy"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"isError"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#calltoolresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#calltoolresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolresultresponse-result" data-typedoc-h="3"><span>result: InputRequiredResult | CallToolResult</span><a href="#calltoolresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `CallToolResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CallToolResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#calltoolresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresult-content">content</a><span class="tsd-signature-symbol">:</span> <a href="#contentblock" class="tsd-signature-type tsd-kind-type-alias">ContentBlock</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresult-structuredcontent">structuredContent</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#calltoolresult-iserror">isError</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#calltoolrequest" class="tsd-kind-interface">tools/call</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带非结构化文本的结果<a href="#calltoolresult-example-result-with-unstructured-text" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolresult-example-result-with-unstructured-text"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Current weather in New York:</span><span class="hl-4">\n</span><span class="hl-2">Temperature: 72°F</span><span class="hl-4">\n</span><span class="hl-2">Conditions: Partly cloudy"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"isError"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带结构化内容的结果<a href="#calltoolresult-example-result-with-structured-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolresult-example-result-with-structured-content"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"\{</span><span class="hl-4">\\"</span><span class="hl-2">temperature</span><span class="hl-4">\\"</span><span class="hl-2">: 22.5, </span><span class="hl-4">\\"</span><span class="hl-2">conditions</span><span class="hl-4">\\"</span><span class="hl-2">: </span><span class="hl-4">\\"</span><span class="hl-2">Partly cloudy</span><span class="hl-4">\\"</span><span class="hl-2">, </span><span class="hl-4">\\"</span><span class="hl-2">humidity</span><span class="hl-4">\\"</span><span class="hl-2">: 65}"</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"structuredContent"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"temperature"</span><span class="hl-0">: </span><span class="hl-3">22.5</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"conditions"</span><span class="hl-0">: </span><span class="hl-2">"Partly cloudy"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"humidity"</span><span class="hl-0">: </span><span class="hl-3">65</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：无效工具输入错误<a href="#calltoolresult-example-invalid-tool-input-error" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="calltoolresult-example-invalid-tool-input-error"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"content"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"text"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"text"</span><span class="hl-0">: </span><span class="hl-2">"Invalid departure date: must be in the future. Current date is 08/08/2025."</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"isError"</span><span class="hl-0">: </span><span class="hl-5">true</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#calltoolresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-_meta">\_meta</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="calltoolresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#calltoolresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 <a href="#result">Result</a>.<a href="#result-resulttype">resultType</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolresult-content" data-typedoc-h="3"><span>content: ContentBlock\[]</span><a href="#calltoolresult-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示工具调用非结构化结果的内容对象列表。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolresult-structuredcontent" data-typedoc-h="3"><span>structuredContent?: unknown</span><a href="#calltoolresult-structuredcontent" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示工具调用结构化结果的可选 JSON 值。</p> <p>可以是任何 JSON 值（对象、数组、字符串、数字、布尔值或 null），如果定义了工具的 outputSchema，则该值符合它。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="calltoolresult-iserror" data-typedoc-h="3"><span>isError?: boolean</span><a href="#calltoolresult-iserror" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具调用是否以错误结束。</p> <p>如果未设置，则假定为 false（调用成功）。</p> <p>任何源自工具的错误 SHOULD 在结果对象内部报告，并将 <code>isError</code> 设置为 true，<em>不要</em>作为 MCP 协议级错误响应报告。否则，LLM 将无法看到发生了错误并自行纠正。</p> <p>但是，任何<em>查找</em>工具时的错误、表示服务器不支持工具调用的错误，或任何其他异常情况，都应作为 MCP 错误响应报告。</p> </div></section>
</div>

## `tools/list`

<div class="type">
  ### `ListToolsRequest`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListToolsRequest</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listtoolsrequest-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsrequest-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsrequest-params">params</a><span class="tsd-signature-symbol">:</span> <a href="#paginatedrequestparams" class="tsd-signature-type tsd-kind-interface">PaginatedRequestParams</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsrequest-method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"tools/list"</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端发送，用于请求服务器拥有的工具列表。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出工具请求<a href="#listtoolsrequest-example-list-tools-request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listtoolsrequest-example-list-tools-request"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-tools-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"method"</span><span class="hl-0">: </span><span class="hl-2">"tools/list"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"params"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\_meta"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/protocolVersion"</span><span class="hl-0">: </span><span class="hl-2">"2026-07-28"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientInfo"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"ExampleClient"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"version"</span><span class="hl-0">: </span><span class="hl-2">"1.0.0"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"io.modelcontextprotocol/clientCapabilities"</span><span class="hl-0">: \{}</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsrequest-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listtoolsrequest-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.jsonrpc</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsrequest-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listtoolsrequest-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.id</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsrequest-params" data-typedoc-h="3"><span>params: PaginatedRequestParams</span><a href="#listtoolsrequest-params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedRequest.params</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listtoolsrequest-method" data-typedoc-h="3"><span>method: "tools/list"</span><a href="#listtoolsrequest-method" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 PaginatedRequest.method</p></aside></section>
</div>

<div class="type">
  ### `ListToolsResultResponse`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListToolsResultResponse</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listtoolsresultresponse-jsonrpc">jsonrpc</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"2.0"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresultresponse-id">id</a><span class="tsd-signature-symbol">:</span> <a href="#requestid" class="tsd-signature-type tsd-kind-type-alias">RequestId</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresultresponse-result">result</a><span class="tsd-signature-symbol">:</span> <a href="#listtoolsresult" class="tsd-signature-type tsd-kind-interface">ListToolsResult</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listtoolsrequest" class="tsd-kind-interface">tools/list</a> 请求返回的成功响应。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：列出工具结果响应<a href="#listtoolsresultresponse-example-list-tools-result-response" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listtoolsresultresponse-example-list-tools-result-response"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"jsonrpc"</span><span class="hl-0">: </span><span class="hl-2">"2.0"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"id"</span><span class="hl-0">: </span><span class="hl-2">"list-tools-example"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"result"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"tools"</span><span class="hl-0">: \[</span><br /><span class="hl-0">      \{</span><br /><span class="hl-0">        </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Weather Information Provider"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Get current weather information for a location"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"location"</span><span class="hl-0">: \{</span><br /><span class="hl-0">              </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">              </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"City name or zip code"</span><br /><span class="hl-0">            }</span><br /><span class="hl-0">          },</span><br /><span class="hl-0">          </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"location"</span><span class="hl-0">]</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">          \{</span><br /><span class="hl-0">            </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/weather-icon.png](https://example.com/weather-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        ]</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    ],</span><br /><span class="hl-0">    </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"next-page-cursor"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">3600000</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresultresponse-jsonrpc" data-typedoc-h="3"><span>jsonrpc: "2.0"</span><a href="#listtoolsresultresponse-jsonrpc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-jsonrpc">jsonrpc</a></p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresultresponse-id" data-typedoc-h="3"><span>id: RequestId</span><a href="#listtoolsresultresponse-id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-id">id</a></p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listtoolsresultresponse-result" data-typedoc-h="3"><span>result: ListToolsResult</span><a href="#listtoolsresultresponse-result" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>重写 <a href="#jsonrpcresultresponse">JSONRPCResultResponse</a>.<a href="#jsonrpcresultresponse-result">result</a></p></aside></section>
</div>

<div class="type">
  ### `ListToolsResult`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ListToolsResult</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-resulttype">resultType</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-nextcursor">nextCursor</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-ttlms">ttlMs</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-cachescope">cacheScope</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"public"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"private"</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#listtoolsresult-tools">tools</a><span class="tsd-signature-symbol">:</span> <a href="#tool" class="tsd-signature-type tsd-kind-interface">Tool</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>服务器针对 <a href="#listtoolsrequest" class="tsd-kind-interface">tools/list</a> 请求返回的结果。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带游标和 TTL 的工具列表<a href="#listtoolsresult-example-tools-list-with-cursor-and-ttl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="listtoolsresult-example-tools-list-with-cursor-and-ttl"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"resultType"</span><span class="hl-0">: </span><span class="hl-2">"complete"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"tools"</span><span class="hl-0">: \[</span><br /><span class="hl-0">    \{</span><br /><span class="hl-0">      </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Weather Information Provider"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Get current weather information for a location"</span><span class="hl-0">,</span><br /><span class="hl-0">      </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">          </span><span class="hl-1">"location"</span><span class="hl-0">: \{</span><br /><span class="hl-0">            </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">            </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"City name or zip code"</span><br /><span class="hl-0">          }</span><br /><span class="hl-0">        },</span><br /><span class="hl-0">        </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"location"</span><span class="hl-0">]</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"icons"</span><span class="hl-0">: \[</span><br /><span class="hl-0">        \{</span><br /><span class="hl-0">          </span><span class="hl-1">"src"</span><span class="hl-0">: </span><span class="hl-2">"[https://example.com/weather-icon.png](https://example.com/weather-icon.png)"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"mimeType"</span><span class="hl-0">: </span><span class="hl-2">"image/png"</span><span class="hl-0">,</span><br /><span class="hl-0">          </span><span class="hl-1">"sizes"</span><span class="hl-0">: \[</span><span class="hl-2">"48x48"</span><span class="hl-0">]</span><br /><span class="hl-0">        }</span><br /><span class="hl-0">      ]</span><br /><span class="hl-0">    }</span><br /><span class="hl-0">  ],</span><br /><span class="hl-0">  </span><span class="hl-1">"nextCursor"</span><span class="hl-0">: </span><span class="hl-2">"next-page-cursor"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"ttlMs"</span><span class="hl-0">: </span><span class="hl-3">300000</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"cacheScope"</span><span class="hl-0">: </span><span class="hl-2">"public"</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresult-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#listtoolsresult-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><aside class="tsd-sources"><p>继承自 PaginatedResult.\_meta</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresult-resulttype" data-typedoc-h="3"><span>resultType: string</span><a href="#listtoolsresult-resulttype" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示结果的类型，使客户端能够确定如何解析结果对象。</p> <p>实现此协议版本的服务器 MUST 包含此字段。为了向后兼容，当客户端从实现较早协议版本的服务器收到结果（其中不包含 <code>resultType</code>）时，客户端 MUST 将缺失字段视为 <code>"complete"</code>。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.resultType</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresult-nextcursor" data-typedoc-h="3"><span>nextCursor?: string</span><a href="#listtoolsresult-nextcursor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示最后一个返回结果之后分页位置的不透明令牌。如果存在，可能还有更多结果可用。</p> </div><aside class="tsd-sources"><p>继承自 PaginatedResult.nextCursor</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresult-ttlms" data-typedoc-h="3"><span>ttlMs: number</span><a href="#listtoolsresult-ttlms" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>服务器提供的提示，表示客户端在重新获取前 MAY 缓存此响应多长时间（以毫秒为单位）。语义类似于 HTTP Cache-Control max-age。</p> <ul> <li>如果为 0，响应 SHOULD 被视为立即过期；客户端 MAY 在每次需要结果时重新获取。</li> <li>如果为正数，客户端 SHOULD 在收到响应后的这么多毫秒内将结果视为新鲜。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.ttlMs</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="listtoolsresult-cachescope" data-typedoc-h="3"><span>cacheScope: "public" | "private"</span><a href="#listtoolsresult-cachescope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>表示缓存响应的预期范围，类似于 HTTP <code>Cache-Control: public</code> 与 <code>Cache-Control: private</code>。</p> <ul> <li><code>"public"</code>：任何客户端或中介（例如共享网关、代理）MAY 缓存响应并将其提供给任何用户。</li> <li><code>"private"</code>：只有发出请求用户的客户端 MAY 缓存响应。共享缓存（例如多租户网关）MUST NOT 将缓存副本提供给其他用户。</li> </ul> </div><aside class="tsd-sources"><p>继承自 CacheableResult.cacheScope</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="listtoolsresult-tools" data-typedoc-h="3"><span>tools: Tool\[]</span><a href="#listtoolsresult-tools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `Tool`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">Tool</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#tool-icons">icons</a><span class="tsd-signature-symbol">?:</span> <a href="#icon" class="tsd-signature-type tsd-kind-interface">Icon</a><span class="tsd-signature-symbol">\[]</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-name">name</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-description">description</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-inputschema">inputSchema</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">\$schema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"object"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-outputschema">outputSchema</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">\{</span> <span class="tsd-kind-property">\$schema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-signature-symbol">\[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">unknown</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-annotations">annotations</a><span class="tsd-signature-symbol">?:</span> <a href="#toolannotations" class="tsd-signature-type tsd-kind-interface">ToolAnnotations</a><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#tool-_meta">\_meta</a><span class="tsd-signature-symbol">?:</span> <a href="#metaobject" class="tsd-signature-type tsd-kind-type-alias">MetaObject</a><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>客户端可调用工具的定义。</p> </div><div class="tsd-comment tsd-typography"><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带默认 2020-12 输入 schema<a href="#tool-example-with-default-2020-12-input-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="tool-example-with-default-2020-12-input-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"calculate\_sum"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Add two numbers"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"a"</span><span class="hl-0">: \{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0"> },</span><br /><span class="hl-0">      </span><span class="hl-1">"b"</span><span class="hl-0">: \{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0"> }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"a"</span><span class="hl-0">, </span><span class="hl-2">"b"</span><span class="hl-0">]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带显式 draft-07 输入 schema<a href="#tool-example-with-explicit-draft-07-input-schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="tool-example-with-explicit-draft-07-input-schema"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"calculate\_sum"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Add two numbers"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"\$schema"</span><span class="hl-0">: </span><span class="hl-2">"[http://json-schema.org/draft-07/schema#](http://json-schema.org/draft-07/schema#)"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"a"</span><span class="hl-0">: \{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0"> },</span><br /><span class="hl-0">      </span><span class="hl-1">"b"</span><span class="hl-0">: \{ </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0"> }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"a"</span><span class="hl-0">, </span><span class="hl-2">"b"</span><span class="hl-0">]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：无参数<a href="#tool-example-with-no-parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="tool-example-with-no-parameters"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_current\_time"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Returns the current server time"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"additionalProperties"</span><span class="hl-0">: </span><span class="hl-5">false</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details><details class="tsd-tag-example"><summary class="tsd-anchor-link">示例：带结构化内容输出 schema<a href="#tool-example-with-output-schema-for-structured-content" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></summary><pre id="tool-example-with-output-schema-for-structured-content"><code class="json"><span class="hl-0">\{</span><br /><span class="hl-0">  </span><span class="hl-1">"name"</span><span class="hl-0">: </span><span class="hl-2">"get\_weather\_data"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"title"</span><span class="hl-0">: </span><span class="hl-2">"Weather Data Retriever"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Get current weather data for a location"</span><span class="hl-0">,</span><br /><span class="hl-0">  </span><span class="hl-1">"inputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"location"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"City name or zip code"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"location"</span><span class="hl-0">]</span><br /><span class="hl-0">  },</span><br /><span class="hl-0">  </span><span class="hl-1">"outputSchema"</span><span class="hl-0">: \{</span><br /><span class="hl-0">    </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"object"</span><span class="hl-0">,</span><br /><span class="hl-0">    </span><span class="hl-1">"properties"</span><span class="hl-0">: \{</span><br /><span class="hl-0">      </span><span class="hl-1">"temperature"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Temperature in celsius"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"conditions"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"string"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Weather conditions description"</span><br /><span class="hl-0">      },</span><br /><span class="hl-0">      </span><span class="hl-1">"humidity"</span><span class="hl-0">: \{</span><br /><span class="hl-0">        </span><span class="hl-1">"type"</span><span class="hl-0">: </span><span class="hl-2">"number"</span><span class="hl-0">,</span><br /><span class="hl-0">        </span><span class="hl-1">"description"</span><span class="hl-0">: </span><span class="hl-2">"Humidity percentage"</span><br /><span class="hl-0">      }</span><br /><span class="hl-0">    },</span><br /><span class="hl-0">    </span><span class="hl-1">"required"</span><span class="hl-0">: \[</span><span class="hl-2">"temperature"</span><span class="hl-0">, </span><span class="hl-2">"conditions"</span><span class="hl-0">, </span><span class="hl-2">"humidity"</span><span class="hl-0">]</span><br /><span class="hl-0">  }</span><br /><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> </details></div><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="tool-icons" data-typedoc-h="3"><span>icons?: Icon\[]</span><a href="#tool-icons" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>客户端可在用户界面中显示的一组带尺寸图标，可选。</p> <p>支持渲染图标的客户端 MUST 至少支持以下 MIME 类型：</p> <ul> <li><code>image/png</code> - PNG 图像（安全，通用兼容）</li> <li><code>image/jpeg</code>（以及 <code>image/jpg</code>）- JPEG 图像（安全，通用兼容）</li> </ul> <p>支持渲染图标的客户端 SHOULD 也支持：</p> <ul> <li><code>image/svg+xml</code> - SVG 图像（可缩放但需要安全预防措施）</li> <li><code>image/webp</code> - WebP 图像（现代、高效格式）</li> </ul> </div><aside class="tsd-sources"><p>继承自 Icons.icons</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="tool-name" data-typedoc-h="3"><span>name: string</span><a href="#tool-name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于程序化或逻辑用途，但在以往规范或回退场景中（如果 title 不存在）也用作显示名称。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.name</p></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><div class="tsd-anchor-link" id="tool-title" data-typedoc-h="3"><span>title?: string</span><a href="#tool-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>用于 UI 和最终用户上下文——优化为人类可读且易于理解，即使读者不熟悉特定领域术语。</p> <p>如果未提供，应使用 name 进行显示（但对于 <a href="#" class="tsd-kind-interface">Tool</a>，如果存在 <code>annotations.title</code>，则应优先于 <code>name</code> 使用）。</p> </div><aside class="tsd-sources"><p>继承自 BaseMetadata.title</p></aside></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="tool-description" data-typedoc-h="3"><span>description?: string</span><a href="#tool-description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具的人类可读描述。</p> <p>客户端可使用此信息改进 LLM 对可用工具的理解。可将其视为给模型的“提示”。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="tool-inputschema" data-typedoc-h="3"><span>inputSchema: \{ \$schema?: string; type: "object"; \[key: string]: unknown }</span><a href="#tool-inputschema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>定义工具预期参数的 JSON Schema 对象。</p> <p>工具参数始终是 JSON 对象，因此根级别需要 <code>type: "object"</code>。除此之外，任何 JSON Schema 2020-12 关键字都可以与 <code>type</code> 一起出现——包括组合关键字（<code>oneOf</code>、<code>anyOf</code>、<code>allOf</code>、<code>not</code>）、条件关键字（<code>if</code>/<code>then</code>/<code>else</code>）、引用关键字（<code>\$ref</code>、<code>\$defs</code>、<code>\$anchor</code>），以及任何其他标准验证或注释关键字。</p> <p>当未提供显式 <code>\$schema</code> 时，默认为 JSON Schema 2020-12。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="tool-outputschema" data-typedoc-h="3"><span>outputSchema?: \{ \$schema?: string; \[key: string]: unknown }</span><a href="#tool-outputschema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选的 JSON Schema 对象，定义在 <a href="#calltoolresult" class="tsd-kind-interface">CallToolResult</a> 的 structuredContent 字段中返回的工具输出结构。它可以是任何有效的 JSON Schema 2020-12。</p> <p>当未提供显式 <code>\$schema</code> 时，默认为 JSON Schema 2020-12。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="tool-annotations" data-typedoc-h="3"><span>annotations?: ToolAnnotations</span><a href="#tool-annotations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>可选的附加工具信息。</p> <p>显示名称优先级顺序为：<code>title</code>、<code>annotations.title</code>，然后是 <code>name</code>。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="tool-_meta" data-typedoc-h="3"><span>\_meta?: MetaObject</span><a href="#tool-_meta" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div></section>
</div>

<div class="type">
  ### `ToolAnnotations`

  <div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">ToolAnnotations</span> <span class="tsd-signature-symbol">\{</span><br />  <a class="tsd-kind-property" href="#toolannotations-title">title</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolannotations-readonlyhint">readOnlyHint</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolannotations-destructivehint">destructiveHint</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolannotations-idempotenthint">idempotentHint</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br />  <a class="tsd-kind-property" href="#toolannotations-openworldhint">openWorldHint</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br /><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>向客户端描述 <a href="#tool" class="tsd-kind-interface">Tool</a> 的附加属性。</p> <p>注意：<code>ToolAnnotations</code> 中的所有属性都是<strong>提示</strong>。它们不保证能忠实描述工具行为（包括 <code>title</code> 这类描述性属性）。</p> <p>客户端绝不应根据从不受信任服务器收到的 <code>ToolAnnotations</code> 做出工具使用决策。</p> </div><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolannotations-title" data-typedoc-h="3"><span>title?: string</span><a href="#toolannotations-title" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>工具的人类可读标题。</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolannotations-readonlyhint" data-typedoc-h="3"><span>readOnlyHint?: boolean</span><a href="#toolannotations-readonlyhint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，该工具不会修改其环境。</p> <p>默认值：false</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolannotations-destructivehint" data-typedoc-h="3"><span>destructiveHint?: boolean</span><a href="#toolannotations-destructivehint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，该工具可能对其环境执行破坏性更新。如果为 false，该工具仅执行增量更新。</p> <p>（仅当 <code>readOnlyHint == false</code> 时，此属性才有意义）</p> <p>默认值：true</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolannotations-idempotenthint" data-typedoc-h="3"><span>idempotentHint?: boolean</span><a href="#toolannotations-idempotenthint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，使用相同参数重复调用该工具不会对其环境产生额外影响。</p> <p>（仅当 <code>readOnlyHint == false</code> 时，此属性才有意义）</p> <p>默认值：false</p> </div></section><section class="tsd-panel tsd-member"><div class="tsd-anchor-link" id="toolannotations-openworldhint" data-typedoc-h="3"><span>openWorldHint?: boolean</span><a href="#toolannotations-openworldhint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor" /></svg></a></div><div class="tsd-comment tsd-typography"><p>如果为 true，此工具可能与外部实体的“开放世界”交互。如果为 false，工具的交互域是封闭的。例如，Web 搜索工具的世界是开放的，而内存工具的世界不是。</p> <p>默认值：true</p> </div></section>
</div>
