---
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/d9cf11cf4a11828e783aed6313f5ea49990488ff/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/d9cf11cf4a11828e783aed6313f5ea49990488ff/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).
