Skip to content

Commit 8531d8e

Browse files
committed
chore: use default instead of "prefault"
1 parent 2010203 commit 8531d8e

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/examples/server/simpleSseServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const getServer = () => {
2525
'start-notification-stream',
2626
'Starts sending periodic notifications',
2727
{
28-
interval: z.number().describe('Interval in milliseconds between notifications').prefault(1000),
29-
count: z.number().describe('Number of notifications to send').prefault(10),
28+
interval: z.number().describe('Interval in milliseconds between notifications').default(1000),
29+
count: z.number().describe('Number of notifications to send').default(10),
3030
},
3131
async ({ interval, count }, { sendNotification }): Promise<CallToolResult> => {
3232
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

src/examples/server/simpleStatelessStreamableHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const getServer = () => {
3939
'start-notification-stream',
4040
'Starts sending periodic notifications for testing resumability',
4141
{
42-
interval: z.number().describe('Interval in milliseconds between notifications').prefault(100),
43-
count: z.number().describe('Number of notifications to send (0 for 100)').prefault(10),
42+
interval: z.number().describe('Interval in milliseconds between notifications').default(100),
43+
count: z.number().describe('Number of notifications to send (0 for 100)').default(10),
4444
},
4545
async ({ interval, count }, { sendNotification }): Promise<CallToolResult> => {
4646
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

src/examples/server/simpleStreamableHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ const getServer = () => {
270270
'start-notification-stream',
271271
'Starts sending periodic notifications for testing resumability',
272272
{
273-
interval: z.number().describe('Interval in milliseconds between notifications').prefault(100),
274-
count: z.number().describe('Number of notifications to send (0 for 100)').prefault(50),
273+
interval: z.number().describe('Interval in milliseconds between notifications').default(100),
274+
count: z.number().describe('Number of notifications to send (0 for 100)').default(50),
275275
},
276276
async ({ interval, count }, { sendNotification }): Promise<CallToolResult> => {
277277
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

src/examples/server/sseAndStreamableHttpCompatibleServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const getServer = () => {
3030
'start-notification-stream',
3131
'Starts sending periodic notifications for testing resumability',
3232
{
33-
interval: z.number().describe('Interval in milliseconds between notifications').prefault(100),
34-
count: z.number().describe('Number of notifications to send (0 for 100)').prefault(50),
33+
interval: z.number().describe('Interval in milliseconds between notifications').default(100),
34+
count: z.number().describe('Number of notifications to send (0 for 100)').default(50),
3535
},
3636
async ({ interval, count }, { sendNotification }): Promise<CallToolResult> => {
3737
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

src/integration-tests/stateManagementStreamableHttp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('Streamable HTTP Transport Session Management', () => {
5555
'greet',
5656
'A simple greeting tool',
5757
{
58-
name: z.string().describe('Name to greet').prefault('World'),
58+
name: z.string().describe('Name to greet').default('World'),
5959
},
6060
async ({ name }) => {
6161
return {

src/integration-tests/taskResumability.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Transport resumability', () => {
3333
'send-notification',
3434
'Sends a single notification',
3535
{
36-
message: z.string().describe('Message to send').prefault('Test notification')
36+
message: z.string().describe('Message to send').default('Test notification')
3737
},
3838
async ({ message }, { sendNotification }) => {
3939
// Send notification immediately
@@ -56,8 +56,8 @@ describe('Transport resumability', () => {
5656
'run-notifications',
5757
'Sends multiple notifications over time',
5858
{
59-
count: z.number().describe('Number of notifications to send').prefault(10),
60-
interval: z.number().describe('Interval between notifications in ms').prefault(50)
59+
count: z.number().describe('Number of notifications to send').default(10),
60+
interval: z.number().describe('Interval between notifications in ms').default(50)
6161
},
6262
async ({ count, interval }, { sendNotification }) => {
6363
// Send notifications at specified intervals

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ export const CallToolResultSchema = ResultSchema.extend({
916916
* If the Tool does not define an outputSchema, this field MUST be present in the result.
917917
* For backwards compatibility, this field is always present, but it may be empty.
918918
*/
919-
content: z.array(ContentBlockSchema).prefault([]),
919+
content: z.array(ContentBlockSchema).default([]),
920920

921921
/**
922922
* An object containing structured tool output.

0 commit comments

Comments
 (0)