![]() |
ezEngine Release 26.9
|
The game process' half of the shared app_* tools, plus taking a screenshot. More...
#include <McpEngineAppTool.h>

Public Member Functions | |
| virtual void | OnDeactivate () override |
| Called once, before the provider is destroyed. | |
| virtual void | GetSupportedTools (ezDynamicArray< ezMcpToolDesc > &out_tools) const override |
| Appends the description of every tool that this provider implements. | |
| virtual void | Execute (ezStringView sToolName, const ezVariantDictionary &arguments, ezMcpToolResult &out_result) override |
| Executes one of the tools returned by GetSupportedTools(). | |
Public Member Functions inherited from ezMcpToolProvider | |
| virtual void | OnActivate () |
| Called once, right after the provider was instantiated. Use it to hook into the editor. | |
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. | |
Protected Member Functions | |
| virtual ezStringView | GetHostNoun () const override |
| What this process is, e.g. "editor" or "game". Used in the tool descriptions, so that an agent talking to two servers at once can tell which one it is addressing. | |
| virtual ezStringView | GetRelaunchHint () const override |
| How to start another process like this one, appended to app_quit's description. | |
| virtual ezStringView | GetBuildTimestamp () const override |
| When the binary serving MCP was compiled, reported by app_info as 'buildTimestamp'. | |
| virtual void | AddHostInfo (ezMcpJsonWriter &ref_writer) override |
| Anything host specific that app_info should report, added to the same object. | |
| virtual void | RequestQuit (bool bDiscardChanges) override |
| Actually shuts the process down. | |
Protected Member Functions inherited from ezMcpAppTool | |
| virtual ezResult | CanQuit (bool bDiscardChanges) |
| Whether quitting is allowed right now. Return EZ_FAILURE to refuse. | |
| virtual void | AddQuitRefusalInfo (ezMcpJsonWriter &ref_writer) |
| Explains a refusal from CanQuit(). Writes into the result object, after "quitting": false. | |
| virtual void | AddQuitInfo (ezMcpJsonWriter &ref_writer) |
| Anything worth reporting about a quit that is going ahead, e.g. what got discarded. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ezNoBase | |
| static const ezRTTI * | GetStaticRTTI () |
The game process' half of the shared app_* tools, plus taking a screenshot.
The process level questions - port, executable, command line, process id - are answered by the base class, so an agent driving both an editor and the game it runs asks them the same way in both. What is added here is what only a rendering, frame-stepping process can answer.
|
overrideprotectedvirtual |
Anything host specific that app_info should report, added to the same object.
Reimplemented from ezMcpAppTool.
|
overridevirtual |
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. |
Reimplemented from ezMcpAppTool.
|
overrideprotectedvirtual |
When the binary serving MCP was compiled, reported by app_info as 'buildTimestamp'.
Exists because a stale binary is indistinguishable from a missing feature: an agent working from a tools/list produced by a build from a few days ago reports tools as absent, and nothing in the protocol reveals the mismatch. Comparing this against when the source was last changed does.
The default is when the Mcp library itself was built. A host whose own plugin changes more often than the library should override this with its own DATE " " TIME - the tool list comes from the plugin, so that is the binary whose age actually explains a missing tool.
Reimplemented from ezMcpAppTool.
|
inlineoverrideprotectedvirtual |
What this process is, e.g. "editor" or "game". Used in the tool descriptions, so that an agent talking to two servers at once can tell which one it is addressing.
Implements ezMcpAppTool.
|
overrideprotectedvirtual |
How to start another process like this one, appended to app_quit's description.
Everything an agent needs has to be in the tool list - it has no repo access and no prior session - so this is where 'which executable, which arguments' gets said.
Implements ezMcpAppTool.
|
overridevirtual |
Appends the description of every tool that this provider implements.
Reimplemented from ezMcpAppTool.
|
overridevirtual |
Called once, before the provider is destroyed.
Reimplemented from ezMcpToolProvider.
|
overrideprotectedvirtual |
Actually shuts the process down.
Must defer the shutdown past the end of this call. The response has not reached the socket yet, so quitting synchronously drops it and leaves the caller waiting on a connection that closes with no answer - which is indistinguishable from a crash.
Implements ezMcpAppTool.