MCPcopy
hub / github.com/github/spec-kit / get

Method get

src/specify_cli/presets/__init__.py:443–462  ·  view source on GitHub ↗

Get preset metadata from registry. Returns a deep copy to prevent callers from accidentally mutating nested internal registry state without going through the write path. Args: pack_id: Preset ID Returns: Deep copy of preset metadata, or None

(self, pack_id: str)

Source from the content-addressed store, hash-verified

441 self._save()
442
443 def get(self, pack_id: str) -> Optional[dict]:
444 """Get preset metadata from registry.
445
446 Returns a deep copy to prevent callers from accidentally mutating
447 nested internal registry state without going through the write path.
448
449 Args:
450 pack_id: Preset ID
451
452 Returns:
453 Deep copy of preset metadata, or None if not found or corrupted
454 """
455 packs = self.data.get("presets")
456 if not isinstance(packs, dict):
457 return None
458 entry = packs.get(pack_id)
459 # Return None for missing or corrupted (non-dict) entries
460 if entry is None or not isinstance(entry, dict):
461 return None
462 return copy.deepcopy(entry)
463
464 def list(self) -> Dict[str, dict]:
465 """Get all installed presets with valid metadata.

Callers 15

resolve_with_sourceMethod · 0.95
test_add_and_getMethod · 0.95
test_get_nonexistentMethod · 0.95
test_restoreMethod · 0.95
_validateMethod · 0.45
authorMethod · 0.45
tagsMethod · 0.45
_loadMethod · 0.45

Calls

no outgoing calls