Skip to content

Commit 00a631c

Browse files
authored
Merge pull request #657 from modelcontextprotocol/ihrpr/decline-reject
rename decline to reject
2 parents 90569d8 + 2f9530b commit 00a631c

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ Client-side: Handle elicitation requests
930930
```typescript
931931
// This is a placeholder - implement based on your UI framework
932932
async function getInputFromUser(message: string, schema: any): Promise<{
933-
action: "accept" | "decline" | "cancel";
933+
action: "accept" | "reject" | "cancel";
934934
data?: Record<string, any>;
935935
}> {
936936
// This should be implemented depending on the app

src/examples/client/simpleStreamableHttp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ async function connect(url?: string): Promise<void> {
363363
continue;
364364
} else {
365365
console.log('Maximum attempts reached. Declining request.');
366-
return { action: 'decline' };
366+
return { action: 'reject' };
367367
}
368368
}
369369

@@ -381,7 +381,7 @@ async function connect(url?: string): Promise<void> {
381381
continue;
382382
} else {
383383
console.log('Maximum attempts reached. Declining request.');
384-
return { action: 'decline' };
384+
return { action: 'reject' };
385385
}
386386
}
387387

@@ -408,13 +408,13 @@ async function connect(url?: string): Promise<void> {
408408
console.log('Please re-enter the information...');
409409
continue;
410410
} else {
411-
return { action: 'decline' };
411+
return { action: 'reject' };
412412
}
413413
}
414414
}
415415

416416
console.log('Maximum attempts reached. Declining request.');
417-
return { action: 'decline' };
417+
return { action: 'reject' };
418418
});
419419

420420
transport = new StreamableHTTPClientTransport(

src/examples/server/simpleStreamableHttp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ const getServer = () => {
205205
},
206206
],
207207
};
208-
} else if (result.action === 'decline') {
208+
} else if (result.action === 'reject') {
209209
return {
210210
content: [
211211
{
212212
type: 'text',
213-
text: `No information was collected. User declined to provide ${infoType} information.`,
213+
text: `No information was collected. User rejected ${infoType} information request.`,
214214
},
215215
],
216216
};
@@ -458,7 +458,7 @@ if (useOAuth) {
458458
}
459459

460460
const data = await response.json();
461-
461+
462462
if (strictOAuth) {
463463
if (!data.aud) {
464464
throw new Error(`Resource Indicator (RFC8707) missing`);

src/server/index.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ test("should reject elicitation response with invalid data", async () => {
505505
).rejects.toThrow(/does not match requested schema/);
506506
});
507507

508-
test("should allow elicitation decline and cancel without validation", async () => {
508+
test("should allow elicitation reject and cancel without validation", async () => {
509509
const server = new Server(
510510
{
511511
name: "test server",
@@ -524,7 +524,7 @@ test("should allow elicitation decline and cancel without validation", async ()
524524

525525
const client = new Client(
526526
{
527-
name: "test client",
527+
name: "test client",
528528
version: "1.0",
529529
},
530530
{
@@ -538,7 +538,7 @@ test("should allow elicitation decline and cancel without validation", async ()
538538
client.setRequestHandler(ElicitRequestSchema, (request) => {
539539
requestCount++;
540540
if (requestCount === 1) {
541-
return { action: "decline" };
541+
return { action: "reject" };
542542
} else {
543543
return { action: "cancel" };
544544
}
@@ -559,14 +559,14 @@ test("should allow elicitation decline and cancel without validation", async ()
559559
required: ["name"],
560560
};
561561

562-
// Test decline - should not validate
562+
// Test reject - should not validate
563563
await expect(
564564
server.elicitInput({
565565
message: "Please provide your name",
566566
requestedSchema: schema,
567567
}),
568568
).resolves.toEqual({
569-
action: "decline",
569+
action: "reject",
570570
});
571571

572572
// Test cancel - should not validate

src/server/mcp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4157,7 +4157,7 @@ describe("elicitInput()", () => {
41574157
// Mock availability check to return false
41584158
checkAvailability.mockResolvedValue(false);
41594159

4160-
// Set up client to decline alternative date checking
4160+
// Set up client to reject alternative date checking
41614161
client.setRequestHandler(ElicitRequestSchema, async () => {
41624162
return {
41634163
action: "accept",

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ export const ElicitResultSchema = ResultSchema.extend({
12371237
/**
12381238
* The user's response action.
12391239
*/
1240-
action: z.enum(["accept", "decline", "cancel"]),
1240+
action: z.enum(["accept", "reject", "cancel"]),
12411241
/**
12421242
* The collected user input content (only present if action is "accept").
12431243
*/

0 commit comments

Comments
 (0)