MCPcopy Create free account
hub / github.com/docker/model-test / isToolCallCorrect

Method isToolCallCorrect

services/test_runner.go:231–250  ·  view source on GitHub ↗

isToolCallCorrect checks if an actual tool call matches an expected one

(expected models.ExpectedToolCall, actual models.ActualToolCall)

Source from the content-addressed store, hash-verified

229
230// isToolCallCorrect checks if an actual tool call matches an expected one
231func (tr *TestRunner) isToolCallCorrect(expected models.ExpectedToolCall, actual models.ActualToolCall) bool {
232 if expected.Name != actual.Name {
233 return false
234 }
235
236 // Check if all expected arguments are present and correct
237 for key, expectedValue := range expected.Arguments {
238 actualValue, exists := actual.Arguments[key]
239 if !exists {
240 return false
241 }
242
243 // Simple equality check using case-insensitive comparison
244 if !strings.EqualFold(fmt.Sprintf("%v", expectedValue), fmt.Sprintf("%v", actualValue)) {
245 return false
246 }
247 }
248
249 return true
250}
251
252// getModelName returns the model name to use for test results
253func (tr *TestRunner) getModelName() string {

Callers 1

isPathSuccessfulMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected