400 error on tool calling with gpt-oss-20b

{
  "error": {
    "code": "tool_use_failed",
    "failed_generation": "{\"name\": \"create-search-artifact_SearchArtifactRequest\", \"arguments\": {\"body\":{\"search\":{\"limit\":3,\"type\":\"all\",\"classes\":[{\"space\":\"movie-db\",\"name\":\"movie-details\"}],\"filter\":[{\"by\":\"release_date\",\"type\":\"range\",\"value\":{\"from\":\"2024-01-01\",\"to\":\"2024-12-31\"}},{\"by\":\"vote_count\",\"type\":\"range\",\"value\":{\"from\":\"7000\"}}],\"sort\":[{\"by\":\"vote_count\",\"direction\":\"desc\"},{\"by\":\"vote_average\",\"direction\":\"desc\"}]},\"path\":{\"message_id\":\"019c2e48-84f2-71ca-adb4-bd5927c7022c\"},\"next\":null}}",
    "message": "Failed to parse tool call arguments as JSON",
    "type": "invalid_request_error"
  }
}

This happens from time to time. Depending on the task I give it.

Request ID: req_01kgq4j2rbf5srjvn5hhhfxw4t

I managed to solve it, the issue was in the tool schema.

1 Like