MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cappedList

Method cappedList

src/mcp/tools.ts:4622–4629  ·  view source on GitHub ↗
(words: string[], cap: number)

Source from the content-addressed store, hash-verified

4620 // Separate caps preserve the retry instruction and complete candidate
4621 // names even with long queries or generated identifiers.
4622 const cappedList = (words: string[], cap: number) => {
4623 const kept: string[] = [];
4624 for (const word of words) {
4625 if (list([...kept, word]).length > cap) break;
4626 kept.push(word);
4627 }
4628 return list(kept) + (kept.length < words.length ? ' …' : '');
4629 };
4630 explanation += '\nChecked indexed names, signatures, docstrings (FTS prefixes) and live name segments; not all source text.';
4631 if (miss.limited) explanation += '\nWord check limited to 16 words of at most 64 characters.';
4632 explanation += `\nNo lexical matches for checked words: ${cappedList(miss.unmatched, 250) || '(none)'}.`;

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
listFunction · 0.50

Tested by

no test coverage detected