Skip to content

@nogoo9/mcp-server-cloud-fs / path-utils / resolveToolPath

Function: resolveToolPath()

resolveToolPath(allowedRoots, toolPath): object

Defined in: path-utils.ts:71

Resolve a tool path (relative or absolute URI) against allowed roots.

Validates that the resolved path falls within at least one configured root. Throws "Access denied: path is outside allowed roots" on violation.

Parameters

allowedRoots

ParsedRoot[]

Configured storage roots to validate against.

toolPath

string

User-supplied path (relative or absolute URI).

Returns

object

The matching root and the normalized key.

key

key: string

root

root: ParsedRoot

Released under the PolyForm Shield 1.0.0 License.