Commit b29c23f
committed
Fix: Correct resource fallback tool detection logic
The previous logic incorrectly checked clientCapabilities.resources which
doesn't exist (resources is a SERVER capability, not a CLIENT capability).
Now correctly detects clients by name using getClientVersion() and only
registers fallback tools for clients with known resource support issues
(e.g., Claude Desktop).
Result: MCP Inspector and other proper clients now see 23 tools instead
of 26, with resource fallback tools only appearing for Claude clients.
MCP Inspector Output After Fix:
Tools (23):
[
"bounding_box_tool",
"check_color_contrast_tool",
"compare_styles_tool",
"coordinate_conversion_tool",
"country_bounding_box_tool",
"create_style_tool",
"create_token_tool",
"delete_style_tool",
"geojson_preview_tool",
"get_feedback_tool",
"list_feedback_tool",
"list_styles_tool",
"list_tokens_tool",
"optimize_style_tool",
"preview_style_tool",
"retrieve_style_tool",
"style_builder_tool",
"style_comparison_tool",
"tilequery_tool",
"update_style_tool",
"validate_expression_tool",
"validate_geojson_tool",
"validate_style_tool"
]
Resources (5):
[
"resource://mapbox-documentation",
"resource://mapbox-layer-type-mapping",
"resource://mapbox-streets-v8-fields",
"resource://mapbox-style-layers",
"resource://mapbox-token-scopes"
]
Fixes dynamic tool registration to work as intended.1 parent 0b57cb9 commit b29c23f
1 file changed
Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| |||
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
254 | 267 | | |
255 | 268 | | |
256 | | - | |
| 269 | + | |
257 | 270 | | |
258 | 271 | | |
259 | 272 | | |
| |||
263 | 276 | | |
264 | 277 | | |
265 | 278 | | |
266 | | - | |
| 279 | + | |
267 | 280 | | |
268 | 281 | | |
269 | 282 | | |
| |||
0 commit comments