Skip to content

Commit f8154af

Browse files
committed
feat(threejs-server): add structuredContent to tool result
Add structuredContent alongside JSON text content in the show_threejs_scene tool handler for structured data access by clients. Note: The threejs-app client uses toolInputs (tool arguments) directly rather than parsing toolResult, so no client-side changes were needed.
1 parent 9a22158 commit f8154af

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

examples/threejs-server/server.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,10 @@ export function createServer(): McpServer {
169169
_meta: { [RESOURCE_URI_META_KEY]: resourceUri },
170170
},
171171
async ({ code, height }) => {
172+
const data = { code, height };
172173
return {
173-
content: [
174-
{
175-
type: "text",
176-
text: JSON.stringify({ code, height }),
177-
},
178-
],
174+
content: [{ type: "text", text: JSON.stringify(data) }],
175+
structuredContent: data,
179176
};
180177
},
181178
);

0 commit comments

Comments
 (0)