MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / registerFrontendTool

Function registerFrontendTool

packages/angular/src/lib/tools.ts:121–136  ·  view source on GitHub ↗
(frontendTool: FrontendToolConfig<Args>)

Source from the content-addressed store, hash-verified

119}
120
121export function registerFrontendTool<
122 Args extends Record<string, unknown> = Record<string, unknown>,
123>(frontendTool: FrontendToolConfig<Args>): void {
124 const injector = inject(Injector);
125 const destroyRef = inject(DestroyRef);
126 const copilotKit = inject(CopilotKit);
127
128 copilotKit.addFrontendTool({
129 ...(frontendTool as FrontendToolConfig),
130 injector,
131 });
132
133 destroyRef.onDestroy(() => {
134 copilotKit.removeTool(frontendTool.name, frontendTool.agentId);
135 });
136}
137
138export function registerHumanInTheLoop<
139 Args extends Record<string, unknown> = Record<string, unknown>,

Callers 2

constructorMethod · 0.90
constructorMethod · 0.90

Calls 2

addFrontendToolMethod · 0.80
removeToolMethod · 0.45

Tested by 1

constructorMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…