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

Function extractToolInputForTelemetry

src/services/analytics/metadata.ts:291–303  ·  view source on GitHub ↗
(
  input: unknown,
)

Source from the content-addressed store, hash-verified

289 * Returns undefined when OTEL_LOG_TOOL_DETAILS is not enabled.
290 */
291export function extractToolInputForTelemetry(
292 input: unknown,
293): string | undefined {
294 if (!isToolDetailsLoggingEnabled()) {
295 return undefined
296 }
297 const truncated = truncateToolInputValue(input)
298 let json = jsonStringify(truncated)
299 if (json.length > TOOL_INPUT_MAX_JSON_CHARS) {
300 json = json.slice(0, TOOL_INPUT_MAX_JSON_CHARS) + '…[truncated]'
301 }
302 return json
303}
304
305/**
306 * Maximum length for file extensions to be logged.

Callers 1

Calls 3

truncateToolInputValueFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected