Send a typed server-to-client notification.
(
self,
notification: types.ServerNotification,
related_request_id: types.RequestId | None = None,
)
| 86 | return result_type.model_validate(result, by_name=False) |
| 87 | |
| 88 | async def send_notification( |
| 89 | self, |
| 90 | notification: types.ServerNotification, |
| 91 | related_request_id: types.RequestId | None = None, |
| 92 | ) -> None: |
| 93 | """Send a typed server-to-client notification.""" |
| 94 | channel = self._request_outbound if related_request_id is not None else self._connection.outbound |
| 95 | data = notification.model_dump(by_alias=True, mode="json", exclude_none=True) |
| 96 | await channel.notify(data["method"], data.get("params")) |
| 97 | |
| 98 | def check_client_capability(self, capability: types.ClientCapabilities) -> bool: |
| 99 | """Check if the client supports a specific capability.""" |
no test coverage detected