Call Tools
Tools Ow1ol
👨💼 When users click "View Entry" on a journal entry, nothing happens. They need a way to trigger tool calls that fetch detailed data from the host application.
You're going to build upon the abstraction you and 🧝♀️ Kellie built in the last exercise so you can use it for
tool calls as well:await sendMcpMessage('tool', {
toolName: 'analyze_rock_sample',
params: { sampleId: 'mars-2024-001' },
})
You need to add the 'tool' type to
sendMcpMessage and wire up the actual tool call.Now, let's implement this to make those journal entries interactive.