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

Function sanitizeToolName

src/services/api/promptCacheBreakDetection.ts:183–185  ·  view source on GitHub ↗

MCP tool names are user-controlled (server config) and may leak filepaths. * Collapse them to 'mcp'; built-in names are a fixed vocabulary.

(name: string)

Source from the content-addressed store, hash-verified

181/** MCP tool names are user-controlled (server config) and may leak filepaths.
182 * Collapse them to 'mcp'; built-in names are a fixed vocabulary. */
183function sanitizeToolName(name: string): string {
184 return name.startsWith('mcp__') ? 'mcp' : name
185}
186
187function computePerToolHashes(
188 strippedTools: ReadonlyArray<unknown>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected