You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inspector UI Crash when CallToolResult content is not an array #80
I've followed the weather example from the docs, and the inspector crashes when the get_forecast handler returns with this error in the browser:
Uncaught TypeError: f.content.map is not a function
at u (index-jOz_Q5JL.js:185:28299)
at qE (index-jOz_Q5JL.js:185:30526)
at $u (index-jOz_Q5JL.js:38:16998)
at bc (index-jOz_Q5JL.js:40:3139)
at Th (index-jOz_Q5JL.js:40:44737)
at Eh (index-jOz_Q5JL.js:40:39727)
at Lx (index-jOz_Q5JL.js:40:39655)
at ra (index-jOz_Q5JL.js:40:39508)
at Dc (index-jOz_Q5JL.js:40:35875)
at _h (index-jOz_Q5JL.js:40:34826)
A little bit more digging shows that the docs have the wrong return value for the handler; it should be an array.
console.error(`Forecast for ${city}:`,forecasts);awaitsetTimeout(5000);return{content: {mimeType: "application/json",text: JSON.stringify(forecasts,null,2)}// content should be an array};
changed the title [-]Inspector UI Crash when handler returns invalid data[/-][+]Inspector UI Crash when CallToolResult content is not an array[/+]on Nov 26, 2024
Activity
jacksteamdev commentedon Nov 26, 2024
A little bit more digging shows that the docs have the wrong return value for the handler; it should be an array.
The related code for this repo:
inspector/client/src/components/ToolsTab.tsx
Lines 42 to 51 in 2b79b6f
In the wild,
structuredResult.contentcould be anything.[-]Inspector UI Crash on tool use[/-][+]Inspector UI Crash when handler returns invalid data[/+][-]Inspector UI Crash when handler returns invalid data[/-][+]Inspector UI Crash when CallToolResult content is not an array[/+]fix: clear CodeQL modelcontextprotocol#78-modelcontextprotocol#81 fro…