MCPcopy Create free account
hub / github.com/Noumena-Network/code / extractToolInputForTelemetry

Function extractToolInputForTelemetry

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

truncateToolInputValueFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected