common

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package common holds functions and structs that are used throughout all other packages in this repository. It mainly provides utils functions, and MCP models.

Index

Constants

View Source
const (
	// AgentClaude is the supported public agent identifier for the Claude CLI.
	AgentClaude = "claude"
	// AgentGemini is the supported public agent identifier for the Gemini CLI.
	AgentGemini = "gemini"
	// AgentCodex is the supported public agent identifier for the Codex CLI.
	AgentCodex = "codex"
	// AgentCodexOllama is the supported public agent identifier for Codex OSS mode via Ollama.
	AgentCodexOllama = "codex-ollama"
)
View Source
const (
	// ModelCodexGPT54 is the canonical Codex GPT-5.4 model identifier.
	ModelCodexGPT54 = "gpt-5.4"
	// ModelCodexGPT54Mini is the canonical Codex GPT-5.4 Mini model identifier.
	ModelCodexGPT54Mini = "gpt-5.4-mini"
	// ModelClaudeHaiku is the canonical Claude Haiku model identifier used by the CLI.
	ModelClaudeHaiku = "haiku"
	// ModelClaudeSonnet is the canonical Claude Sonnet model identifier used by the CLI.
	ModelClaudeSonnet = "sonnet"
	// ModelClaudeOpus is the canonical Claude Opus model identifier used by the CLI.
	ModelClaudeOpus = "opus"
	// ModelGemini31ProPreview is the canonical Gemini 3.1 Pro preview model identifier.
	ModelGemini31ProPreview = "gemini-3.1-pro-preview"
	// ModelGemini3FlashPreview is the canonical Gemini 3 Flash preview model identifier.
	ModelGemini3FlashPreview = "gemini-3-flash-preview"
	// ModelGemini25Flash is the canonical Gemini 2.5 Flash model identifier.
	ModelGemini25Flash = "gemini-2.5-flash"
)

Variables

View Source
var ErrReadinessTimeout = errors.New("timed out waiting for readiness")

ErrReadinessTimeout reports that a readiness probe did not succeed before its deadline.

Functions

func AllocateFreePort added in v0.4.0

func AllocateFreePort() (string, error)

AllocateFreePort reserves an ephemeral localhost port and returns its port number.

func AnyMap added in v0.4.0

func AnyMap(value any) map[string]any

AnyMap returns value when it is already a JSON-like object map.

func BestTime added in v0.4.0

func BestTime(primary, fallback time.Time) time.Time

BestTime prefers primary when set and otherwise falls back to the alternate timestamp.

func CloneStringMap added in v0.4.0

func CloneStringMap(parameters map[string]string) map[string]string

CloneStringMap returns a shallow copy of parameters and preserves nil/empty as an empty map.

func CloseLogger

func CloseLogger() error

CloseLogger closes the global logger.

func ConvertViaJSON added in v0.4.0

func ConvertViaJSON[In any, Out any](value *In) (*Out, error)

ConvertViaJSON converts one pointer value into another JSON-compatible shape via marshal/unmarshal.

func CopyDir added in v0.4.0

func CopyDir(src, dst string) error

CopyDir recursively copies a directory tree into dst.

func CopyFile added in v0.4.0

func CopyFile(src, dst string) error

CopyFile copies one file into the destination path, creating parent directories first.

func CountBy added in v0.4.0

func CountBy[T any](values []T, predicate func(T) bool) int

CountBy returns the number of values matching predicate.

func DebugLoggingEnabled added in v0.0.4

func DebugLoggingEnabled() bool

DebugLoggingEnabled returns true when the global logger will emit debug logs.

func DurationSeconds added in v0.4.0

func DurationSeconds(durationMillis *int64, start, end time.Time) float64

DurationSeconds prefers persisted duration millis and falls back to wall-clock timestamps.

func EarliestNonZeroInt64 added in v0.4.0

func EarliestNonZeroInt64(values ...int64) int64

EarliestNonZeroInt64 returns the smallest non-zero value, or zero when all inputs are zero.

func EndpointReturnsExpected added in v0.4.0

func EndpointReturnsExpected(client *http.Client, endpoint string, expected func(resp *http.Response, err error) bool) bool

EndpointReturnsExpected wraps a GET request in a caller-provided readiness predicate.

func EnsureExistingPathUnderRoot added in v0.4.0

func EnsureExistingPathUnderRoot(root, relativePath, fieldName, rootName string) error

EnsureExistingPathUnderRoot validates that relativePath exists under root.

func FirstNonEmpty added in v0.4.0

func FirstNonEmpty(values ...string) string

FirstNonEmpty returns the first non-blank string in values.

func Float64PtrFromAny added in v0.4.0

func Float64PtrFromAny(value any) *float64

Float64PtrFromAny converts a loosely typed numeric field into *float64.

func GetCurrentWorkingDir

func GetCurrentWorkingDir() string

GetCurrentWorkingDir gets the current working directory.

func GetSecondsFromInt

func GetSecondsFromInt(i int) time.Duration

GetSecondsFromInt returns a duration (in seconds) for a provided int value.

func InitInternalLogger added in v0.0.4

func InitInternalLogger(options LoggerOptions) error

InitInternalLogger initializes or replaces the global logger.

func Int64PtrFromAny added in v0.4.0

func Int64PtrFromAny(value any) *int64

Int64PtrFromAny converts a loosely typed numeric field into *int64.

func IntPtrFromAny added in v0.4.0

func IntPtrFromAny(value any) *int

IntPtrFromAny converts a loosely typed numeric field into *int.

func IsEndpointReachable added in v0.4.0

func IsEndpointReachable(client *http.Client, endpoint string) bool

IsEndpointReachable reports whether an endpoint responds without a server-side failure.

func IsJSONEndpointReady added in v0.4.0

func IsJSONEndpointReady(client *http.Client, endpoint string) bool

IsJSONEndpointReady reports whether an endpoint is ready to serve successful JSON responses.

func IsURLCompliant

func IsURLCompliant(name string) bool

IsURLCompliant checks if a name is URL-safe (alphanumeric, dash, underscore only). Names must start with alphanumeric character and can contain alphanumeric, dash, or underscore. This ensures names can be safely used in URL paths like /mcp/<gateway>/<server>.

func JSONGenericValue added in v0.4.0

func JSONGenericValue(value any) (any, error)

JSONGenericValue round-trips a typed Go value through JSON into generic maps/slices/scalars.

func JoinTrimmed added in v0.4.0

func JoinTrimmed(left, right, separator string) string

JoinTrimmed concatenates two trimmed values with separator.

func JoinTrimmedIfRight added in v0.4.0

func JoinTrimmedIfRight(left, right, separator string) string

JoinTrimmedIfRight concatenates two trimmed values when right is non-empty.

func LastNonEmpty added in v0.4.0

func LastNonEmpty(values []string) string

LastNonEmpty returns the last non-blank string in values.

func LaterTime added in v0.4.0

func LaterTime(current, candidate time.Time) time.Time

LaterTime keeps the later of two timestamps while tolerating zero current values.

func LatestNonZeroInt64 added in v0.4.0

func LatestNonZeroInt64(values ...int64) int64

LatestNonZeroInt64 returns the largest non-zero value, or zero when all inputs are zero.

func LogDebug

func LogDebug(message string, args ...interface{})

LogDebug logs a debug message using the global logger.

func LogError

func LogError(message string, args ...interface{})

LogError logs an error message using the global logger.

func LogInfo

func LogInfo(message string, args ...interface{})

LogInfo logs an info message using the global logger.

func LogWarn

func LogWarn(message string, args ...interface{})

LogWarn logs a warning message using the global logger.

func MedianFloat added in v0.4.0

func MedianFloat(values []float64) float64

MedianFloat returns the median of values, or zero when the slice is empty.

func MedianInt added in v0.4.0

func MedianInt(values []int) int

MedianInt returns the median integer value, or zero for empty slices.

func MedianInt64 added in v0.4.0

func MedianInt64(values []int64) int64

MedianInt64 returns the median int64 value, or zero for empty slices.

func NonEmptyStrings added in v0.4.0

func NonEmptyStrings(values ...string) []string

NonEmptyStrings returns trimmed values and drops blank entries.

func NormalizeCSVList added in v0.4.0

func NormalizeCSVList(values []string) []string

NormalizeCSVList splits comma-separated values, trims blanks, and preserves first-seen order.

func NormalizeSlug added in v0.4.0

func NormalizeSlug(value string) string

NormalizeSlug lowercases free-form labels into stable filesystem-safe segments.

func NowUTC added in v0.4.0

func NowUTC() time.Time

NowUTC returns the current time in UTC.

func ParseInt64 added in v0.4.0

func ParseInt64(value any) (int64, bool)

ParseInt64 accepts common JSON number encodings used in logs and payloads.

func PressEnterToContinue added in v0.0.2

func PressEnterToContinue(message string)

PressEnterToContinue prints the text "Press enter to continue..." and waits for an enter to continue the program flow.

func ProcessExists added in v0.4.0

func ProcessExists(pid int) bool

ProcessExists reports whether the current OS still sees the given PID.

func Ratio added in v0.4.0

func Ratio(numerator, denominator int) float64

Ratio returns numerator divided by denominator, or zero when denominator is empty.

func ReadJSONFile added in v0.4.0

func ReadJSONFile(path string, target any) error

ReadJSONFile reads JSON from disk into target.

func ReadYAMLFile added in v0.4.0

func ReadYAMLFile(path string, target any) error

ReadYAMLFile reads YAML from disk into target.

func ResolveExistingDirUnderRoot added in v0.4.0

func ResolveExistingDirUnderRoot(root, relativePath, fieldName, rootName string) (string, error)

ResolveExistingDirUnderRoot validates that relativePath exists under root and is a directory.

func ResolveExistingFileUnderRoot added in v0.4.0

func ResolveExistingFileUnderRoot(root, relativePath, fieldName, rootName string) (string, error)

ResolveExistingFileUnderRoot validates that relativePath exists under root and is a file.

func ResolvePathUnderRoot added in v0.4.0

func ResolvePathUnderRoot(root, relativePath, fieldName, rootName string) (string, error)

ResolvePathUnderRoot resolves a relative path and rejects paths escaping the named root.

func ShellQuote added in v0.4.0

func ShellQuote(value string) string

ShellQuote wraps a path in single quotes for copy-paste shell commands.

func SortedSetValues added in v0.4.0

func SortedSetValues(set map[string]struct{}) []string

SortedSetValues returns deterministic, sorted values from a string set.

func SortedStringsCopy added in v0.4.0

func SortedStringsCopy(values []string) []string

SortedStringsCopy returns a sorted copy of values and preserves empty input as nil.

func StringValue added in v0.4.0

func StringValue(value any) string

StringValue converts string-like JSON fields without failing hard on other types.

func SumInts added in v0.4.0

func SumInts(values []int) int

SumInts returns the total of values.

func TimeFromUnixMillis added in v0.4.0

func TimeFromUnixMillis(value int64) time.Time

TimeFromUnixMillis converts persisted unix milliseconds into UTC time.

func TimeFromUnixMillisOrFallback added in v0.4.0

func TimeFromUnixMillisOrFallback(primary *int64, fallback int64) time.Time

TimeFromUnixMillisOrFallback resolves a nullable unix-millis field with a required fallback timestamp.

func TimePointerMillis added in v0.4.0

func TimePointerMillis(value time.Time) *int64

TimePointerMillis converts a non-zero timestamp into a nullable unix-millis pointer.

func TrimOutput added in v0.4.0

func TrimOutput(value string) string

TrimOutput limits surfaced command output to a readable tail section.

func TruncateString added in v0.4.0

func TruncateString(value string, limit int) string

TruncateString shortens value to limit runes and appends an ellipsis when truncation occurs.

func ValidateUniqueTrimmedStrings added in v0.4.0

func ValidateUniqueTrimmedStrings(field string, values []string) error

ValidateUniqueTrimmedStrings rejects blank values and duplicates after trimming whitespace.

func WaitForReadiness added in v0.4.0

func WaitForReadiness(
	client *http.Client,
	timeout time.Duration,
	interval time.Duration,
	hook func() error,
	ready func(*http.Client) bool,
) error

WaitForReadiness polls ready until it succeeds, hook returns an error, or the timeout elapses.

func WriteJSONFile added in v0.4.0

func WriteJSONFile(path string, value any) error

WriteJSONFile writes pretty-printed JSON and creates parent directories as needed.

func WritePIDFile added in v0.4.0

func WritePIDFile(path string, pid int) error

WritePIDFile writes one process ID to disk with a trailing newline.

Types

type AuthContext added in v0.0.5

type AuthContext struct {
	Authenticated         bool   `json:"authenticated"`
	PrincipalID           string `json:"principal_id,omitempty"`
	PrincipalType         string `json:"principal_type,omitempty"` // e.g. "api_key"
	KeyID                 string `json:"key_id,omitempty"`
	Gateway               string `json:"gateway,omitempty"`
	AuthHeader            string `json:"auth_header,omitempty"`
	CredentialFingerprint string `json:"credential_fingerprint,omitempty"`
	InternalSessionID     string `json:"internal_session_id,omitempty"`
	TransportSessionID    string `json:"transport_session_id,omitempty"`
}

AuthContext captures authenticated principal information for a request.

This context is intended for policy, compliance, and processor-level decisions. It must never include raw credentials.

type BaseMcpEvent

type BaseMcpEvent struct {

	// Indicates the event status - is related to http status codes:
	// 20x - ok
	// 40x - expected error - client might be able to resolve it by rephrasing the query
	// 50x - unexpected error - proxy ran into unexpected error.
	Status int `json:"status"`

	// Timestamp is the exact time when the log entry was created.
	Timestamp time.Time `json:"timestamp"`

	// Transport identifies the proxy type: "stdio", "http", "websocket".
	Transport string `json:"transport"`

	// RequestID uniquely identifies a single request/response pair.
	RequestID string `json:"request_id"`

	// SessionID groups multiple requests within the same proxy session.
	SessionID string `json:"session_id,omitempty"`

	// ServerID uniquely identifies the MCP server instance handling this request.
	ServerID string `json:"server_id,omitempty"`

	// Direction indicates the communication flow perspective:
	// "request" (client→server),
	// "response" (server→client), or
	// "system" (proxy lifecycle events).
	// This field remains stable regardless of success/failure status.
	Direction McpEventDirection `json:"direction"`

	// MessageType categorizes the content/outcome: "request", "response", "error", or "system".
	// Unlike Direction, this changes to "error" for failed responses, enabling filtering.
	// by operational status (e.g., "all errors" vs "all responses regardless of success").
	// This orthogonal design supports both flow analysis (Direction) and status monitoring (MessageType).
	MessageType McpMessageType `json:"message_type"`

	// Success indicates whether the operation completed successfully.
	Success bool `json:"success"`

	// Error contains error details if Success is false.
	Error string `json:"error,omitempty"`

	// ProcessingErrors indicate errors during processing of this event.
	ProcessingErrors map[string]error `json:"-"`

	// Metadata holds additional context-specific key-value pairs.
	Metadata map[string]string `json:"metadata,omitempty"`

	// Modified indicates that the event has been modified at least once since being received.
	Modified bool `json:"modified"`
}

BaseMcpEvent holds the core metadata common to all MCP events regardless of transport type.

This struct contains fields for tracking request flow, timing, status, and contextual information that apply universally across stdio, HTTP, and other transport mechanisms.

type EventAnnotation added in v0.4.3

type EventAnnotation struct {
	Type      string                   `json:"type,omitempty"`
	Processor string                   `json:"processor,omitempty"`
	Action    string                   `json:"action,omitempty"`
	Category  string                   `json:"category,omitempty"`
	Severity  string                   `json:"severity,omitempty"`
	Message   string                   `json:"message,omitempty"`
	Findings  []EventAnnotationFinding `json:"findings,omitempty"`
	Details   map[string]any           `json:"details,omitempty"`
}

EventAnnotation describes a processor observation or policy action for an event.

type EventAnnotationFinding added in v0.4.3

type EventAnnotationFinding struct {
	Rule string `json:"rule,omitempty"`
	Path string `json:"path,omitempty"`
}

EventAnnotationFinding identifies a specific annotation finding.

type InternalLogger

type InternalLogger struct {
	// contains filtered or unexported fields
}

InternalLogger provides basic logging functionality to .centian folder.

func (*InternalLogger) Close

func (l *InternalLogger) Close() error

Close closes the log file.

func (*InternalLogger) Debug

func (l *InternalLogger) Debug(message string, args ...interface{})

Debug logs a debug message.

func (*InternalLogger) Error

func (l *InternalLogger) Error(message string, args ...interface{})

Error logs an error message.

func (*InternalLogger) Info

func (l *InternalLogger) Info(message string, args ...interface{})

Info logs an info message.

func (*InternalLogger) Warn

func (l *InternalLogger) Warn(message string, args ...interface{})

Warn logs a warning message.

type LogEntry added in v0.1.0

type LogEntry struct {
	BaseMcpEvent
	Routing     RoutingContext    `json:"routing"`
	ToolCall    *ToolCallLog      `json:"tool_call,omitempty"`
	Annotations []EventAnnotation `json:"annotations,omitempty"`
}

LogEntry is the enriched log payload written to the Centian JSONL log.

func (*LogEntry) GetBaseEvent added in v0.1.0

func (e *LogEntry) GetBaseEvent() BaseMcpEvent

GetBaseEvent returns the BaseMcpEvent.

func (*LogEntry) SetStatus added in v0.1.0

func (e *LogEntry) SetStatus(status int)

SetStatus sets the status code for this log entry.

func (*LogEntry) WithToolRequest added in v0.1.0

func (e *LogEntry) WithToolRequest(name, originalName string, args json.RawMessage) *LogEntry

WithToolRequest attaches name, originalName and args on ToolCall of this LogEntry.

func (*LogEntry) WithToolResult added in v0.1.0

func (e *LogEntry) WithToolResult(result json.RawMessage, isError bool) *LogEntry

WithToolResult attaches provided result and isError status on ToolCall of this LogEntry.

type LogLevel added in v0.0.4

type LogLevel int

LogLevel defines the minimum severity that is written by the internal logger.

type LoggerOptions added in v0.0.4

type LoggerOptions struct {
	Level         string
	Output        string
	FilePath      string
	ConsoleWriter io.Writer
}

LoggerOptions configures the global internal logger.

type McpEventDirection

type McpEventDirection string

McpEventDirection represents the event direction, e.g. CLIENT to SERVER, CENTIAN to CLIENT etc.

const (
	// DirectionClientToServer represents the direction: CLIENT -> SERVER.
	DirectionClientToServer McpEventDirection = "[CLIENT -> SERVER]"

	// DirectionServerToClient represents the direction: SERVER -> CLIENT.
	DirectionServerToClient McpEventDirection = "[SERVER -> CLIENT]"

	// DirectionCentianToClient represents the direction: CENTIAN -> CLIENT,
	// e.g. when a response is returned early before being forwarded to.
	// the downstream MCP server.
	DirectionCentianToClient McpEventDirection = "[CENTIAN -> CLIENT]"

	// DirectionSystem represents a system event, not intended
	// to be forwarded to either CLIENT or SERVER.
	DirectionSystem McpEventDirection = "[SYSTEM]"

	// DirectionUnknown represents an unknown direction and is used
	// in case the direction is not one of the above!.
	DirectionUnknown McpEventDirection = "[UNKNOWN]"
)

func (McpEventDirection) MarshalJSON

func (m McpEventDirection) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding of McpEventDirection.

It maps the value to one of the allowed directions:

  • [CLIENT -> SERVER]
  • [SERVER -> CLIENT]
  • [CENTIAN -> CLIENT]
  • [SYSTEM]
  • [UNKNOWN] - in case none of the above fit

func (*McpEventDirection) UnmarshalJSON

func (m *McpEventDirection) UnmarshalJSON(b []byte) error
UnmarshalJSON parses the JSON-encoded data of McpEventDirection.

It maps the value to one of the allowed directions:

  • [CLIENT -> SERVER]
  • [SERVER -> CLIENT]
  • [CENTIAN -> CLIENT]
  • [SYSTEM]
  • [UNKNOWN] - in case none of the above fit

type McpMessageType

type McpMessageType string

McpMessageType represents the type if an MCP event, can be request, response, system, or unknown.

const (
	// MessageTypeRequest represents a request message type.
	MessageTypeRequest McpMessageType = "request"
	// MessageTypeResponse represents a response message type.
	MessageTypeResponse McpMessageType = "response"
	// MessageTypeSystem represents a system message type.
	MessageTypeSystem McpMessageType = "system"
	// MessageTypeUnknown represents a unknown message type.
	MessageTypeUnknown McpMessageType = "unknown"
)

func (McpMessageType) MarshalJSON

func (m McpMessageType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of McpMessageType.

func (*McpMessageType) UnmarshalJSON

func (m *McpMessageType) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the JSON-encoded data of McpMessageType.

type McpTransportType

type McpTransportType string

McpTransportType represents a valid MCP transport - either stdio or http.

const (
	// HTTPTransport represents HTTP transport -> "http".
	HTTPTransport McpTransportType = "http"

	// StdioTransport represents stdio transport -> "stdio".
	StdioTransport McpTransportType = "stdio"

	// UnknownTransport represents an unknown transport (e.g. error case).
	UnknownTransport McpTransportType = "unknown"

	// InvalidTransport represents a transport configuration that is invalid (e.g. URL and CMD are set).
	InvalidTransport McpTransportType = "invalid"
)

func GetTransport added in v0.0.3

func GetTransport(url, cmd string) (McpTransportType, error)

GetTransport returns the McpTransportType based on provided url and cmd fields.

type MetaContext added in v0.1.0

type MetaContext struct {
	BaseMcpEvent
	Annotations []EventAnnotation `json:"-"`
}

MetaContext contains processor-facing event metadata.

func NewMetaContext added in v0.1.0

func NewMetaContext(
	transport string,
	direction McpEventDirection,
	messageType McpMessageType,
) *MetaContext

NewMetaContext creates a new MetaContext with required fields initialized.

func NewRequestMetaContext added in v0.1.0

func NewRequestMetaContext(transport string) *MetaContext

NewRequestMetaContext creates a MetaContext for a request (client → server).

func (*MetaContext) GetBaseEvent added in v0.1.0

func (e *MetaContext) GetBaseEvent() BaseMcpEvent

GetBaseEvent returns the BaseMcpEvent.

func (*MetaContext) SetStatus added in v0.1.0

func (e *MetaContext) SetStatus(status int)

SetStatus sets the status code for this event.

func (*MetaContext) WithRequestID added in v0.1.0

func (e *MetaContext) WithRequestID(id string) *MetaContext

WithRequestID sets the request ID.

func (*MetaContext) WithServerID added in v0.1.0

func (e *MetaContext) WithServerID(id string) *MetaContext

WithServerID sets the server ID.

func (*MetaContext) WithSessionID added in v0.1.0

func (e *MetaContext) WithSessionID(id string) *MetaContext

WithSessionID sets the session ID.

type PromptDefinition added in v0.4.0

type PromptDefinition struct {
	Prompt string `yaml:"prompt"`
}

PromptDefinition is the common YAML-backed prompt file format used by demo and benchmark flows.

func LoadPromptDefinition added in v0.4.0

func LoadPromptDefinition(path string) (*PromptDefinition, error)

LoadPromptDefinition reads one YAML prompt file and validates that it contains a non-empty prompt body.

type RoutingContext

type RoutingContext struct {
	// Transport describes the used transport for this connection (http or stdio)
	Transport McpTransportType `json:"transport,omitempty"`

	// Gateway is the logical grouping of MCP servers
	Gateway string `json:"gateway,omitempty"`

	// ServerName identifies the specific MCP server
	ServerName string `json:"server_name,omitempty"`

	// Endpoint is the HTTP path or identifier for this proxy
	Endpoint string `json:"endpoint,omitempty"`

	// DownstreamURL is the target MCP server URL being proxied to
	DownstreamURL string `json:"downstream_url,omitempty"`

	// DownstreamCommand is the target MCP server command being proxied to
	DownstreamCommand string `json:"downstream_cmd,omitempty"`

	// Args is the target MCP server command args being used
	Args []string `json:"args,omitempty"`
}

RoutingContext captures where the request is going.

type ToolCallLog added in v0.0.3

type ToolCallLog struct {
	// Name is the tool name being called
	Name string `json:"name"`

	// OriginalName is the tool name before any namespace transformations
	OriginalName string `json:"original_name,omitempty"`

	// Arguments contains the tool call arguments as raw JSON
	Arguments json.RawMessage `json:"arguments,omitempty"`

	// Result contains the tool call result as raw JSON (for responses)
	Result json.RawMessage `json:"result,omitempty"`

	// IsError indicates if the tool call resulted in an error
	IsError bool `json:"is_error,omitempty"`
}

ToolCallLog captures tool call specific details.

Note: this is only filled for logging.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL