ToolOutputEnvelope
IntelligenceX.Tools
Standard tool output envelope helpers.
Inheritance
- object
- ToolOutputEnvelope
Remarks
Tools return a string payload to the model. To keep outputs machine-readable and UI-friendly, tools should return a JSON envelope with consistent top-level fields.
Methods
public static string Error(string errorCode, string error, IEnumerable<string>? hints = null, bool isTransient = false, JsonObject? meta = null) #Serializes an error envelope (ok=false) as JSON.
Parameters
- errorCode string
- error string
- hints System.Collections.Generic.IEnumerable<string>? = null
- isTransient bool = false
- meta IntelligenceX.Json.JsonObject? = null
Returns
stringpublic static JsonObject ErrorObject(string errorCode, string error, IEnumerable<string>? hints = null, bool isTransient = false, JsonObject? meta = null) #Creates an error envelope (ok=false).
Parameters
- errorCode string
- Stable, machine-readable error code.
- error string
- Human-readable error message.
- hints System.Collections.Generic.IEnumerable<string>? = null
- Optional remediation hints.
- isTransient bool = false
- Whether the failure is likely transient (retryable).
- meta IntelligenceX.Json.JsonObject? = null
- Optional structured error metadata (for example meta.error.category).
Returns
JsonObjectpublic static string Ok(JsonObject? data = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonObject? render = null) #Serializes a success envelope (ok=true) as JSON.
Parameters
- data IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonObject? = null
Returns
stringpublic static string OkFlat(JsonObject? root = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonObject? render = null) #Serializes a flat success envelope (ok=true) as JSON.
Parameters
- root IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonObject? = null
Returns
stringpublic static JsonObject OkFlatObject(JsonObject? root = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonObject? render = null) #Creates a success envelope (ok=true) where tool-specific fields are placed at the root level.
Parameters
- root IntelligenceX.Json.JsonObject? = null
- Optional tool-specific fields to merge into the root object.
- meta IntelligenceX.Json.JsonObject? = null
- Optional metadata (paging, truncation, counts, etc.).
- summaryMarkdown string? = null
- Optional human-readable markdown summary for UI display.
- render IntelligenceX.Json.JsonObject? = null
- Optional UI render hints (tables, columns, types, etc.).
Returns
JsonObjectpublic static JsonObject OkFlatObjectWithRenderValue(JsonObject? root = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonValue? render = null) #Creates a success envelope (ok=true) where tool-specific fields are placed at the root level and render can be either an object or an array.
Parameters
- root IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonValue? = null
Returns
JsonObjectpublic static string OkFlatWithRenderValue(JsonObject? root = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonValue? render = null) #Serializes a flat success envelope (ok=true) as JSON where render can be either an object or an array.
Parameters
- root IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonValue? = null
Returns
stringpublic static JsonObject OkObject(JsonObject? data = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonObject? render = null) #Creates a success envelope (ok=true).
Parameters
- data IntelligenceX.Json.JsonObject? = null
- Optional data payload.
- meta IntelligenceX.Json.JsonObject? = null
- Optional metadata (paging, truncation, counts, etc.).
- summaryMarkdown string? = null
- Optional human-readable markdown summary for UI display.
- render IntelligenceX.Json.JsonObject? = null
- Optional UI render hints (tables, columns, types, etc.).
Returns
JsonObjectpublic static JsonObject OkObjectWithRenderValue(JsonObject? data = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonValue? render = null) #Creates a success envelope (ok=true) where render can be either an object or an array.
Parameters
- data IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonValue? = null
Returns
JsonObjectpublic static string OkWithRenderValue(JsonObject? data = null, JsonObject? meta = null, string? summaryMarkdown = null, JsonValue? render = null) #Serializes a success envelope (ok=true) as JSON where render can be either an object or an array.
Parameters
- data IntelligenceX.Json.JsonObject? = null
- meta IntelligenceX.Json.JsonObject? = null
- summaryMarkdown string? = null
- render IntelligenceX.Json.JsonValue? = null
Returns
string