https://promptfoo.dev/ logo
Assert value from metadata?
# ❓|questions
h
Hi @User , I have values available in Promptfoo metadata such as toolNames and toolCalls, and I need to assert these metadata values. What is the best approach to do this? "assert": [ { "type": "javascript", "value": "metadata && metadata.toolCalls <= 10", "weight": 0.12, "description": "✓ METRIC: Tool calls reasonable (maximum 10)" } ] However, this does not work. Thanks, https://cdn.discordapp.com/attachments/1453366794570956812/1453366794894053492/Screenshot_2025-12-24_at_19.29.12.png?ex=694d30ce&is=694bdf4e&hm=57246b8f53fc49219b4b2575ae7a7e8b51e6a03f176297e15dc2446ae39ea84b&