<!--
{
  "documentType" : "article",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/Spotlight-search-tool",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Spotlight search tool"
}
-->

# Spotlight search tool

Make your app’s indexed content available to the system’s Foundation models as additional
context to use when answering prompts.

## Discussion

Your app’s Spotlight search index provides fast access to your app’s content when you need
to find something. The [`SpotlightSearchTool`](/documentation/CoreSpotlight/SpotlightSearchTool) provides an efficient way for the Foundation Models
framework to access the content in that index and use it to answer prompts. Include this
tool in the Foundation Models session you use to run prompts that require your app’s custom
content. Configure the search tool as needed to customize its behavior or the search behaviors.

## Topics

### Essentials

[Making your indexed content available to Foundation Models](/documentation/CoreSpotlight/making-your-indexed-content-available-to-foundation-models)

Make the content you index for Spotlight available to Foundation models to help
generate responses to prompts.

[Searching indexed content with natural language](/documentation/CoreSpotlight/searching-indexed-content-with-natural-language)

Give a language model access to your app’s Core Spotlight index to enable natural-language queries over searchable content.

### Tool configuration

[`SpotlightSearchTool`](/documentation/CoreSpotlight/SpotlightSearchTool)

A tool you use to make your app’s custom data available to Foundation Models.

[`Configuration`](/documentation/CoreSpotlight/SpotlightSearchTool/Configuration-swift.struct)

The configuration data to use when creating a Spotlight search tool.

### Data sources

[`SearchSource`](/documentation/CoreSpotlight/SearchSource)

A source of data for Spotlight to search.

[`CoreSpotlightSource`](/documentation/CoreSpotlight/CoreSpotlightSource)

A search source that retrieves data from the app’s Spotlight index.

[`FileSource`](/documentation/CoreSpotlight/FileSource)

A search source that retrieves indexed metadata from files and directories visible to Spotlight.

[`SearchableItemAttribute`](/documentation/CoreSpotlight/SearchableItemAttribute)

An attribute from a content item that the Spotlight search tool can include in search results.

### Tool customization

[`CustomStage`](/documentation/CoreSpotlight/CustomStage)

A custom processing stage the Spotlight search tool uses to identify search results.

[`SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData)

The type you use to store the output from a custom stage.

[`SearchPipelineDataType`](/documentation/CoreSpotlight/SearchPipelineDataType)

Data types that a pipeline stage accepts or produces.

[`ScoredSearchableItem`](/documentation/CoreSpotlight/ScoredSearchableItem)

A searchable item paired with a caller-assigned relevance score.

### Contact resolution

[`ContactResolver`](/documentation/CoreSpotlight/ContactResolver)

An interface you use to help Foundation models resolve references to the person using the app.

[`ResolvedContact`](/documentation/CoreSpotlight/ResolvedContact)

Contact information to help a search query match references to a person or organization.

### Search results

[`SearchCount`](/documentation/CoreSpotlight/SearchCount)

A scalar count result (e.g., “47 emails from John”).

[`SearchResultsTable`](/documentation/CoreSpotlight/SearchResultsTable)

Tabulated result data — rows with typed columns for display or spreadsheet export.

[`SearchStatistic`](/documentation/CoreSpotlight/SearchStatistic)

A scalar statistic derived from search results (sum, average, max, min, median, stddev).

[`SearchTextResult`](/documentation/CoreSpotlight/SearchTextResult)

LLM-generated text summary or analysis from a pipeline stage.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)