cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
handler_types.hpp File Reference

Public server handler callback type aliases. More...

Go to the source code of this file.

Typedefs

using mcp::server::ToolHandler = std::function< core::Result< protocol::ToolResult >(const ToolContext &)>
 Application callback that executes a tool.
 
using mcp::server::PromptHandler = std::function< core::Result< protocol::PromptsGetResult >(const PromptContext &)>
 Application callback that renders a prompt.
 
using mcp::server::ResourceReadHandler = std::function< core::Result< protocol::ResourcesReadResult >(const ResourceContext &)>
 Application callback that reads a resource.
 

Detailed Description

Public server handler callback type aliases.

Typedef Documentation

◆ PromptHandler

using mcp::server::PromptHandler = typedef std::function<core::Result<protocol::PromptsGetResult>( const PromptContext&)>

Application callback that renders a prompt.

Returns
A prompt result, or a core::Error propagated to the caller.

◆ ResourceReadHandler

using mcp::server::ResourceReadHandler = typedef std::function<core::Result<protocol::ResourcesReadResult>( const ResourceContext&)>

Application callback that reads a resource.

Returns
Resource contents, or a core::Error propagated to the caller.

◆ ToolHandler

using mcp::server::ToolHandler = typedef std::function<core::Result<protocol::ToolResult>(const ToolContext&)>

Application callback that executes a tool.

Returns
A ToolResult, or a core::Error propagated to the caller.