MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / sanitizeToolUseId

Function sanitizeToolUseId

src/utils/tool-id.ts:13–15  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

11 * Replaces any invalid character with underscore.
12 */
13export function sanitizeToolUseId(id: string): string {
14 return id.replace(/[^a-zA-Z0-9_-]/g, "_")
15}
16
17/**
18 * Truncate a call_id to fit within OpenAI's 64-character limit.

Callers 6

tool-id.spec.tsFile · 0.90
deduplicateToolUseBlocksFunction · 0.90
presentAssistantMessageFunction · 0.90
pushToolResultFunction · 0.90
sanitizeOpenAiCallIdFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by 1

deduplicateToolUseBlocksFunction · 0.72