import type { CompatibleRequestHandlerExtra, MCPAnalyticsData, MCPRequestLike, McpEvent } from '../types'; /** * Helpers shared by the low-level (`instrument-lowlevel.ts`) and high-level * (`instrument-highlevel.ts`) MCP server wrappers. Extracted so both paths stay in sync — any change to * "what counts as an error result", "how do we resolve customer event * properties", "where do we find the context argument", or "how do we measure * duration" needs to land in one place. */ /** * MCP tool results signal errors by setting `isError: true` on the result * object rather than throwing. Detect that consistently. */ export declare function isToolResultError(result: unknown): boolean; /** * Resolves the `eventProperties` callback (if configured) and stamps the * result onto the event. No-op when the callback is absent or returns nullish. */ export declare function applyResolvedMetadata(event: McpEvent, data: MCPAnalyticsData, request: MCPRequestLike, extra?: CompatibleRequestHandlerExtra): Promise; /** * Reads the SDK-injected `context` argument off a tool-call request. Returns * the trimmed string when present, otherwise `undefined`. */ export declare function getContextArgument(request: MCPRequestLike): string | undefined; /** * Wall-clock duration of a tracked operation in milliseconds, from `event.timestamp` * to now. Returns `0` when timestamp is missing so callers don't have to null-check. */ export declare function getEventDuration(event: McpEvent): number; //# sourceMappingURL=tracing-helpers.d.ts.map