{"record":{"id":"3e8103c459afa92c","repo":"microsoft/semantic-kernel","slug":"the-specified-function-function-id-is-not-availa","errorCode":null,"errorMessage":"The specified function {function.Id} is not available in the kernel.","messagePattern":"The specified function (.+?) is not available in the kernel\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/Abstractions/Extensions/AgentDefinitionExtensions.cs","lineNumber":48,"sourceCode":"            ExtensionData = agentDefinition.Model?.Options ?? new Dictionary<string, object>()\n        };\n\n        // Enable automatic function calling if functions are defined.\n        var functions = agentDefinition.GetToolDefinitions(FunctionType);\n        if (functions is not null)\n        {\n            List<KernelFunction> kernelFunctions = [];\n            foreach (var function in functions)\n            {\n                var nameParts = FunctionName.Parse(function.Id!, FunctionNameSeparator);\n\n                // Look up the function in the kernel.\n                if (kernel.Plugins.TryGetFunction(nameParts.PluginName, nameParts.Name, out var kernelFunction))\n                {\n                    kernelFunctions.Add(kernelFunction);\n                    continue;\n                }\n                throw new KernelException($\"The specified function {function.Id} is not available in the kernel.\");\n            }\n\n            executionSettings.FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(kernelFunctions);\n        }\n\n        var arguments = new KernelArguments(executionSettings);\n        if (agentDefinition?.Inputs is not null)\n        {\n            // Add default arguments for the agent\n            foreach (var keyValuePair in agentDefinition.Inputs)\n            {\n                if (keyValuePair.Value.Default is not null)\n                {\n                    arguments.Add(keyValuePair.Key, keyValuePair.Value.Default);\n                }\n            }\n        }\n","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/Abstractions/Extensions/AgentDefinitionExtensions.cs#L30-L66","documentation":"Thrown by AgentDefinitionExtensions.GetDefaultKernelArguments when a function tool referenced in the AgentDefinition cannot be found in the kernel's plugin collection. The function.Id is parsed via FunctionName.Parse using '.' as the separator into PluginName and Name, then kernel.Plugins.TryGetFunction is called; if it returns false, this KernelException is thrown.","triggerScenarios":"An agent definition lists function tools (type \"function\") with ids like \"MyPlugin.MyFunction\", but the kernel has no plugin named \"MyPlugin\" or no function named \"MyFunction\" within it. The function id format is \"PluginName.FunctionName\" separated by a dot.","commonSituations":"Plugin not registered on the kernel before GetDefaultKernelArguments is called. Mismatched plugin/function names between the definition file and the registered KernelPlugin. Function id missing the plugin prefix (just \"MyFunction\" with no dot). Typo in the definition. Plugins registered under a different name than expected.","solutions":["Register the plugin on the kernel with the exact name used in the function id: kernel.Plugins.AddFromType<MyPlugin>(\"MyPlugin\").","Verify the function id in the definition matches \"PluginName.FunctionName\" format.","Check that the function method exists in the plugin class and is decorated/registered correctly.","Call kernel.Plugins.TryGetFunction(pluginName, funcName, out _) in a debug step to verify registration."],"exampleFix":"// before — definition has tool id \"SearchPlugin.Search\"\n// but kernel has no plugin named SearchPlugin\n\n// after\nvar kernel = new Kernel();\nkernel.Plugins.AddFromType<SearchPlugin>(\"SearchPlugin\");","handlingStrategy":"validation","validationCode":"foreach (var func in definition.GetToolDefinitions(\"function\") ?? [])\n{\n    var parts = FunctionName.Parse(func.Id!, \".\");\n    if (!kernel.Plugins.TryGetFunction(parts.PluginName, parts.Name, out _))\n    {\n        throw new InvalidOperationException(\n            $\"Function '{func.Id}' is not registered in the kernel.\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var args = definition.GetDefaultKernelArguments(kernel);\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"not available in the kernel\"))\n{\n    _logger.LogError(\"Missing kernel function: {Message}\", ex.Message);\n    throw;\n}","preventionTips":["Register all referenced plugins on the kernel before calling GetDefaultKernelArguments.","Use consistent naming between definition files and plugin registration.","Write a startup validation that checks all function tool ids resolve to kernel functions."],"tags":["agent-definition","plugins","function-calling","kernalexception"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}