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

Function parseChannels

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

Source from the content-addressed store, hash-verified

85// Parse channel names from slack_search_channels text output.
86// The Slack MCP server returns markdown with "Name: #channel-name" lines.
87function parseChannels(text: string): string[] {
88 const channels: string[] = []
89 const seen = new Set<string>()
90
91 for (const line of text.split('\n')) {
92 const m = line.match(/^Name:\s*#?([a-z0-9][a-z0-9_-]{0,79})\s*$/)
93 if (m && !seen.has(m[1]!)) {
94 seen.add(m[1]!)
95 channels.push(m[1]!)
96 }
97 }
98
99 return channels
100}
101
102export function hasSlackMcpServer(clients: MCPServerConnection[]): boolean {
103 return findSlackClient(clients) !== undefined

Callers 1

fetchChannelsFunction · 0.85

Calls 3

hasMethod · 0.45
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected