MCPcopy Create free account
hub / github.com/codeaashu/claude-code / unwrapResults

Function unwrapResults

src/utils/suggestions/slackChannelSuggestions.ts:73–83  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

71)
72
73function unwrapResults(text: string): string {
74 const trimmed = text.trim()
75 if (!trimmed.startsWith('{')) return text
76 try {
77 const parsed = resultsEnvelopeSchema().safeParse(jsonParse(trimmed))
78 if (parsed.success) return parsed.data.results
79 } catch {
80 // jsonParse threw — fall through
81 }
82 return text
83}
84
85// Parse channel names from slack_search_channels text output.
86// The Slack MCP server returns markdown with "Name: #channel-name" lines.

Callers 1

fetchChannelsFunction · 0.85

Calls 1

jsonParseFunction · 0.85

Tested by

no test coverage detected