File tree Expand file tree Collapse file tree 1 file changed +7
-33
lines changed Expand file tree Collapse file tree 1 file changed +7
-33
lines changed Original file line number Diff line number Diff line change @@ -937,24 +937,6 @@ describe("tool()", () => {
937
937
} ) ,
938
938
) ;
939
939
940
- mcpServer . registerTool (
941
- "test (new api)" ,
942
- {
943
- inputSchema : {
944
- name : z . string ( ) ,
945
- value : z . number ( ) ,
946
- } ,
947
- } ,
948
- async ( { name, value } ) => ( {
949
- content : [
950
- {
951
- type : "text" ,
952
- text : `${ name } : ${ value } ` ,
953
- } ,
954
- ] ,
955
- } )
956
- ) ;
957
-
958
940
const [ clientTransport , serverTransport ] =
959
941
InMemoryTransport . createLinkedPair ( ) ;
960
942
@@ -977,23 +959,15 @@ describe("tool()", () => {
977
959
} ,
978
960
CallToolResultSchema ,
979
961
) ,
980
- ) . rejects . toThrow ( / I n v a l i d a r g u m e n t s / ) ;
981
-
982
- await expect (
983
- client . request (
962
+ ) . resolves . toStrictEqual ( {
963
+ content : [
984
964
{
985
- method : "tools/call" ,
986
- params : {
987
- name : "test (new api)" ,
988
- arguments : {
989
- name : "test" ,
990
- value : "not a number" ,
991
- } ,
992
- } ,
965
+ type : "text" ,
966
+ text : expect . stringMatching ( / I n v a l i d a r g u m e n t s f o r t o o l t e s t / ) ,
993
967
} ,
994
- CallToolResultSchema ,
995
- ) ,
996
- ) . rejects . toThrow ( / I n v a l i d a r g u m e n t s / ) ;
968
+ ] ,
969
+ isError : true ,
970
+ } ) ;
997
971
} ) ;
998
972
999
973
/***
You can’t perform that action at this time.
0 commit comments