ezEngine Release 26.9
Loading...
Searching...
No Matches
ezMcpToolResult Struct Reference

The result of one tool call. More...

#include <McpTool.h>

Public Member Functions

void SetError (ezStringView sMessage)
 

Public Attributes

ezStringBuilder m_sText
 
bool m_bIsError = false
 If true, the client is told the call failed. The text should then say why.
 
bool m_bNotFinished = false
 Set this to have the call re-run later instead of answered now.
 

Detailed Description

The result of one tool call.

Member Data Documentation

◆ m_bNotFinished

bool ezMcpToolResult::m_bNotFinished = false

Set this to have the call re-run later instead of answered now.

For a tool that has to wait for the host to make progress - most obviously 'run for N frames', which cannot happen while the tool itself is holding the main thread. Setting this leaves the client waiting on its connection and re-enters the tool with the same arguments the next time the host pumps, until a call finally leaves it false.

The tool therefore has to keep its own 'where was I' state across those calls, and has to give up on its own after a timeout: a host that stops pumping is indistinguishable from one that is still working, and a wait that never ends looks exactly like a hang.

Only meaningful in a host that pumps repeatedly. m_sText is ignored while this is true.

◆ m_sText

ezStringBuilder ezMcpToolResult::m_sText

The text handed back to the client. For structured data just write JSON in here - MCP has no separate typed result, everything is text content.


The documentation for this struct was generated from the following file: