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

[@salesforce/b2c-tooling-sdk](../../modules.md) / [docs](../index.md) / resolveEnabledCategories

# Function: resolveEnabledCategories()

> **resolveEnabledCategories**(`input`, `onInvalid?`): [`DocCategory`](../type-aliases/DocCategory.md)[] \| `undefined`

Defined in: [packages/b2c-tooling-sdk/src/docs/search.ts:142](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/docs/search.ts#L142)

Parses and validates a user-supplied set of documentation categories into a
"topics" allowlist that bounds the entire available corpus (see
[SearchDocsOptions.enabledCategories](../interfaces/SearchDocsOptions.md#enabledcategories)). Accepts a comma-separated string
or an array; names are trimmed and lower-cased.

Unknown names are dropped (and reported via `onInvalid`, if provided). Returns
`undefined` when the input is empty or contains no valid categories, which
means "no restriction" — matching the tolerant behavior of the MCP `--toolsets`
flag, so a typo yields a warning and the full corpus rather than a dead tool.

## Parameters

### input

Comma-separated category names, or an array of names

`string` | readonly `string`[] | `undefined`

### onInvalid?

(`invalid`) => `void`

Optional callback invoked with any unrecognized names

## Returns

[`DocCategory`](../type-aliases/DocCategory.md)[] \| `undefined`

The validated, de-duplicated categories, or `undefined` for no restriction
