MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / get_instance_for_request

Method get_instance_for_request

relay/instance_registry.py:454–465  ·  view source on GitHub ↗

Get the instance to handle a request. If instance_id is provided, resolves via 5-stage matching. Otherwise, returns the default instance. Raises: AmbiguousInstanceError: When instance_id matches multiple instances.

(self, instance_id: str | None = None)

Source from the content-addressed store, hash-verified

452 return self._fuzzy_match(query)
453
454 def get_instance_for_request(self, instance_id: str | None = None) -> UnityInstance | None:
455 """Get the instance to handle a request.
456
457 If instance_id is provided, resolves via 5-stage matching.
458 Otherwise, returns the default instance.
459
460 Raises:
461 AmbiguousInstanceError: When instance_id matches multiple instances.
462 """
463 if instance_id:
464 return self._resolve_instance(instance_id)
465 return self.get_default()
466
467 @property
468 def count(self) -> int:

Calls 2

_resolve_instanceMethod · 0.95
get_defaultMethod · 0.95