Skip to main content

Overview

The ValidateTools block validates that AI models call the correct tools/functions with the right arguments. Essential for testing AI agents and function-calling models.

Input Parameters

Required

Each tool call object should have:

Configuration

All config parameters are optional:

Output Fields

Examples

Validate Expected Tools

Success:
Failure:

Forbid Dangerous Tools

Validate Tool Count

Validate Tool Order

Validate Tool Arguments

Combined Validations

Common Patterns

Test AI Agent Tool Usage

Ensure Safe Tool Usage

Validate Multi-Step Agent

Tool Call Format

The block expects tool calls in this format:
Compatible with:
  • OpenAI function calling format
  • Anthropic tool use format
  • Vercel AI SDK tool calls
StreamParser automatically extracts tool calls into this format from streaming responses.

Validation Score

The score field represents validation quality:
  • 1.0 - All validations passed
  • 0.5 - 0.9 - Some issues (missing tools, wrong order)
  • < 0.5 - Significant issues (forbidden tools used, major mismatches)
Factors that reduce score:
  • Missing expected tools
  • Using forbidden tools
  • Wrong tool count
  • Incorrect order
  • Argument mismatches

Error Messages

Common failure messages:

Full Example

Tips

StreamParser extracts tool calls from streaming responses:
Use order to validate sequential tool usage:
ValidateTools checks structure, LLMJudge checks reasoning:
Prevent dangerous operations:

When to Use

Use ValidateTools when:
  • Testing AI function calling
  • Validating agent tool usage
  • Ensuring safe tool execution
  • Testing multi-step workflows
  • Verifying tool arguments
Don’t use when:
  • No tool/function calling involved
  • Testing pure text generation
  • Validating non-AI responses

Next Steps

StreamParser

Parse streaming responses with tool calls

LLMJudge

Validate AI response quality