microsoft/semantic-kernel · error · ArgumentException
No arguments are provided for {fullyResolvedFunctionName}.
Error message
No arguments are provided for {fullyResolvedFunctionName}. What it means
Thrown when a Handlebars helper invoking a kernel function finds that the function has required parameters but no arguments were provided in the template call. The helper refuses to invoke the function because required inputs are missing.
Source
Thrown at dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs:77
handlebarsInstance,
fullyResolvedFunctionName,
(Context context, Arguments handlebarsArguments) =>
{
// Get the parameters from the template arguments
if (handlebarsArguments.Length is not 0)
{
if (handlebarsArguments[0].GetType() == typeof(HashParameterDictionary))
{
ProcessHashArguments(functionMetadata, executionContext, (IDictionary<string, object>)handlebarsArguments[0], nameDelimiter);
}
else
{
ProcessPositionalArguments(functionMetadata, executionContext, handlebarsArguments);
}
}
else if (functionMetadata.Parameters.Any(p => p.IsRequired))
{
throw new ArgumentException($"No arguments are provided for {fullyResolvedFunctionName}.");
}
KernelFunction function = kernel.Plugins.GetFunction(functionMetadata.PluginName, functionMetadata.Name);
// Invoke the function and write the result to the template
var result = InvokeKernelFunction(kernel, function, executionContext, cancellationToken);
if (!allowDangerouslySetContent && result is string resultAsString)
{
result = HttpUtility.HtmlEncode(resultAsString);
}
return result;
});
}
/// <summary>
/// Checks if handlebars argument is a valid type for the function parameter.View on GitHub (pinned to c028a0c7dc)
Solutions
- Update the Handlebars template to pass all required parameters (e.g., {{Plugin-Function param="value"}}).
- Verify the function's required parameters via its metadata and ensure each is supplied in the template.
- If a parameter is optional, mark it IsRequired=false in the function definition.
Example fix
// before
{{MyPlugin-DoWork}}
// after
{{MyPlugin-DoWork input="hello" count=3}} Defensive patterns
Strategy: validation
Validate before calling
var requiredParams = functionMetadata.Parameters.Where(p => p.IsRequired).ToList();
if (requiredParams.Count > 0 && argumentsSupplied == 0)
throw new InvalidOperationException($"Function {functionMetadata.Name} requires: {string.Join(", ", requiredParams.Select(p => p.Name))}."); Type guard
public static bool HasAllRequiredArgs(KernelFunctionMetadata meta, IEnumerable<string> supplied) =>
meta.Parameters.Where(p => p.IsRequired).All(p => supplied.Contains(p.Name)); Try / catch
try
{
var result = await template.RenderAsync(kernel, arguments).ConfigureAwait(false);
}
catch (ArgumentException ex) when (ex.Message.Contains("No arguments are provided"))
{
_logger.LogError(ex, "Template function call missing required arguments.");
throw;
} Prevention
- Review function metadata required parameters when authoring templates.
- Keep templates in sync with function signature changes.
- Lint templates against function metadata in CI.
When it happens
Trigger: In KernelFunctionHelpers, when a function metadata has parameters with IsRequired and the template neither supplied hash arguments nor positional arguments, the code throws before attempting invocation.
Common situations: Writing a Handlebars template that calls a function helper without passing the required arguments, or mismatching the function signature (renamed/removed parameters) so the template no longer supplies them.
Related errors
- Invalid argument type for function {functionMetadata.Name}.
- Parameter {param.Name} is required for function {functionMet
- Invalid parameter type for function {functionMetadata.Name}.
- Invalid parameter count for function {functionMetadata.Name}
- Argument '{propertyName}' has a value that doesn't support a
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/4f8a9e46ba3f9a8c.
Report an issue: GitHub.