Skip to content
Merged
Changes from all commits
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
20 changes: 10 additions & 10 deletions examples/servers/typescript/everything-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ function createMcpServer() {
prompt: z.string().describe('The prompt to send to the LLM')
}
},
async (args: { prompt: string }) => {
async (args: { prompt: string }, { sendRequest }) => {
try {
// Request sampling from client
const result = await mcpServer.server.request(
// Request sampling from client on the tool call's stream
const result = await sendRequest(
{
method: 'sampling/createMessage',
params: {
Expand Down Expand Up @@ -599,10 +599,10 @@ function createMcpServer() {
message: z.string().describe('The message to show the user')
}
},
async (args: { message: string }) => {
async (args: { message: string }, { sendRequest }) => {
try {
// Request user input from client
const result = await mcpServer.server.request(
// Request user input from client on the tool call's stream
const result = await sendRequest(
{
method: 'elicitation/create',
params: {
Expand Down Expand Up @@ -651,10 +651,10 @@ function createMcpServer() {
description: 'Tests elicitation with default values per SEP-1034',
inputSchema: {}
},
async () => {
async (_args, { sendRequest }) => {
try {
// Request user input with default values for all primitive types
const result = await mcpServer.server.request(
const result = await sendRequest(
{
method: 'elicitation/create',
params: {
Expand Down Expand Up @@ -726,10 +726,10 @@ function createMcpServer() {
'Tests elicitation with enum schema improvements per SEP-1330',
inputSchema: {}
},
async () => {
async (_args, { sendRequest }) => {
try {
// Request user input with all 5 enum schema variants
const result = await mcpServer.server.request(
const result = await sendRequest(
{
method: 'elicitation/create',
params: {
Expand Down
Loading