![]() |
ezEngine Release 26.9
|
Base class for everything that the MCP server exposes to AI agents. More...
#include <McpTool.h>

Public Member Functions | |
| virtual void | OnActivate () |
| Called once, right after the provider was instantiated. Use it to hook into the editor. | |
| virtual void | OnDeactivate () |
| Called once, before the provider is destroyed. | |
| virtual void | GetSupportedTools (ezDynamicArray< ezMcpToolDesc > &out_tools) const =0 |
| Appends the description of every tool that this provider implements. | |
| virtual void | Execute (ezStringView sToolName, const ezVariantDictionary &arguments, ezMcpToolResult &out_result)=0 |
| Executes one of the tools returned by GetSupportedTools(). | |
Public Member Functions inherited from ezReflectedClass | |
| virtual const ezRTTI * | GetDynamicRTTI () const |
| bool | IsInstanceOf (const ezRTTI *pType) const |
| Returns whether the type of this instance is of the given type or derived from it. | |
| template<typename T > | |
| EZ_ALWAYS_INLINE bool | IsInstanceOf () const |
| Returns whether the type of this instance is of the given type or derived from it. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ezNoBase | |
| static const ezRTTI * | GetStaticRTTI () |
Base class for everything that the MCP server exposes to AI agents.
One provider offers one or more tools, which is why they are grouped: 'log_write' and 'log_read' share a ring buffer, so they belong to the same object.
Providers are found through reflection, so any plugin can add its own simply by deriving from this class - there is no list to register with. The plugin only has to link against the Mcp library, which works on both sides: an editor plugin adds editor tools, a runtime plugin adds tools to the game process. See ezMcpLogTool for the smallest complete example.
Everything happens on the main thread, so implementations may touch the host directly.
|
pure virtual |
Executes one of the tools returned by GetSupportedTools().
| sToolName | The tool to run. A provider with a single tool may ignore this. |
| arguments | The 'arguments' object of the call. Missing and mistyped values are normal - the client is an AI and will get this wrong. Validate and report through out_result. |
Implemented in ezMcpActionTool, ezMcpAssetTool, ezMcpCppTool, ezMcpDocumentTool, ezMcpObjectTool, ezMcpProjectTool, ezMcpSelectionTool, ezMcpAppTool, ezMcpCVarTool, ezMcpLogTool, ezMcpRttiTool, ezMcpEngineAppTool, ezMcpGameTool, and ezMcpInputTool.
|
pure virtual |
Appends the description of every tool that this provider implements.
Implemented in ezMcpActionTool, ezMcpAssetTool, ezMcpCppTool, ezMcpDocumentTool, ezMcpObjectTool, ezMcpProjectTool, ezMcpSelectionTool, ezMcpAppTool, ezMcpCVarTool, ezMcpLogTool, ezMcpRttiTool, ezMcpEngineAppTool, ezMcpGameTool, and ezMcpInputTool.
|
inlinevirtual |
Called once, right after the provider was instantiated. Use it to hook into the editor.
Reimplemented in ezMcpAssetTool, ezMcpLogTool, and ezMcpInputTool.
|
inlinevirtual |
Called once, before the provider is destroyed.
Reimplemented in ezMcpAssetTool, ezMcpLogTool, ezMcpEngineAppTool, and ezMcpInputTool.