> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Function nemo_relay_pop_scope

> Pop a scope from the scope stack by its handle.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

<pre />

Pop a scope from the scope stack by its handle.

This emits a scope End event and removes scope-local registrations owned by the popped scope.

## Parameters

* `handle`: The current top-of-stack scope handle to pop.
* `output_json`: Optional null-terminated JSON string exported as semantic scope output on the end event, or null.
* `metadata_json`: Optional null-terminated JSON metadata string recorded on the end event, or null. Incoming metadata is merged over metadata stored on the scope handle.
* `timestamp_unix_micros`: Optional Unix microseconds timestamp for the end event, or null to use the runtime default end timestamp.

## Errors

Returns `InvalidJson` for invalid output or metadata JSON, `InvalidArg` when `timestamp_unix_micros` is outside the supported timestamp range, or an error status when `handle` is not the current top scope.

## Safety

`handle` must be a valid, non-null `FfiScopeHandle` pointer. Optional pointer arguments may be null; when non-null, they must be valid for reads for the duration of the call.