Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mcp_tool_message Struct Reference

Message sent from a tool (response/notification). More...

#include <zephyr/net/mcp/mcp_server.h>

Data Fields

enum mcp_tool_msg_type type
 Type of message.
int length
 Message length.
void * data
 Message data pointer.
bool is_error
 Signifies if message is error.

Detailed Description

Message sent from a tool (response/notification).

This structure is used to submit tool execution results back to the MCP server.

Note
For tool responses (MCP_USR_TOOL_RESPONSE):
  • data should point to a plain text string containing the tool result. The server wraps this into a single MCP TextContent item automatically.
  • Maximum length is CONFIG_MCP_TOOL_RESULT_MAX_LEN.
  • is_error should be set to true if the tool execution failed.
  • Example: .data = "Tool execution result"

Field Documentation

◆ data

void* mcp_tool_message::data

Message data pointer.

◆ is_error

bool mcp_tool_message::is_error

Signifies if message is error.

◆ length

int mcp_tool_message::length

Message length.

◆ type

enum mcp_tool_msg_type mcp_tool_message::type

Type of message.


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