@@ -79,9 +79,7 @@ def __post_init__(self) -> None:
7979 validate_string_length (self .url , 256 , "endpoint URL" )
8080 validate_url (self .url , "endpoint URL" )
8181 if self .description :
82- validate_string_length (
83- self .description , 512 , "endpoint description"
84- )
82+ validate_string_length (self .description , 512 , "endpoint description" )
8583
8684
8785@dataclass
@@ -148,9 +146,7 @@ def __post_init__(self) -> None:
148146 validate_string_length (self .provider_url , 256 , "provider_url" )
149147 validate_url (self .provider_url , "provider_url" )
150148 if self .documentation_url :
151- validate_string_length (
152- self .documentation_url , 256 , "documentation_url"
153- )
149+ validate_string_length (self .documentation_url , 256 , "documentation_url" )
154150 validate_url (self .documentation_url , "documentation_url" )
155151
156152 # Validate collections
@@ -184,8 +180,7 @@ def from_account_data(cls, data: Dict[str, Any]) -> "AgentRegistryEntry":
184180 provider_url = data .get ("provider_url" ),
185181 documentation_url = data .get ("documentation_url" ),
186182 service_endpoints = [
187- ServiceEndpoint (** ep )
188- for ep in data .get ("service_endpoints" , [])
183+ ServiceEndpoint (** ep ) for ep in data .get ("service_endpoints" , [])
189184 ],
190185 capabilities_flags = data .get ("capabilities_flags" , 0 ),
191186 supported_input_modes = data .get ("supported_input_modes" , []),
@@ -194,9 +189,7 @@ def from_account_data(cls, data: Dict[str, Any]) -> "AgentRegistryEntry":
194189 security_info_uri = data .get ("security_info_uri" ),
195190 aea_address = data .get ("aea_address" ),
196191 economic_intent_summary = data .get ("economic_intent_summary" ),
197- supported_aea_protocols_hash = data .get (
198- "supported_aea_protocols_hash"
199- ),
192+ supported_aea_protocols_hash = data .get ("supported_aea_protocols_hash" ),
200193 extended_metadata_uri = data .get ("extended_metadata_uri" ),
201194 tags = data .get ("tags" , []),
202195 created_at = data .get ("created_at" , 0 ),
@@ -311,7 +304,9 @@ def __post_init__(self) -> None:
311304 )
312305 if self .full_capabilities_uri :
313306 validate_string_length (
314- self .full_capabilities_uri , 256 , "full_capabilities_uri"
307+ self .full_capabilities_uri ,
308+ 256 ,
309+ "full_capabilities_uri" ,
315310 )
316311 validate_url (self .full_capabilities_uri , "full_capabilities_uri" )
317312
@@ -321,9 +316,7 @@ def __post_init__(self) -> None:
321316 validate_string_length (tag , 32 , "server tag" )
322317
323318 @classmethod
324- def from_account_data (
325- cls , data : Dict [str , Any ]
326- ) -> "McpServerRegistryEntry" :
319+ def from_account_data (cls , data : Dict [str , Any ]) -> "McpServerRegistryEntry" :
327320 """Create instance from on-chain account data.
328321
329322 Args:
@@ -343,13 +336,8 @@ def from_account_data(
343336 resource_count = cap_data .get ("resource_count" , 0 ),
344337 prompt_count = cap_data .get ("prompt_count" , 0 ),
345338 tools = [McpTool (** tool ) for tool in cap_data .get ("tools" , [])],
346- resources = [
347- McpResource (** res ) for res in cap_data .get ("resources" , [])
348- ],
349- prompts = [
350- McpPrompt (** prompt )
351- for prompt in cap_data .get ("prompts" , [])
352- ],
339+ resources = [McpResource (** res ) for res in cap_data .get ("resources" , [])],
340+ prompts = [McpPrompt (** prompt ) for prompt in cap_data .get ("prompts" , [])],
353341 )
354342
355343 return cls (
0 commit comments