code: private void ensureToolValidForCreation(ExternalTool tool) {
          //check for the unconditionally required fields
          if(StringUtils.isAnyBlank(tool.getName(), tool.getPrivacyLevel(), tool.getConsumerKey(), tool.getSharedSecret())) {
              throw new IllegalArgumentException("External tool requires all of the following for creation: name, privacy level, consumer key, shared secret");
          }
          //check that there is either a URL or a domain. One or the other is required
          if(StringUtils.isBlank(tool.getUrl()) && StringUtils.isBlank(tool.getDomain())) {
              throw new IllegalArgumentException("External tool requires either a URL or domain for creation");
          }
      }
docs: Ensure that a tool object is valid for creation. The API requires certain fields to be filled out.
  Throws an IllegalArgumentException if the conditions are not met.
  @param tool The external tool object we are trying to create