---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [discovery](../index.md) / DetectionContext

# Interface: DetectionContext

Defined in: [packages/b2c-tooling-sdk/src/discovery/types.ts:44](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/discovery/types.ts#L44)

Context passed to a detection pattern's `detect` function.

## Properties

### maxDepth?

> `optional` **maxDepth**: `number`

Defined in: [packages/b2c-tooling-sdk/src/discovery/types.ts:51](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/discovery/types.ts#L51)

Maximum directory depth (in path segments, relative to the workspace root)
that filesystem-scanning patterns should recurse. Undefined means unbounded.
Bounding this protects against costly walks when the workspace root is broad
(e.g. an MCP server launched from a home directory).
