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

Function mcpQueryFor

src/utils/suggestions/slackChannelSuggestions.ts:129–135  ·  view source on GitHub ↗
(searchToken: string)

Source from the content-addressed store, hash-verified

127// locally. This keeps the query maximally specific (avoiding the 20-result
128// cap) while never sending a partial word that kills the search.
129function mcpQueryFor(searchToken: string): string {
130 const lastSep = Math.max(
131 searchToken.lastIndexOf('-'),
132 searchToken.lastIndexOf('_'),
133 )
134 return lastSep > 0 ? searchToken.slice(0, lastSep) : searchToken
135}
136
137// Find a cached entry whose key is a prefix of mcpQuery and still has
138// matches for searchToken. Lets typing "c"→"cl"→"cla" reuse the "c" cache

Callers 1

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected