# format_grep_matches

> **Function** in `deepagents`

📖 [View in docs](https://reference.langchain.com/python/deepagents/backends/utils/format_grep_matches)

Format structured grep matches using existing formatting logic.

## Signature

```python
format_grep_matches(
    matches: list[GrepMatch],
    output_mode: Literal['files_with_matches', 'content', 'count'],
) -> str
```

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/88c2b5cb874dc1d093acf54d2a967ba6e085c99b/libs/deepagents/deepagents/backends/utils.py#L733)