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

Function createTool

packages/core/src/__tests__/test-utils.ts:206–216  ·  view source on GitHub ↗
(
  overrides: Partial<FrontendTool<T>> = {},
)

Source from the content-addressed store, hash-verified

204}
205
206export function createTool<T extends Record<string, unknown>>(
207 overrides: Partial<FrontendTool<T>> = {},
208): FrontendTool<T> {
209 return {
210 name: `tool-${Math.random().toString(36).substr(2, 9)}`,
211 description: "Test tool",
212 handler: vi.fn(async () => "Tool result"),
213 followUp: false, // Default to false to avoid unexpected recursion in tests
214 ...overrides,
215 };
216}
217
218export function createMultipleToolCallsMessage(
219 toolCalls: Array<{ name: string; args?: any }>,

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…