|
cxxmcp 1.1.6
C++ MCP SDK
|
Registry of named MCP prompts and their handlers. More...
#include <registry.hpp>
Public Member Functions | |
| PromptRegistry (const PromptRegistry &other) | |
| PromptRegistry & | operator= (const PromptRegistry &other) |
| PromptRegistry (PromptRegistry &&other) noexcept | |
| PromptRegistry & | operator= (PromptRegistry &&other) noexcept |
| core::Result< core::Unit > | add (protocol::Prompt prompt, PromptHandler handler) |
| Register a prompt definition and handler. | |
| core::Result< protocol::PromptsGetResult > | get (std::string_view name, protocol::Json arguments, const std::string &session_id) const |
| Render a prompt with only a session id. | |
| core::Result< protocol::PromptsGetResult > | get (std::string_view name, protocol::Json arguments, const SessionContext &session_context) const |
| Render a prompt with full session metadata. | |
| core::Result< protocol::PromptsGetResult > | get (std::string_view name, protocol::Json arguments, const SessionContext &session_context, CancellationToken cancellation) const |
| std::vector< protocol::Prompt > | list () const |
| Return registered prompt definitions sorted by name. | |
Registry of named MCP prompts and their handlers.
PromptRegistry owns prompt metadata and handler callables. Handler invocation is synchronous, copied under the registry lock, invoked outside the lock, and errors are returned to the caller without translation.
| core::Result< core::Unit > mcp::server::PromptRegistry::add | ( | protocol::Prompt | prompt, |
| PromptHandler | handler | ||
| ) |
Register a prompt definition and handler.
| core::Result< protocol::PromptsGetResult > mcp::server::PromptRegistry::get | ( | std::string_view | name, |
| protocol::Json | arguments, | ||
| const SessionContext & | session_context | ||
| ) | const |
Render a prompt with full session metadata.