Skip to main content
Glama

Slack MCP

MIT License
696
  • Apple
  • Linux
fasttime.go1.08 kB
package fasttime import ( "errors" "strconv" "strings" "time" ) type Time time.Time func (t *Time) UnmarshalJSON(data []byte) error { clean := strings.Trim(string(data), `"`) if clean == "" || clean == "null" { *t = Time{} return nil } ts, err := TS2int(clean) if err != nil { return err } *t = Time(Int2Time(ts)) return nil } func (t Time) MarshalJSON() ([]byte, error) { ts := time.Time(t).UnixMicro() return []byte(`"` + Int2TS(ts) + `"`), nil } // SlackString returns the time as a slack timestamp (i.e. "1234567890.123456"). func (t Time) SlackString() string { return Int2TS(time.Time(t).UnixMicro()) } var ErrNotATimestamp = errors.New("not a slack timestamp") // Int2TS converts an int64 to a slack timestamp by inserting a dot in the // right place. func Int2TS(ts int64) string { const cut = 6 s := strconv.FormatInt(ts, 10) l := len(s) if l < cut+1 { return "" } lo := s[l-cut:] hi := s[:l-cut] return hi + "." + lo } // Int2Time converts an int64 to a time.Time. func Int2Time(ts int64) time.Time { return time.UnixMicro(ts) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/korotovsky/slack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server