update tool response to be compliant with spec
This commit is contained in:
parent
f02570cb6a
commit
3887a579d6
1 changed files with 6 additions and 6 deletions
|
|
@ -342,18 +342,18 @@ This guide uses the OpenWeatherMap API. You'll need a free API key from [OpenWea
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: {
|
content: [{
|
||||||
mimeType: "application/json",
|
type: "text",
|
||||||
text: JSON.stringify(forecasts, null, 2)
|
text: JSON.stringify(forecasts, null, 2)
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (axios.isAxiosError(error)) {
|
if (axios.isAxiosError(error)) {
|
||||||
return {
|
return {
|
||||||
content: {
|
content: [{
|
||||||
mimeType: "text/plain",
|
type: "text",
|
||||||
text: `Weather API error: ${error.response?.data.message ?? error.message}`
|
text: `Weather API error: ${error.response?.data.message ?? error.message}`
|
||||||
},
|
}],
|
||||||
isError: true,
|
isError: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue