# Code Index Execution Scope

When defining a Custom Code Index, your logic runs within the CodeIndexExecutionScope. This scope provides access to the data being indexed.

# Code Index Scope

Property/Method Type Description
Graph / G Mosaik.GraphDB.Safe.Graph Access to the graph.
Query() / Q() IQuery Creates a new query.
ToIndex IReadOnlyList<UID128> The list of UIDs currently being indexed/processed.
CreateHttpClient() HttpClient Creates a pre-configured HTTP client for external requests.
Logger ILogger Logger instance.
CancellationToken CancellationToken Token for cancellation.
RunEndpointAsync<T> Task<T> Executes a code endpoint.
RunToolAsync Task<ToolCallResult> Runs a tool.