# Function buildTimeoutResponse

- buildTimeoutResponse(
  toolName: string,
  timeoutMs: number | undefined,
  ): ToolResult

  Builds a structured non-error timeout response.

  Instead of returning `isError: true` (which causes MCP clients to retry the same slow request), this returns a well-formed success response with explicit timeout indicators and OSINT-standard metadata so callers can reliably distinguish a timeout from a normal successful analysis result.

  The payload preserves the backwards-compatible `data: []` and `'@context': []` fields, while also including standard OSINT output fields such as `confidenceLevel`, `methodology`, `dataFreshness`, and `sourceAttribution`.

  #### Parameters

  - toolName: string

    Name of the tool that timed out

  - timeoutMs: number | undefined

    Configured timeout duration (if known)

  #### Returns ToolResult

  MCP-compliant ToolResult without `isError` — clients treat this as a successful timeout outcome and will not retry automatically.

  - Defined in tools/shared/errorHandler.ts:113