Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ Client-side: Handle elicitation requests
```typescript
// This is a placeholder - implement based on your UI framework
async function getInputFromUser(message: string, schema: any): Promise<{
action: "accept" | "decline" | "cancel";
action: "accept" | "reject" | "cancel";
data?: Record<string, any>;
}> {
// This should be implemented depending on the app
Expand Down
8 changes: 4 additions & 4 deletions src/examples/client/simpleStreamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ async function connect(url?: string): Promise<void> {
continue;
} else {
console.log('Maximum attempts reached. Declining request.');
return { action: 'decline' };
return { action: 'reject' };
}
}

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

Expand All @@ -408,13 +408,13 @@ async function connect(url?: string): Promise<void> {
console.log('Please re-enter the information...');
continue;
} else {
return { action: 'decline' };
return { action: 'reject' };
}
}
}

console.log('Maximum attempts reached. Declining request.');
return { action: 'decline' };
return { action: 'reject' };
});

transport = new StreamableHTTPClientTransport(
Expand Down
6 changes: 3 additions & 3 deletions src/examples/server/simpleStreamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ const getServer = () => {
},
],
};
} else if (result.action === 'decline') {
} else if (result.action === 'reject') {
return {
content: [
{
type: 'text',
text: `No information was collected. User declined to provide ${infoType} information.`,
text: `No information was collected. User rejectd to provide ${infoType} information.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

maybe "User rejected ${infoType} information request."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find/replace technique is not perfect 😬

Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's reasonable to blame Claude in all such situations

},
],
};
Expand Down Expand Up @@ -458,7 +458,7 @@ if (useOAuth) {
}

const data = await response.json();

if (strictOAuth) {
if (!data.aud) {
throw new Error(`Resource Indicator (RFC8707) missing`);
Expand Down
10 changes: 5 additions & 5 deletions src/server/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ test("should reject elicitation response with invalid data", async () => {
).rejects.toThrow(/does not match requested schema/);
});

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

const client = new Client(
{
name: "test client",
name: "test client",
version: "1.0",
},
{
Expand All @@ -538,7 +538,7 @@ test("should allow elicitation decline and cancel without validation", async ()
client.setRequestHandler(ElicitRequestSchema, (request) => {
requestCount++;
if (requestCount === 1) {
return { action: "decline" };
return { action: "reject" };
} else {
return { action: "cancel" };
}
Expand All @@ -559,14 +559,14 @@ test("should allow elicitation decline and cancel without validation", async ()
required: ["name"],
};

// Test decline - should not validate
// Test reject - should not validate
await expect(
server.elicitInput({
message: "Please provide your name",
requestedSchema: schema,
}),
).resolves.toEqual({
action: "decline",
action: "reject",
});

// Test cancel - should not validate
Expand Down
2 changes: 1 addition & 1 deletion src/server/mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4157,7 +4157,7 @@ describe("elicitInput()", () => {
// Mock availability check to return false
checkAvailability.mockResolvedValue(false);

// Set up client to decline alternative date checking
// Set up client to reject alternative date checking
client.setRequestHandler(ElicitRequestSchema, async () => {
return {
action: "accept",
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ export const ElicitResultSchema = ResultSchema.extend({
/**
* The user's response action.
*/
action: z.enum(["accept", "decline", "cancel"]),
action: z.enum(["accept", "reject", "cancel"]),
/**
* The collected user input content (only present if action is "accept").
*/
Expand Down