spring-projects/spring-ai · warning

Unknown 'spring.ai.chat.client.tool-search-advisor.tool-inde

Error message

Unknown 'spring.ai.chat.client.tool-search-advisor.tool-index-type' value: '. Known built-in values are: . If this is intentional, ensure a matching ToolIndex bean is declared in the application context.

What it means

ToolSearchAdvisorAutoConfiguration.afterPropertiesSet validates spring.ai.chat.client.tool-search-advisor.tool-index-type against a set of known built-in types. If the configured value is not recognized, it logs this warning so you know Spring AI found no built-in ToolIndex for it and you must supply a matching ToolIndex bean yourself, or the advisor won't have an index.

Source

Thrown at auto-configurations/advisors/spring-ai-autoconfigure-tool-search-advisor/src/main/java/org/springframework/ai/chat/client/advisor/toolsearch/autoconfigure/ToolSearchAdvisorAutoConfiguration.java:113

@EnableConfigurationProperties(ToolSearchAdvisorProperties.class)
@ConditionalOnProperty(prefix = ToolSearchAdvisorProperties.CONFIG_PREFIX, name = "enabled", havingValue = "true")
public class ToolSearchAdvisorAutoConfiguration implements InitializingBean {

	private static final Log logger = LogFactory.getLog(ToolSearchAdvisorAutoConfiguration.class);

	private static final Set<String> KNOWN_TOOL_INDEX_TYPES = Set.of("regex", "lucene", "vector");

	private final ToolSearchAdvisorProperties properties;

	public ToolSearchAdvisorAutoConfiguration(ToolSearchAdvisorProperties properties) {
		this.properties = properties;
	}

	@Override
	public void afterPropertiesSet() {
		String type = this.properties.getToolIndexType();
		if (type != null && !KNOWN_TOOL_INDEX_TYPES.contains(type.toLowerCase(Locale.ROOT))) {
			logger.warn("Unknown 'spring.ai.chat.client.tool-search-advisor.tool-index-type' value: '" + type
					+ "'. Known built-in values are: " + KNOWN_TOOL_INDEX_TYPES
					+ ". If this is intentional, ensure a matching ToolIndex bean is declared in the application context.");
		}
	}

	/**
	 * Registers a {@link ToolSearchToolCallingAdvisor.Builder} typed as
	 * {@link ToolCallingAdvisor.Builder}. The broader declared return type ensures that
	 * {@code ChatClientAutoConfiguration#toolCallingAdvisorBuilder} is skipped due to its
	 * {@code @ConditionalOnMissingBean}.
	 */
	@Bean
	@ConditionalOnMissingBean
	@ConditionalOnBean({ ToolCallingManager.class, ToolIndex.class })
	ToolCallingAdvisor.Builder<?> toolCallingAdvisorBuilder(ToolSearchAdvisorProperties properties,
			ToolCallingManager toolCallingManager, ToolIndex toolIndex,
			ObjectProvider<ToolExecutionEligibilityChecker> toolExecutionEligibilityChecker) {

View on GitHub (pinned to 98a7beda4f)

Solutions

  1. Correct the property to one of the known built-in values listed in the warning.
  2. If a custom type is intended, declare a matching ToolIndex bean in the application context.
  3. Remove the property to fall back to the default behavior if no special index is needed.

Example fix

// before
spring.ai.chat.client.tool-search-advisor.tool-index-type=inmemmory
// after
spring.ai.chat.client.tool-search-advisor.tool-index-type=in-memory
Defensive patterns

Strategy: validation

Validate before calling

String type = properties.getToolIndexType();
Set<String> known = Set.of("in-memory" /* see KNOWN_TOOL_INDEX_TYPES in the warning */);
if (type != null && !known.contains(type.toLowerCase(Locale.ROOT))) {
    throw new IllegalArgumentException("Unknown tool-index-type: " + type);
}

Prevention

When it happens

Trigger: Setting spring.ai.chat.client.tool-search-advisor.tool-index-type to a value outside the KNOWN_TOOL_INDEX_TYPES set (typo like 'inmemmory' or a custom type name) while the tool-search-advisor auto-configuration initializes.

Common situations: Typos in application.yml/properties; copying a custom index type name from a blog post without declaring the corresponding ToolIndex bean; upgrading versions where a built-in type was renamed or removed.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11). Data as JSON: /api/errors/7a1a862986d57058. Report an issue: GitHub.