diff --git a/dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs b/dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs index b640e08d8e6..cce582b1be4 100644 --- a/dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs +++ b/dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs @@ -99,7 +99,8 @@ private static AIFunctionArguments ConvertToFunctionArguments(JsonElement? argum if (arguments.Value.ValueKind != JsonValueKind.Object) { throw new InvalidOperationException( - $"Inline skill scripts expect arguments as a JSON object but received a JSON element of kind '{arguments.Value.ValueKind}'."); + $"Inline skill scripts expect arguments as a JSON object but received a JSON element of kind '{arguments.Value.ValueKind}'. " + + "Configure a custom argument marshaler on the skill to handle other argument formats."); } var dict = new Dictionary(); diff --git a/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/SkillScriptArgumentMarshalerTests.cs b/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/SkillScriptArgumentMarshalerTests.cs index 325ba3f826c..bfc39ec3add 100644 --- a/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/SkillScriptArgumentMarshalerTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/SkillScriptArgumentMarshalerTests.cs @@ -99,6 +99,7 @@ public async Task DefaultMarshaler_StringArguments_ThrowsAsync() var ex = await Assert.ThrowsAsync( () => script.RunAsync(skill, element, null, CancellationToken.None)); Assert.Contains("String", ex.Message); + Assert.Contains("custom argument marshaler", ex.Message); } [Fact]