/** * Tool call handler function type */ type ToolCallHandler = (request: { params: { name: string; _meta?: any; arguments?: Record; }; method: string; }) => Promise; /** * Wrap a tool call handler with OpenTelemetry tracing * Creates a span for each tool invocation with detailed attributes * * @param handler - The original tool call handler function * @returns Wrapped handler with tracing instrumentation */ export declare function withTelemetry(handler: ToolCallHandler): ToolCallHandler; /** * Create a manual span for non-tool operations * Useful for tracing other server operations outside of tool calls * * @param name - Span name * @param fn - Function to execute within the span * @returns Result of the function */ export declare function withSpan(name: string, attributes: Record, fn: () => Promise): Promise; /** * Add custom attributes to the current active span * Useful for adding context during tool execution * * @param attributes - Key-value pairs to add to the span */ export declare function addSpanAttributes(attributes: Record): void; /** * Record an event on the current active span * Useful for tracking significant moments during tool execution * * @param name - Event name * @param attributes - Optional event attributes */ export declare function recordSpanEvent(name: string, attributes?: Record): void; export {};