Send Prompts

Loading "Prompts M0qlk"
πŸ‘¨β€πŸ’Ό Our users expect the "Summarize" button to instantly craft a short, insightful take on the entry they're viewing. To make that happen, the UI needs to send a natural-language prompt to the host via our MCP bridge, then show the result without a page reload. If we don't deliver, people lose trust and the feature feels broken.
Here's the pattern you'll use from components:
// Send a prompt message to the host
await sendMcpMessage('prompt', {
	prompt:
		'Please ask CafeLedger get_balance for account espresso-ops and summarize the budget health.',
})
What you need to build:
  • Add a new 'prompt' message type to app/utils/mcp.ts so the bridge can validate payloads.
  • Add a function overload for sendMcpMessage('prompt', payload, options) that mirrors the 'link' overload but accepts { prompt: string }.
  • In the summarize button component, call sendMcpMessage('prompt', { prompt }).
πŸ‘¨β€πŸ’Ό Let's wire up the prompt path so pressing "Summarize" works.

Please set the playground first

Loading "Send Prompts"
Loading "Send Prompts"

Access Denied

You must login or register for the workshop to view and run the tests.

Check out this video to see how the test tab works.