{"record":{"id":"ff77407f9ad3cdc7","repo":"microsoft/semantic-kernel","slug":"function-function-name-not-found-in-plugin-p","errorCode":null,"errorMessage":"Function '{function_name}' not found in plugin '{plugin_name}'.","messagePattern":"Function '(.+?)' not found in plugin '(.+?)'\\.","errorType":"validation","errorClass":"AgentInitializationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/agent.py","lineNumber":1066,"sourceCode":"        if not kernel:\n            raise AgentInitializationException(\"Kernel instance is required for tool resolution.\")\n\n        for tool in tools_list:\n            tool_id = tool.get(\"id\")\n            if not tool_id or tool.get(\"type\") != \"function\":\n                continue\n\n            if \".\" not in tool_id:\n                raise AgentInitializationException(f\"Tool id '{tool_id}' must be in format PluginName.FunctionName\")\n\n            plugin_name, function_name = tool_id.split(\".\", 1)\n\n            plugin = kernel.plugins.get(plugin_name)\n            if not plugin:\n                raise AgentInitializationException(f\"Plugin '{plugin_name}' not found in kernel.\")\n\n            if function_name not in plugin.functions:\n                raise AgentInitializationException(f\"Function '{function_name}' not found in plugin '{plugin_name}'.\")\n\n\n# endregion\n","sourceCodeStart":1048,"sourceCodeEnd":1070,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/agent.py#L1048-L1070","documentation":"Thrown by _validate_tools when the plugin exists but the function name (the part after the '.') is not present in plugin.functions. The plugin namespace resolved, but the specific function it advertises is unknown to that plugin.","triggerScenarios":"Tool id `WebPlugin.search` where WebPlugin is registered but exposes functions named `query`/`fetch`, not `search`; renamed or removed function; wrong plugin chosen.","commonSituations":"Function renamed in the plugin source without updating the YAML; using a KernelPlugin built from a subset of functions; version drift where a function was dropped.","solutions":["Inspect `list(kernel.plugins['WebPlugin'].functions)` and correct the function name in the tool id to one that exists.","Re-add or expose the missing function on the plugin.","If the function lives in a different plugin, fix the plugin prefix in the id accordingly."],"exampleFix":"# before\n# yaml id: WebPlugin.search  (function is actually named 'query')\n\n# after\n# yaml id: WebPlugin.query","handlingStrategy":"validation","validationCode":"for t in spec.get('tools', []):\n    tid = t.get('id', '')\n    if t.get('type') != 'function' or '.' not in tid:\n        continue\n    plugin_name, func_name = tid.split('.', 1)\n    plugin = kernel.plugins.get(plugin_name)\n    assert plugin and func_name in plugin.functions, f'Function {func_name!r} missing from {plugin_name!r}'","typeGuard":"def function_is_registered(tool: dict, kernel) -> bool:\n    tid = tool.get('id', '')\n    if '.' not in tid:\n        return True\n    plugin_name, func_name = tid.split('.', 1)\n    plugin = kernel.plugins.get(plugin_name)\n    return plugin is not None and func_name in plugin.functions","tryCatchPattern":"from semantic_kernel.exceptions.agent_exceptions import AgentInitializationException\ntry:\n    agent = await AgentRegistry.create_from_yaml(yaml_str, kernel=kernel)\nexcept AgentInitializationException as e:\n    if 'not found in plugin' in str(e):\n        # correct the function name in the spec then retry\n        raise\n    raise","preventionTips":["Keep tool ids in sync with plugin function names after renames.","Inspect plugin.functions before loading a spec that references them."],"tags":["kernel","plugins","tools","validation","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}