feat(tools): add get_random_words_from_list tool
This commit is contained in:
@@ -33,4 +33,19 @@ export const addRandomWordsTool = (server: McpServer) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
server.registerTool(
|
||||||
|
"get_random_words_from_list",
|
||||||
|
{
|
||||||
|
title: "Get Random Word From List",
|
||||||
|
description: "Get a list of random words from a list of words.",
|
||||||
|
inputSchema: z.object({
|
||||||
|
words: z.array(z.string()),
|
||||||
|
count: z.number().optional().default(1)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async (input) => {
|
||||||
|
return { content: [{ type: "text", text: getRandomWords(input.words, input.count).join("\n") }] }
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user