.NET API
AgentParameterValidator
Tracon.Core.dllValidates an AgentDefinition’s parameter schema, and validates a run’s supplied values against it.
public static class AgentParameterValidatorInheritance
Section titled “Inheritance”object ← AgentParameterValidator
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Two independent checks live here, run at two different times:
- AgentParameterValidator.ValidateSchema - compile-time self-consistency of the schema against the instructions text. Runs inside AgentDefinitionCompiler, so
POST /api/agents,PUT /api/agents/{name}, andPOST /api/agents/validateall inherit it through the compile step they already run. - AgentParameterValidator.ValidateValues - run-time check of a request’s parameter values against the schema.
POST /api/agents/{name}/runandPOST /api/agents/{name}/estimateboth call this same method, so a missing or unknown parameter produces the identical error on both endpoints.
Fields
Section titled “Fields”MissingParameterCode
Section titled “ MissingParameterCode”Error code: a required parameter has neither a supplied value nor a default.
public const string MissingParameterCode = "missing_parameter"Field Value
Section titled “Field Value”UnknownParameterCode
Section titled “ UnknownParameterCode”Error code: a supplied value’s name is not declared in the schema.
public const string UnknownParameterCode = "unknown_parameter"Field Value
Section titled “Field Value”ValueTooLongCode
Section titled “ ValueTooLongCode”Error code: a supplied value exceeds the configured maximum length.
public const string ValueTooLongCode = "value_too_long"Field Value
Section titled “Field Value”Methods
Section titled “Methods”ValidateSchema(AgentDefinition)
Section titled “ ValidateSchema(AgentDefinition)”Checks a definition’s parameter schema against its own instructions text.
public static IReadOnlyList<string> ValidateSchema(AgentDefinition definition)Parameters
Section titled “Parameters”definition AgentDefinition
The definition being compiled.
Returns
Section titled “Returns”One message per violation; empty when the schema is self-consistent. A
definition with an empty AgentDefinition.Parameters list
is never checked against its text - {{...}} is plain text for an
agent that declares no parameters at all, and stays that way (no
surprise for the agents that never opt into this feature).
ValidateValues(IReadOnlyList<AgentParameter>, IReadOnlyDictionary<string, string>?, int?)
Section titled “ ValidateValues(IReadOnlyList<AgentParameter>, IReadOnlyDictionary<string, string>?, int?)”Checks a run’s supplied parameter values against a definition’s schema.
public static AgentParameterValidationResult ValidateValues(IReadOnlyList<AgentParameter> schema, IReadOnlyDictionary<string, string>? values, int? maxValueLength = null)Parameters
Section titled “Parameters”schema IReadOnlyList<AgentParameter>
The target agent’s parameter schema.
values IReadOnlyDictionary<string, string>?
The values a run request supplied. null means none.
maxValueLength int?
The largest UTF-8 byte count a supplied value may have. null means no limit (the default, kept for a caller that predates this check).
Returns
Section titled “Returns”AgentParameterValidationResult
The validation outcome.
Exceptions
Section titled “Exceptions”schema is null.