Skip to content

Commit 7d5765e

Browse files
committed
Update types.ts
1 parent b3f42da commit 7d5765e

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/types.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ export const ClientCapabilitiesSchema = z.object({
285285
sampling: z
286286
.object({
287287
/**
288-
* Present if the client supports non-'none' values for includeContext parameter.
288+
* Present if the client supports context inclusion via includeContext parameter.
289+
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
289290
*/
290291
context: AssertObjectSchema.optional(),
291292
/**
292-
* Present if the client supports tools and tool_choice parameters in sampling requests.
293-
* Presence indicates full tool calling support.
293+
* Present if the client supports tool use via tools and toolChoice parameters.
294294
*/
295295
tools: AssertObjectSchema.optional(),
296296
})
@@ -1265,8 +1265,11 @@ export const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
12651265
*/
12661266
systemPrompt: z.string().optional(),
12671267
/**
1268-
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
1269-
* Values different from 'none' require clientCapabilities.sampling.context
1268+
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
1269+
* The client MAY ignore this request.
1270+
*
1271+
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
1272+
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
12701273
*/
12711274
includeContext: z.enum(['none', 'thisServer', 'allServers']).optional(),
12721275
temperature: z.number().optional(),
@@ -1282,13 +1285,14 @@ export const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
12821285
*/
12831286
metadata: AssertObjectSchema.optional(),
12841287
/**
1285-
* Tool definitions for the LLM to use.
1286-
* Requires clientCapabilities.sampling.tools.
1288+
* Tools that the model may use during generation.
1289+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
12871290
*/
12881291
tools: z.optional(z.array(ToolSchema)),
12891292
/**
1290-
* Controls tool usage behavior.
1291-
* Requires clientCapabilities.sampling.tools and tools parameter.
1293+
* Controls how the model uses tools.
1294+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
1295+
* Default is `{ mode: "auto" }`.
12921296
*/
12931297
toolChoice: z.optional(ToolChoiceSchema),
12941298
});
@@ -1309,12 +1313,15 @@ export const CreateMessageResultSchema = ResultSchema.extend({
13091313
*/
13101314
model: z.string(),
13111315
/**
1312-
* The reason why sampling stopped.
1316+
* The reason why sampling stopped, if known.
1317+
*
13131318
* Standard values:
13141319
* - "endTurn": Natural end of the assistant's turn
13151320
* - "stopSequence": A stop sequence was encountered
13161321
* - "maxTokens": Maximum token limit was reached
13171322
* - "toolUse": The model wants to use one or more tools
1323+
*
1324+
* This field is an open string to allow for provider-specific stop reasons.
13181325
*/
13191326
stopReason: z.optional(
13201327
z.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z.string()),

0 commit comments

Comments
 (0)