My agent asked me "can I order this part?". I said yes. And the answer came back as a failure:
finishReason: FinishReason.failed finishMessage: Tool order_part not found
Enter fullscreen mode
Exit fullscreen mode
The tool was right there. It had been found one step earlier, when the agent stopped to ask for approval. π«
I was building a dispatch assistant in pure Dart for a small, made-up field service company ( full write-up here ). Looking up a work order is free, booking a technician is free, but order_part costs money, so it waits for a person. It took me an evening to find out why the "yes" broke it, and the fix turned into my first PR to Genkit Dart. π₯³
The setup: MCP tools behind an approval
The agent gets its tools from an MCP server and puts toolApproval middleware in front of them. Simplified from my agent:
final mcpTools = await mcpClient . getActiveTools ( ai ); // includes `work-orders/order_part`
final response = await ai .β¦