Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Session ¶
type Session interface {
// Logger returns a slog.Logger for structured logging during tool execution.
Logger() *slog.Logger
// Tracer returns the OpenTelemetry tracer for distributed tracing.
// May return nil if no tracer was configured.
Tracer() trace.Tracer
}
Session provides contextual services for tool execution, such as logging and distributed tracing. Use FromContext to retrieve the session injected by the server, or a safe no-op default if none is present.
func FromContext ¶
FromContext returns the Session injected into ctx for the current tool call. If no session is present (e.g. in unit tests that invoke Run directly), a no-op session backed by slog.Default() is returned.
Click to show internal directories.
Click to hide internal directories.