@@ -39,10 +39,19 @@ test('Tool Definition', async () => {
3939 } catch ( error : any ) {
4040 if ( error . code === - 32601 ) {
4141 console . error ( 'π¨ Tools capability not implemented!' )
42- console . error ( 'π¨ This exercise requires registering tools with the MCP server' )
43- console . error ( 'π¨ You need to: 1) Add tools: {} to server capabilities, 2) Register an "add" tool in initializeTools()' )
44- console . error ( 'π¨ Check src/tools.ts and make sure you implement the "add" tool' )
45- const enhancedError = new Error ( 'π¨ Tools capability required. Register an "add" tool that hardcodes 1 + 2 = 3. ' + ( error . message || error ) )
42+ console . error (
43+ 'π¨ This exercise requires registering tools with the MCP server' ,
44+ )
45+ console . error (
46+ 'π¨ You need to: 1) Add tools: {} to server capabilities, 2) Register an "add" tool in initializeTools()' ,
47+ )
48+ console . error (
49+ 'π¨ Check src/tools.ts and make sure you implement the "add" tool' ,
50+ )
51+ const enhancedError = new Error (
52+ 'π¨ Tools capability required. Register an "add" tool that hardcodes 1 + 2 = 3. ' +
53+ ( error . message || error ) ,
54+ )
4655 enhancedError . stack = error . stack
4756 throw enhancedError
4857 }
@@ -70,10 +79,18 @@ test('Tool Call', async () => {
7079 } catch ( error : any ) {
7180 if ( error . code === - 32601 ) {
7281 console . error ( 'π¨ Tool call failed - tools capability not implemented!' )
73- console . error ( 'π¨ This means you haven\'t registered the "add" tool properly' )
74- console . error ( 'π¨ In src/tools.ts, use agent.server.registerTool() to create a simple "add" tool' )
75- console . error ( 'π¨ The tool should return "1 + 2 = 3" (hardcoded for this simple exercise)' )
76- const enhancedError = new Error ( 'π¨ "add" tool registration required. ' + ( error . message || error ) )
82+ console . error (
83+ 'π¨ This means you haven\'t registered the "add" tool properly' ,
84+ )
85+ console . error (
86+ 'π¨ In src/tools.ts, use agent.server.registerTool() to create a simple "add" tool' ,
87+ )
88+ console . error (
89+ 'π¨ The tool should return "1 + 2 = 3" (hardcoded for this simple exercise)' ,
90+ )
91+ const enhancedError = new Error (
92+ 'π¨ "add" tool registration required. ' + ( error . message || error ) ,
93+ )
7794 enhancedError . stack = error . stack
7895 throw enhancedError
7996 }
0 commit comments