Skip to content

Commit 16dcd27

Browse files
ochafikclaude
andcommitted
feat(kotlin-host): add structuredContent support
Include structuredContent from CallToolResult in the JSON passed to AppBridge. This enables apps to receive structured data from tool results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 220778f commit 16dcd27

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/basic-host-kotlin/src/main/kotlin/com/example/mcpappshost/McpHostViewModel.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ class McpHostViewModel : ViewModel() {
283283
}
284284
})
285285
put("isError", JsonPrimitive(callResult.isError ?: false))
286+
// Include structuredContent if present
287+
callResult.structuredContent?.let { sc ->
288+
put("structuredContent", sc)
289+
}
286290
}
287291
)
288292
updateToolCall(toolCall.id) { it.copy(
@@ -378,6 +382,10 @@ class McpHostViewModel : ViewModel() {
378382
}
379383
})
380384
put("isError", JsonPrimitive(callResult.isError ?: false))
385+
// Include structuredContent if present
386+
callResult.structuredContent?.let { sc ->
387+
put("structuredContent", sc)
388+
}
381389
}
382390
)
383391

0 commit comments

Comments
 (0)