MCPcopy
hub / github.com/TanStack/ai / stripExternalPrefix

Function stripExternalPrefix

packages/ai-code-mode/src/create-discovery-tool.ts:37–41  ·  view source on GitHub ↗

* Strip a single leading `external_` prefix so the model can pass either the * catalog name (`external_fetchStocks`) or the bare name (`fetchStocks`).

(name: string)

Source from the content-addressed store, hash-verified

35 * catalog name (`external_fetchStocks`) or the bare name (`fetchStocks`).
36 */
37function stripExternalPrefix(name: string): string {
38 return name.startsWith(EXTERNAL_PREFIX)
39 ? name.slice(EXTERNAL_PREFIX.length)
40 : name
41}
42
43/**
44 * Build the `discover_tools` sibling tool for Code Mode lazy tools. The model

Callers 1

createDiscoveryToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected