cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
handler_types.hpp
Go to the documentation of this file.
1// Copyright (c) 2025 [caomengxuan666]
2
3#pragma once
4
7
8#include <functional>
9
15
16namespace mcp::server {
17
21 std::function<core::Result<protocol::ToolResult>(const ToolContext&)>;
22
25using PromptHandler = std::function<core::Result<protocol::PromptsGetResult>(
26 const PromptContext&)>;
27
31 std::function<core::Result<protocol::ResourcesReadResult>(
32 const ResourceContext&)>;
33
34} // namespace mcp::server
Server-side handler invocation contexts.
std::function< core::Result< protocol::ToolResult >(const ToolContext &)> ToolHandler
Application callback that executes a tool.
Definition handler_types.hpp:21
std::function< core::Result< protocol::ResourcesReadResult >(const ResourceContext &)> ResourceReadHandler
Application callback that reads a resource.
Definition handler_types.hpp:32
std::function< core::Result< protocol::PromptsGetResult >(const PromptContext &)> PromptHandler
Application callback that renders a prompt.
Definition handler_types.hpp:26
Prompt discovery and rendering payloads.
Resource listing, template, subscription, and read payloads.
Shared result and error primitives used by the public cxxmcp SDK.
Invocation context passed to prompt handlers.
Definition context.hpp:46
Invocation context passed to resource read handlers.
Definition context.hpp:60
Invocation context passed to tool handlers.
Definition context.hpp:30
Tool definition, call, and result payloads.