diff --git a/src/a2a/server/agent_execution/context.py b/src/a2a/server/agent_execution/context.py index 8b1559aa..4ac5fb0e 100644 --- a/src/a2a/server/agent_execution/context.py +++ b/src/a2a/server/agent_execution/context.py @@ -127,9 +127,7 @@ def context_id(self) -> str | None: @property def configuration(self) -> MessageSendConfiguration | None: """The `MessageSendConfiguration` from the request, if available.""" - if not self._params: - return None - return self._params.configuration + return self._params.configuration if self._params else None @property def call_context(self) -> ServerCallContext | None: @@ -139,9 +137,7 @@ def call_context(self) -> ServerCallContext | None: @property def metadata(self) -> dict[str, Any]: """Metadata associated with the request, if available.""" - if not self._params: - return {} - return self._params.metadata or {} + return self._params.metadata or {} if self._params else {} def add_activated_extension(self, uri: str) -> None: """Add an extension to the set of activated extensions for this request.