MCPcopy Index your code
hub / github.com/anus-dev/ANUS / TestToolInvocation

Class TestToolInvocation

packages/core/src/tools/tools.test.ts:18–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16import { ToolErrorType } from './tool-error.js';
17
18class TestToolInvocation implements ToolInvocation<object, ToolResult> {
19 constructor(
20 readonly params: object,
21 private readonly executeFn: () => Promise<ToolResult>,
22 ) {}
23
24 getDescription(): string {
25 return 'A test invocation';
26 }
27
28 toolLocations() {
29 return [];
30 }
31
32 shouldConfirmExecute(): Promise<false> {
33 return Promise.resolve(false);
34 }
35
36 execute(): Promise<ToolResult> {
37 return this.executeFn();
38 }
39}
40
41class TestTool extends DeclarativeTool<object, ToolResult> {
42 private readonly buildFn: (params: object) => TestToolInvocation;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected