MCPcopy Create free account
hub / github.com/MetapriseAI/OrgKernel / get_chain

Function get_chain

src/orgkernel/pyapi/router.py:781–790  ·  view source on GitHub ↗

Get an AuditChain by chain_id.

(
    chain_id: str,
    db: Annotated[AsyncSession, Depends(get_db)],
)

Source from the content-addressed store, hash-verified

779 description="Retrieve an AuditChain by chain_id.",
780)
781async def get_chain(
782 chain_id: str,
783 db: Annotated[AsyncSession, Depends(get_db)],
784) -> dict:
785 """Get an AuditChain by chain_id."""
786 svc = AuditChainService()
787 chain = await svc.get_by_chain_id(db, chain_id)
788 if chain is None:
789 raise HTTPException(status_code=404, detail=f"AuditChain not found: {chain_id}")
790 return _chain_to_dict(chain)
791
792
793@_audit.get(

Callers

nothing calls this directly

Calls 3

get_by_chain_idMethod · 0.95
AuditChainServiceClass · 0.90
_chain_to_dictFunction · 0.85

Tested by

no test coverage detected