Skip to content

Commit fb303d7

Browse files
committed
tidying up
1 parent 08808a4 commit fb303d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/examples/server/mcpServerOutputSchema.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ server.registerTool(
4343
void country;
4444
// Simulate weather API call
4545
const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10;
46-
const conditions = ["sunny", "cloudy", "rainy", "stormy", "snowy"][Math.floor(Math.random() * 5)] as unknown as "sunny" | "cloudy" | "rainy" | "stormy" | "snowy";
46+
const conditionCandidates = [
47+
"sunny",
48+
"cloudy",
49+
"rainy",
50+
"stormy",
51+
"snowy",
52+
] as const;
53+
const conditions = conditionCandidates[Math.floor(Math.random() * conditionCandidates.length)];
4754

4855
const structuredContent = {
4956
temperature: {

0 commit comments

Comments
 (0)