Commit 9ef7f4f
committed
Add icons field support to registerTool() and registerToolTask()
The MCP spec's ToolSchema includes icons via IconsSchema, but the
high-level registerTool() and registerToolTask() APIs did not accept
or pass through the icons field. This meant tools/list responses
never included icons even when the spec supports them.
Changes:
- Add icons to RegisteredTool type and update() method
- Add icons parameter to _createRegisteredTool()
- Add icons to registerTool() and registerToolTask() config types
- Include icons in toolDefinition for tools/list responses
- Add test for tool registration with icons
Fixes #18641 parent 7ba58da commit 9ef7f4f
3 files changed
Lines changed: 68 additions & 2 deletions
File tree
- packages/server/src
- experimental/tasks
- server
- test/integration/test/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
772 | 774 | | |
773 | 775 | | |
774 | 776 | | |
| 777 | + | |
775 | 778 | | |
776 | 779 | | |
777 | 780 | | |
| |||
788 | 791 | | |
789 | 792 | | |
790 | 793 | | |
| 794 | + | |
791 | 795 | | |
792 | 796 | | |
793 | 797 | | |
| |||
822 | 826 | | |
823 | 827 | | |
824 | 828 | | |
| 829 | + | |
825 | 830 | | |
826 | 831 | | |
827 | 832 | | |
| |||
870 | 875 | | |
871 | 876 | | |
872 | 877 | | |
| 878 | + | |
873 | 879 | | |
874 | 880 | | |
875 | 881 | | |
| |||
878 | 884 | | |
879 | 885 | | |
880 | 886 | | |
881 | | - | |
| 887 | + | |
882 | 888 | | |
883 | 889 | | |
884 | 890 | | |
| |||
888 | 894 | | |
889 | 895 | | |
890 | 896 | | |
| 897 | + | |
891 | 898 | | |
892 | 899 | | |
893 | 900 | | |
| |||
1095 | 1102 | | |
1096 | 1103 | | |
1097 | 1104 | | |
| 1105 | + | |
1098 | 1106 | | |
1099 | 1107 | | |
1100 | 1108 | | |
| |||
1110 | 1118 | | |
1111 | 1119 | | |
1112 | 1120 | | |
| 1121 | + | |
1113 | 1122 | | |
1114 | 1123 | | |
1115 | 1124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1041 | 1093 | | |
1042 | 1094 | | |
1043 | 1095 | | |
| |||
0 commit comments