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

Function check_scope

src/orgkernel/pyapi/router.py:513–524  ·  view source on GitHub ↗

Validate a tool call against an ExecutionToken's scope. Called by the Tool Gateway before every external tool call. Returns whether the call is allowed or blocked with violation details.

(
    data: ScopeCheckRequest,
    db: Annotated[AsyncSession, Depends(get_db)],
)

Source from the content-addressed store, hash-verified

511 description="Validate a proposed tool call against an ExecutionToken's scope.",
512)
513async def check_scope(
514 data: ScopeCheckRequest,
515 db: Annotated[AsyncSession, Depends(get_db)],
516) -> ScopeCheckResponse:
517 """
518 Validate a tool call against an ExecutionToken's scope.
519
520 Called by the Tool Gateway before every external tool call.
521 Returns whether the call is allowed or blocked with violation details.
522 """
523 svc = ExecutionTokenService(db)
524 return await svc.check_scope(data)
525
526
527@_token.post(

Callers

nothing calls this directly

Calls 2

check_scopeMethod · 0.95

Tested by

no test coverage detected