From 3887a579d671c1cb5fc4353c61419e1c4a5c9798 Mon Sep 17 00:00:00 2001 From: Pierre Carion Date: Tue, 26 Nov 2024 19:05:33 -0800 Subject: [PATCH] update tool response to be compliant with spec --- docs/first-server/typescript.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/first-server/typescript.mdx b/docs/first-server/typescript.mdx index 18354ac..bf52594 100644 --- a/docs/first-server/typescript.mdx +++ b/docs/first-server/typescript.mdx @@ -342,18 +342,18 @@ This guide uses the OpenWeatherMap API. You'll need a free API key from [OpenWea } return { - content: { - mimeType: "application/json", + content: [{ + type: "text", text: JSON.stringify(forecasts, null, 2) - } + }] }; } catch (error) { if (axios.isAxiosError(error)) { return { - content: { - mimeType: "text/plain", + content: [{ + type: "text", text: `Weather API error: ${error.response?.data.message ?? error.message}` - }, + }], isError: true, } }