workers-mcp: returning other types

Hi there! Has anyone else used the workers-mcp package? It works great, but I can't seem to return any data to the client except text. This might be a misunderstanding of MCP, but I'm curious if anyone else has thoughts. For example:
/**
* Fetches the Message Data Model (MDM) for a given canonical ID.
* @param canonicalId {string} The canonical ID to look up.
* @return {object|string} The Message Data Model data or an error message.
*/
/**
* Fetches the Message Data Model (MDM) for a given canonical ID.
* @param canonicalId {string} The canonical ID to look up.
* @return {object|string} The Message Data Model data or an error message.
*/
Attempting to return an object to the client (in this case MCP Inspector) results in an "invalid tool result" error, even though the tool returns a valid JSON blob. I'm not sure how to return JSON to the client unless everything's just supposed to be handled as strings?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?