MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_org

Function get_org

app/api/agentops/opsboard/views/orgs.py:205–223  ·  view source on GitHub ↗

Get detailed information for a specific organization, including its members. Optimized to only load users (needed for response), not projects or invites.

(
    *,
    request: Request,
    org_id: str,
    orm: Session = Depends(get_orm_session),
)

Source from the content-addressed store, hash-verified

203
204
205def get_org(
206 *,
207 request: Request,
208 org_id: str,
209 orm: Session = Depends(get_orm_session),
210) -> OrgDetailResponse:
211 """
212 Get detailed information for a specific organization, including its members.
213
214 Optimized to only load users (needed for response), not projects or invites.
215 """
216 org: Optional[OrgModel] = OrgModel.get_by_id_for_detail(orm, org_id)
217
218 if not org or not org.is_user_member(request.state.session.user_id):
219 raise HTTPException(status_code=404, detail="Organization not found")
220
221 org.set_current_user(request.state.session.user_id)
222
223 return OrgDetailResponse.model_validate(org)
224
225
226def create_org(

Callers 2

test_get_orgFunction · 0.90
test_get_org_not_foundFunction · 0.90

Calls 3

get_by_id_for_detailMethod · 0.80
is_user_memberMethod · 0.80
set_current_userMethod · 0.80

Tested by 2

test_get_orgFunction · 0.72
test_get_org_not_foundFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…