ToolOutputEnvelope
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, Boolean isTransient = false, JsonObject meta = null) #StringSerializes an error envelope (ok=false) as JSON.
Parameters
- errorCode System.String
- error System.String
- hints System.Collections.Generic.IEnumerable{System.String} = null
- isTransient System.Boolean = false
- meta IntelligenceX.Json.JsonObject = null
public static JsonObject ErrorObject(String errorCode, String error, IEnumerable<String> hints = null, Boolean isTransient = false, JsonObject meta = null) #JsonObjectCreates an error envelope (ok=false).
Parameters
- errorCode System.String
- Stable, machine-readable error code.
- error System.String
- Human-readable error message.
- hints System.Collections.Generic.IEnumerable{System.String} = null
- Optional remediation hints.
- isTransient System.Boolean = false
- Whether the failure is likely transient (retryable).
- meta IntelligenceX.Json.JsonObject = null
- Optional structured error metadata (for example meta.error.category).
public static String Ok(JsonObject data = null, JsonObject meta = null, String summaryMarkdown = null, JsonObject render = null) #StringSerializes a success envelope (ok=true) as JSON.
Parameters
- data IntelligenceX.Json.JsonObject = null
- meta IntelligenceX.Json.JsonObject = null
- summaryMarkdown System.String = null
- render IntelligenceX.Json.JsonObject = null
public static String OkFlat(JsonObject root = null, JsonObject meta = null, String summaryMarkdown = null, JsonObject render = null) #StringSerializes a flat success envelope (ok=true) as JSON.
Parameters
- root IntelligenceX.Json.JsonObject = null
- meta IntelligenceX.Json.JsonObject = null
- summaryMarkdown System.String = null
- render IntelligenceX.Json.JsonObject = null
public static JsonObject OkFlatObject(JsonObject root = null, JsonObject meta = null, String summaryMarkdown = null, JsonObject render = null) #JsonObjectCreates 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 System.String = null
- Optional human-readable markdown summary for UI display.
- render IntelligenceX.Json.JsonObject = null
- Optional UI render hints (tables, columns, types, etc.).
public static JsonObject OkFlatObjectWithRenderValue(JsonObject root = null, JsonObject meta = null, String summaryMarkdown = null, JsonValue render = null) #JsonObjectCreates 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 System.String = null
- render IntelligenceX.Json.JsonValue = null
public static String OkFlatWithRenderValue(JsonObject root = null, JsonObject meta = null, String summaryMarkdown = null, JsonValue render = null) #StringSerializes 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 System.String = null
- render IntelligenceX.Json.JsonValue = null
public static JsonObject OkObject(JsonObject data = null, JsonObject meta = null, String summaryMarkdown = null, JsonObject render = null) #JsonObjectCreates 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 System.String = null
- Optional human-readable markdown summary for UI display.
- render IntelligenceX.Json.JsonObject = null
- Optional UI render hints (tables, columns, types, etc.).
public static JsonObject OkObjectWithRenderValue(JsonObject data = null, JsonObject meta = null, String summaryMarkdown = null, JsonValue render = null) #JsonObjectCreates 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 System.String = null
- render IntelligenceX.Json.JsonValue = null
public static String OkWithRenderValue(JsonObject data = null, JsonObject meta = null, String summaryMarkdown = null, JsonValue render = null) #StringSerializes 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 System.String = null
- render IntelligenceX.Json.JsonValue = null