Skip to content
Discussion options

You must be logged in to vote

[{"result":{"data":{"json":"\"100*200 = 20000.0\\n300*400 = 120000.0\""}}}]

这个结构是 trpc 的接口规范, "\"100*200 = 20000.0\\n300*400 = 120000.0\"" 这一串才是实际返回的值。

另外从模型角度来说是否做一次 JSON stringify 都是能正常理解的,这个不存在问题。反而是如果针对字符串不做 JSON stringify ,有较大概率在返回信息的时候出现无法正常解析的问题。

另外你可以自己测一下官方的 mcp sdk ,我这里已经做得比较细致了,都去掉了第一次的 [ {type: "text" ,text:""}] 这个外层包裹的对象。

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arvinxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #8042 on June 02, 2025 01:09.