---
title: SpotlightSearchTool.FormatLevel
framework: corespotlight
role: symbol
role_heading: Enumeration
path: corespotlight/spotlightsearchtool/formatlevel
---

# SpotlightSearchTool.FormatLevel

Controls how tool responses are serialized for the model’s context window.

## Declaration

```swift
enum FormatLevel
```

## Overview

Overview The tool returns search results to the model as part of the generation context. The format level determines how those results are encoded: .structured: Full encoding with the highest fidelity, highest token cost. Best when the model needs to reason over attribute keys and values precisely (e.g., filtering, re-querying). .compact: Terse, line-oriented text encoding. Best for models with limited context.

## Topics

### Getting the format levels

- [SpotlightSearchTool.FormatLevel.compact](corespotlight/spotlightsearchtool/formatlevel/compact.md)
- [SpotlightSearchTool.FormatLevel.structured](corespotlight/spotlightsearchtool/formatlevel/structured.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Configuring the tool behavior

- [configuration](corespotlight/spotlightsearchtool/configuration-swift.property.md)
- [SpotlightSearchTool.Configuration](corespotlight/spotlightsearchtool/configuration-swift.struct.md)
- [SpotlightSearchTool.Guide](corespotlight/spotlightsearchtool/guide.md)
- [SpotlightSearchTool.GuidanceProfile](corespotlight/spotlightsearchtool/guidanceprofile.md)
- [SpotlightSearchTool.GuidanceLevel](corespotlight/spotlightsearchtool/guidancelevel.md)
- [SpotlightSearchTool.ContentDomain](corespotlight/spotlightsearchtool/contentdomain.md)
