{"record":{"id":"2bb4e17c1cb62555","repo":"microsoft/semantic-kernel","slug":"non-string-grpc-operation-arguments-are-not-suppor","errorCode":null,"errorMessage":"Non-string gRPC operation arguments are not supported in Release Candidate 1. This feature will be available soon, but for now, please ensure that all arguments are strings. Operation '{operation.Name}' argument '{item.Key}' is of type '{item.Value?.GetType()}'.","messagePattern":"Non-string gRPC operation arguments are not supported in Release Candidate 1\\. This feature will be available soon, but for now, please ensure that all arguments are strings\\. Operation '(.+?)' argument '(.+?)' is of type '(.+?)'\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Functions/Functions.Grpc/GrpcOperationRunner.cs","lineNumber":131,"sourceCode":"    }\n\n    /// <summary>\n    /// Casts argument values of type object to string.\n    /// </summary>\n    /// <param name=\"arguments\">The kernel arguments to be cast.</param>\n    /// <param name=\"operation\">The gRPC operation.</param>\n    /// <returns>A dictionary of arguments with string values.</returns>\n    /// <exception cref=\"KernelException\">Thrown when an argument has an unsupported, non-string type.</exception>\n    private static Dictionary<string, string> CastToStringArguments(KernelArguments arguments, GrpcOperation operation)\n    {\n        return arguments.ToDictionary(item => item.Key, item =>\n        {\n            if (item.Value is string stringValue)\n            {\n                return stringValue;\n            }\n\n            throw new KernelException($\"Non-string gRPC operation arguments are not supported in Release Candidate 1. This feature will be available soon, but for now, please ensure that all arguments are strings. Operation '{operation.Name}' argument '{item.Key}' is of type '{item.Value?.GetType()}'.\");\n        });\n    }\n\n    /// <summary>\n    /// Converts gRPC response.\n    /// </summary>\n    /// <param name=\"response\">The response to convert.</param>\n    /// <param name=\"responseType\">The response type info.</param>\n    /// <returns>The converted response.</returns>\n    private static JsonObject ConvertResponse(object response, Type responseType)\n    {\n        var content = JsonSerializer.Serialize(response, responseType, s_camelCaseOptions);\n\n        //First iteration allowing to associate additional metadata with the returned content.\n        var result = new JsonObject\n        {\n            { \"content\", content },\n            { \"contentType\", \"application/json; charset=utf-8\" }","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Functions/Functions.Grpc/GrpcOperationRunner.cs#L113-L149","documentation":"Thrown by GrpcOperationRunner.CastToStringArguments when a value in the KernelArguments dictionary for a gRPC operation is not a `string`. The runner builds a `Dictionary<string,string>` and explicitly rejects non-string values, citing Release Candidate 1 limitations — this is a deliberate feature gate, not a generic type error.","triggerScenarios":"Supplying KernelArguments where one entry is an int, bool, object, etc., e.g. `arguments[\"count\"] = 5` instead of `\"5\"`, for any argument of a registered gRPC operation.","commonSituations":"Reusing arguments built for a native kernel function (which accept objects) with a gRPC plugin; reading args from JSON deserialization that produced typed values.","solutions":["Convert every argument value to string before invocation: `arguments[k] = value?.ToString()`.","Build KernelArguments with string values from the start for gRPC operations.","Check each value's type in a loop and stringify non-strings."],"exampleFix":"// before\narguments[\"limit\"] = 10;\nawait kernel.InvokeAsync(grpcPlugin[\"search\"]);\n// after\narguments[\"limit\"] = \"10\";\nawait kernel.InvokeAsync(grpcPlugin[\"search\"]);","handlingStrategy":"validation","validationCode":"// Stringify all arguments before invoking a gRPC operation:\nforeach (var k in arguments.Names.ToList()) {\n    if (arguments[k] is not string)\n        arguments[k] = arguments[k]?.ToString() ?? string.Empty;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat gRPC operation arguments as string-only by convention.","Add a wrapper that converts KernelArguments for gRPC plugins."],"tags":["grpc","arguments","type-mismatch"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}