Skip to main content

ToolRegistry

@forge/monorepo


@forge/monorepo / backend/src / ToolRegistry

Interface: ToolRegistry

Defined in: backend/src/tools/registry.ts:327

Methods

catalog()

catalog(context, policy): Promise<ToolCatalog>

Defined in: backend/src/tools/registry.ts:328

Parameters

context

ExecutionContext

policy

ToolPolicyView

Returns

Promise<ToolCatalog>


execute()

execute(context, input): Promise<ToolResult>

Defined in: backend/src/tools/registry.ts:349

Parameters

context

ExecutionContext

input
approval?

OneTimeApprovalRef

Present when this call is the execution a human approved; see OneTimeApprovalRef.

idempotencyKey?

string

input

unknown

name

string

toolCallId?

string

Returns

Promise<ToolResult>


find()

find(context, input): Promise<ToolSearchOutcome>

Defined in: backend/src/tools/registry.ts:337

Search the catalogue — AC-1.

Filtered by the same authorization policy as discovery, which is not a nicety: an unfiltered search is an enumeration oracle. A principal who cannot see github_merge_pull_request in the catalogue but can confirm it exists by searching for "merge" has learned what the deployment does, and hiding a tool from discovery while making it findable is worse than not hiding it, because it looks like it was hidden.

Parameters

context

ExecutionContext

input
limit?

number

query

string

Returns

Promise<ToolSearchOutcome>


learn()

learn(context, names): Promise<readonly ToolDescriptor[]>

Defined in: backend/src/tools/registry.ts:348

Parameters

context

ExecutionContext

names

readonly string[]

Returns

Promise<readonly ToolDescriptor[]>


listAuthorized()

listAuthorized(context): Promise<readonly ToolDescriptor[]>

Defined in: backend/src/tools/registry.ts:347

Every tool this caller may use, with schemas — the list buildTools should hand a model.

Exists because the embedded facade was doing this itself: gathering providers, flattening, and filtering by authorization, in its own copy of the four lines this registry already owns. The copy had no duplicate-name check and no tenant toolset, so a category a tenant had switched off was invisible in the catalogue, absent from find_tools, refused at execution — and still handed to the model, which would then call it and be refused. One implementation, and this is it.

Parameters

context

ExecutionContext

Returns

Promise<readonly ToolDescriptor[]>


readOutput()

readOutput(context, ref): Promise<ToolResult>

Defined in: backend/src/tools/registry.ts:360

Parameters

context

ExecutionContext

ref

BlobRef

Returns

Promise<ToolResult>