@@ -299,44 +299,44 @@ private function assertRequestCapability(string $method): void
299299
300300 case 'tools/list ' :
301301 case 'tools/call ' :
302- if ($ capabilities ->tools === null ) {
302+ if (! $ capabilities ->tools ) {
303303 throw McpServerException::methodNotFound ($ method , 'Tools are not enabled on this server. ' );
304304 }
305305 break ;
306306
307307 case 'resources/list ' :
308308 case 'resources/templates/list ' :
309309 case 'resources/read ' :
310- if ($ capabilities ->resources === null ) {
310+ if (! $ capabilities ->resources ) {
311311 throw McpServerException::methodNotFound ($ method , 'Resources are not enabled on this server. ' );
312312 }
313313 break ;
314314
315315 case 'resources/subscribe ' :
316316 case 'resources/unsubscribe ' :
317- if ($ capabilities ->resources === null ) {
317+ if (! $ capabilities ->resources ) {
318318 throw McpServerException::methodNotFound ($ method , 'Resources are not enabled on this server. ' );
319319 }
320- if (!$ capabilities ->resources [ ' subscribe ' ] ) {
320+ if (!$ capabilities ->resourcesSubscribe ) {
321321 throw McpServerException::methodNotFound ($ method , 'Resources subscription is not enabled on this server. ' );
322322 }
323323 break ;
324324
325325 case 'prompts/list ' :
326326 case 'prompts/get ' :
327- if ($ capabilities ->prompts === null ) {
327+ if (! $ capabilities ->prompts ) {
328328 throw McpServerException::methodNotFound ($ method , 'Prompts are not enabled on this server. ' );
329329 }
330330 break ;
331331
332332 case 'logging/setLevel ' :
333- if ($ capabilities ->logging === null ) {
333+ if (! $ capabilities ->logging ) {
334334 throw McpServerException::methodNotFound ($ method , 'Logging is not enabled on this server. ' );
335335 }
336336 break ;
337337
338338 case 'completion/complete ' :
339- if ($ capabilities ->completions === null ) {
339+ if (! $ capabilities ->completions ) {
340340 throw McpServerException::methodNotFound ($ method , 'Completions are not enabled on this server. ' );
341341 }
342342 break ;
@@ -354,29 +354,29 @@ private function canSendNotification(string $method): bool
354354
355355 switch ($ method ) {
356356 case 'notifications/message ' :
357- if ($ capabilities ->logging === null ) {
357+ if (! $ capabilities ->logging ) {
358358 $ this ->logger ->warning ('Logging is not enabled on this server. Notifications/message will not be sent. ' );
359359 $ valid = false ;
360360 }
361361 break ;
362362
363363 case "notifications/resources/updated " :
364364 case "notifications/resources/list_changed " :
365- if ($ capabilities ->resources === null || !$ capabilities ->resources [ ' listChanged ' ] ) {
365+ if (! $ capabilities ->resources || !$ capabilities ->resourcesListChanged ) {
366366 $ this ->logger ->warning ('Resources list changed notifications are not enabled on this server. Notifications/resources/list_changed will not be sent. ' );
367367 $ valid = false ;
368368 }
369369 break ;
370370
371371 case "notifications/tools/list_changed " :
372- if ($ capabilities ->tools === null || !$ capabilities ->tools [ ' listChanged ' ] ) {
372+ if (! $ capabilities ->tools || !$ capabilities ->toolsListChanged ) {
373373 $ this ->logger ->warning ('Tools list changed notifications are not enabled on this server. Notifications/tools/list_changed will not be sent. ' );
374374 $ valid = false ;
375375 }
376376 break ;
377377
378378 case "notifications/prompts/list_changed " :
379- if ($ capabilities ->prompts === null || !$ capabilities ->prompts [ ' listChanged ' ] ) {
379+ if (! $ capabilities ->prompts || !$ capabilities ->promptsListChanged ) {
380380 $ this ->logger ->warning ('Prompts list changed notifications are not enabled on this server. Notifications/prompts/list_changed will not be sent. ' );
381381 $ valid = false ;
382382 }
0 commit comments