Skip to content

Commit 3887a57

Browse files
committed
update tool response to be compliant with spec
1 parent f02570c commit 3887a57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/first-server/typescript.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,18 @@ This guide uses the OpenWeatherMap API. You'll need a free API key from [OpenWea
342342
}
343343

344344
return {
345-
content: {
346-
mimeType: "application/json",
345+
content: [{
346+
type: "text",
347347
text: JSON.stringify(forecasts, null, 2)
348-
}
348+
}]
349349
};
350350
} catch (error) {
351351
if (axios.isAxiosError(error)) {
352352
return {
353-
content: {
354-
mimeType: "text/plain",
353+
content: [{
354+
type: "text",
355355
text: `Weather API error: ${error.response?.data.message ?? error.message}`
356-
},
356+
}],
357357
isError: true,
358358
}
359359
}

0 commit comments

Comments
 (0)