# Function toolError

MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

- toolError(message: string): ToolResult

  Creates an error tool result.

  Back-compat alias for toolStructuredError — maps to the conservative `internal` / non-retryable envelope. New code should call `toolStructuredError` directly with the correct category; this alias exists so the ~64 legacy call sites keep working during the #2649 migration sweep.

  #### Parameters

  - message: string

    The error message

  #### Returns ToolResult

  A ToolResult with isError set to true and an `internal` envelope

  - Defined in packages/nexus-agents/src/mcp/tools/tool-result.ts:167