MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / makeMinimalToolDef

Function makeMinimalToolDef

src/__tests__/Tool.test.ts:11–30  ·  view source on GitHub ↗
(overrides: Record<string, unknown> = {})

Source from the content-addressed store, hash-verified

9
10// Minimal tool definition for testing buildTool
11function makeMinimalToolDef(overrides: Record<string, unknown> = {}) {
12 return {
13 name: 'TestTool',
14 inputSchema: { type: 'object' as const } as any,
15 maxResultSizeChars: 10000,
16 call: async () => ({ data: 'ok' }),
17 description: async () => 'A test tool',
18 prompt: async () => 'test prompt',
19 mapToolResultToToolResultBlockParam: (
20 content: unknown,
21 toolUseID: string,
22 ) => ({
23 type: 'tool_result' as const,
24 tool_use_id: toolUseID,
25 content: String(content),
26 }),
27 renderToolUseMessage: () => null,
28 ...overrides,
29 }
30}
31
32describe('buildTool', () => {
33 test('fills in default isEnabled as true', () => {

Callers 1

Tool.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected