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
- Variables
- func AllocateFreePort() (string, error)
- func AnyMap(value any) map[string]any
- func BestTime(primary, fallback time.Time) time.Time
- func CloneStringMap(parameters map[string]string) map[string]string
- func CloseLogger() error
- func ConvertViaJSON[In any, Out any](value *In) (*Out, error)
- func CopyDir(src, dst string) error
- func CopyFile(src, dst string) error
- func CountBy[T any](values []T, predicate func(T) bool) int
- func DebugLoggingEnabled() bool
- func DurationSeconds(durationMillis *int64, start, end time.Time) float64
- func EarliestNonZeroInt64(values ...int64) int64
- func EndpointReturnsExpected(client *http.Client, endpoint string, ...) bool
- func EnsureExistingPathUnderRoot(root, relativePath, fieldName, rootName string) error
- func FirstNonEmpty(values ...string) string
- func Float64PtrFromAny(value any) *float64
- func GetCurrentWorkingDir() string
- func GetSecondsFromInt(i int) time.Duration
- func InitInternalLogger(options LoggerOptions) error
- func Int64PtrFromAny(value any) *int64
- func IntPtrFromAny(value any) *int
- func IsEndpointReachable(client *http.Client, endpoint string) bool
- func IsJSONEndpointReady(client *http.Client, endpoint string) bool
- func IsURLCompliant(name string) bool
- func JSONGenericValue(value any) (any, error)
- func JoinTrimmed(left, right, separator string) string
- func JoinTrimmedIfRight(left, right, separator string) string
- func LastNonEmpty(values []string) string
- func LaterTime(current, candidate time.Time) time.Time
- func LatestNonZeroInt64(values ...int64) int64
- func LogDebug(message string, args ...interface{})
- func LogError(message string, args ...interface{})
- func LogInfo(message string, args ...interface{})
- func LogWarn(message string, args ...interface{})
- func MedianFloat(values []float64) float64
- func MedianInt(values []int) int
- func MedianInt64(values []int64) int64
- func NonEmptyStrings(values ...string) []string
- func NormalizeCSVList(values []string) []string
- func NormalizeSlug(value string) string
- func NowUTC() time.Time
- func ParseInt64(value any) (int64, bool)
- func PressEnterToContinue(message string)
- func ProcessExists(pid int) bool
- func Ratio(numerator, denominator int) float64
- func ReadJSONFile(path string, target any) error
- func ReadYAMLFile(path string, target any) error
- func ResolveExistingDirUnderRoot(root, relativePath, fieldName, rootName string) (string, error)
- func ResolveExistingFileUnderRoot(root, relativePath, fieldName, rootName string) (string, error)
- func ResolvePathUnderRoot(root, relativePath, fieldName, rootName string) (string, error)
- func ShellQuote(value string) string
- func SortedSetValues(set map[string]struct{}) []string
- func SortedStringsCopy(values []string) []string
- func StringValue(value any) string
- func SumInts(values []int) int
- func TimeFromUnixMillis(value int64) time.Time
- func TimeFromUnixMillisOrFallback(primary *int64, fallback int64) time.Time
- func TimePointerMillis(value time.Time) *int64
- func TrimOutput(value string) string
- func TruncateString(value string, limit int) string
- func ValidateUniqueTrimmedStrings(field string, values []string) error
- func WaitForReadiness(client *http.Client, timeout time.Duration, interval time.Duration, ...) error
- func WriteJSONFile(path string, value any) error
- func WritePIDFile(path string, pid int) error
- type AuthContext
- type BaseMcpEvent
- type EventAnnotation
- type EventAnnotationFinding
- type InternalLogger
- func (l *InternalLogger) Close() error
- func (l *InternalLogger) Debug(message string, args ...interface{})
- func (l *InternalLogger) Error(message string, args ...interface{})
- func (l *InternalLogger) Info(message string, args ...interface{})
- func (l *InternalLogger) Warn(message string, args ...interface{})
- type LogEntry
- type LogLevel
- type LoggerOptions
- type McpEventDirection
- type McpMessageType
- type McpTransportType
- type MetaContext
- type PromptDefinition
- type RoutingContext
- type ToolCallLog
Constants ¶
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" )
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 ¶
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
AllocateFreePort reserves an ephemeral localhost port and returns its port number.
func BestTime ¶ added in v0.4.0
BestTime prefers primary when set and otherwise falls back to the alternate timestamp.
func CloneStringMap ¶ added in v0.4.0
CloneStringMap returns a shallow copy of parameters and preserves nil/empty as an empty map.
func ConvertViaJSON ¶ added in v0.4.0
ConvertViaJSON converts one pointer value into another JSON-compatible shape via marshal/unmarshal.
func CopyFile ¶ added in v0.4.0
CopyFile copies one file into the destination path, creating parent directories first.
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
DurationSeconds prefers persisted duration millis and falls back to wall-clock timestamps.
func EarliestNonZeroInt64 ¶ added in v0.4.0
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
EnsureExistingPathUnderRoot validates that relativePath exists under root.
func FirstNonEmpty ¶ added in v0.4.0
FirstNonEmpty returns the first non-blank string in values.
func Float64PtrFromAny ¶ added in v0.4.0
Float64PtrFromAny converts a loosely typed numeric field into *float64.
func GetCurrentWorkingDir ¶
func GetCurrentWorkingDir() string
GetCurrentWorkingDir gets the current working directory.
func GetSecondsFromInt ¶
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
Int64PtrFromAny converts a loosely typed numeric field into *int64.
func IntPtrFromAny ¶ added in v0.4.0
IntPtrFromAny converts a loosely typed numeric field into *int.
func IsEndpointReachable ¶ added in v0.4.0
IsEndpointReachable reports whether an endpoint responds without a server-side failure.
func IsJSONEndpointReady ¶ added in v0.4.0
IsJSONEndpointReady reports whether an endpoint is ready to serve successful JSON responses.
func IsURLCompliant ¶
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
JSONGenericValue round-trips a typed Go value through JSON into generic maps/slices/scalars.
func JoinTrimmed ¶ added in v0.4.0
JoinTrimmed concatenates two trimmed values with separator.
func JoinTrimmedIfRight ¶ added in v0.4.0
JoinTrimmedIfRight concatenates two trimmed values when right is non-empty.
func LastNonEmpty ¶ added in v0.4.0
LastNonEmpty returns the last non-blank string in values.
func LaterTime ¶ added in v0.4.0
LaterTime keeps the later of two timestamps while tolerating zero current values.
func LatestNonZeroInt64 ¶ added in v0.4.0
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
MedianFloat returns the median of values, or zero when the slice is empty.
func MedianInt ¶ added in v0.4.0
MedianInt returns the median integer value, or zero for empty slices.
func MedianInt64 ¶ added in v0.4.0
MedianInt64 returns the median int64 value, or zero for empty slices.
func NonEmptyStrings ¶ added in v0.4.0
NonEmptyStrings returns trimmed values and drops blank entries.
func NormalizeCSVList ¶ added in v0.4.0
NormalizeCSVList splits comma-separated values, trims blanks, and preserves first-seen order.
func NormalizeSlug ¶ added in v0.4.0
NormalizeSlug lowercases free-form labels into stable filesystem-safe segments.
func ParseInt64 ¶ added in v0.4.0
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
ProcessExists reports whether the current OS still sees the given PID.
func Ratio ¶ added in v0.4.0
Ratio returns numerator divided by denominator, or zero when denominator is empty.
func ReadJSONFile ¶ added in v0.4.0
ReadJSONFile reads JSON from disk into target.
func ReadYAMLFile ¶ added in v0.4.0
ReadYAMLFile reads YAML from disk into target.
func ResolveExistingDirUnderRoot ¶ added in v0.4.0
ResolveExistingDirUnderRoot validates that relativePath exists under root and is a directory.
func ResolveExistingFileUnderRoot ¶ added in v0.4.0
ResolveExistingFileUnderRoot validates that relativePath exists under root and is a file.
func ResolvePathUnderRoot ¶ added in v0.4.0
ResolvePathUnderRoot resolves a relative path and rejects paths escaping the named root.
func ShellQuote ¶ added in v0.4.0
ShellQuote wraps a path in single quotes for copy-paste shell commands.
func SortedSetValues ¶ added in v0.4.0
SortedSetValues returns deterministic, sorted values from a string set.
func SortedStringsCopy ¶ added in v0.4.0
SortedStringsCopy returns a sorted copy of values and preserves empty input as nil.
func StringValue ¶ added in v0.4.0
StringValue converts string-like JSON fields without failing hard on other types.
func TimeFromUnixMillis ¶ added in v0.4.0
TimeFromUnixMillis converts persisted unix milliseconds into UTC time.
func TimeFromUnixMillisOrFallback ¶ added in v0.4.0
TimeFromUnixMillisOrFallback resolves a nullable unix-millis field with a required fallback timestamp.
func TimePointerMillis ¶ added in v0.4.0
TimePointerMillis converts a non-zero timestamp into a nullable unix-millis pointer.
func TrimOutput ¶ added in v0.4.0
TrimOutput limits surfaced command output to a readable tail section.
func TruncateString ¶ added in v0.4.0
TruncateString shortens value to limit runes and appends an ellipsis when truncation occurs.
func ValidateUniqueTrimmedStrings ¶ added in v0.4.0
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
WriteJSONFile writes pretty-printed JSON and creates parent directories as needed.
func WritePIDFile ¶ added in v0.4.0
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) 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) 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
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.