MCPcopy Index your code
hub / github.com/simstudioai/sim / getHeader

Function getHeader

apps/sim/connectors/gmail/gmail.ts:189–193  ·  view source on GitHub ↗

* Gets a header value from a Gmail message payload.

(payload: GmailMessagePart | undefined, name: string)

Source from the content-addressed store, hash-verified

187 * Gets a header value from a Gmail message payload.
188 */
189function getHeader(payload: GmailMessagePart | undefined, name: string): string | undefined {
190 if (!payload?.headers) return undefined
191 const header = payload.headers.find((h) => h.name.toLowerCase() === name.toLowerCase())
192 return header?.value
193}
194
195/**
196 * Formats a thread's messages into a single document string.

Callers 1

formatThreadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected