Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/tiger/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,8 @@ Examples:
for _, entry := range logs {
line := entry.Message
if !entry.Timestamp.IsZero() {
line = entry.Timestamp.UTC().Format("2006-01-02 15:04:05 UTC") + " " + line
// Local timezone for terminal output; MCP and public API use UTC.
line = entry.Timestamp.Local().Format("2006-01-02 15:04:05 MST") + " " + line
}
fmt.Fprintln(outputWriter, colorizeLogEntry(line, entry.Severity, shouldColorize))
}
Expand Down
21 changes: 7 additions & 14 deletions internal/tiger/mcp/service_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,7 @@ func (ServiceLogsInput) Schema() *jsonschema.Schema {

// ServiceLogsOutput represents output for service_logs
type ServiceLogsOutput struct {
Entries []serviceLogEntryOutput `json:"entries" jsonschema:"Structured log entries with timestamp, message, and severity, ordered from oldest to newest"`
}

// serviceLogEntryOutput is the MCP output shape for a single log entry.
type serviceLogEntryOutput struct {
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Severity string `json:"severity"`
Logs []string `json:"logs" jsonschema:"Log lines ordered from oldest to newest. Each line is prefixed with an RFC3339 timestamp followed by the log message."`
}

func (ServiceLogsOutput) Schema() *jsonschema.Schema {
Expand Down Expand Up @@ -1184,14 +1177,14 @@ func (s *Server) handleServiceLogs(ctx context.Context, req *mcp.CallToolRequest
return nil, ServiceLogsOutput{}, err
}

structured := make([]serviceLogEntryOutput, len(entries))
logs := make([]string, len(entries))
for i, e := range entries {
structured[i] = serviceLogEntryOutput{
Timestamp: e.Timestamp,
Message: e.Message,
Severity: e.Severity,
if !e.Timestamp.IsZero() {
logs[i] = e.Timestamp.UTC().Format("2006-01-02 15:04:05 UTC") + " " + e.Message
} else {
logs[i] = e.Message
}
}

return nil, ServiceLogsOutput{Entries: structured}, nil
return nil, ServiceLogsOutput{Logs: logs}, nil
}
Loading