Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
mcp_results.h
1#ifndef SOURCEMETA_CORE_MCP_RESULTS_H_
2#define SOURCEMETA_CORE_MCP_RESULTS_H_
3
4#ifndef SOURCEMETA_CORE_MCP_EXPORT
5#include <sourcemeta/core/mcp_export.h>
6#endif
7
8#include <sourcemeta/core/json.h>
9#include <sourcemeta/core/mcp_capabilities.h>
10#include <sourcemeta/core/mcp_headers.h>
11#include <sourcemeta/core/mcp_protocol.h>
12
13#include <cstddef> // std::size_t
14#include <cstdint> // std::int64_t, std::uint8_t
15#include <optional> // std::optional, std::nullopt
16#include <ostream> // std::ostream
17#include <span> // std::span
18#include <utility> // std::unreachable
19#include <vector> // std::vector
20
21namespace sourcemeta::core {
22
28enum class MCPCacheScope : std::uint8_t {
34};
35
48[[nodiscard]] constexpr auto
50 switch (scope) {
52 return "public";
54 return "private";
55 }
56 // Clang settles that no other value arrives, so only GCC and MSVC
57 // need to be told that the end of this function is never reached
58#if !defined(__clang__)
59 std::unreachable();
60#endif
61}
62
76[[nodiscard]] constexpr auto
78 -> std::optional<MCPCacheScope> {
79 if (scope == "public") {
81 }
82 if (scope == "private") {
84 }
85 return std::nullopt;
86}
87
105
118 bool read_only = false;
120 bool destructive = true;
123 bool idempotent = false;
125 bool open_world = true;
126};
127
136 std::optional<std::span<const JSON::StringView>> audience = std::nullopt;
142 std::optional<double> priority = std::nullopt;
145};
146
161
187[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
189 const MCPResourceAnnotations &annotations)
190 -> JSON;
191
219[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
221 JSON::StringView mime_type,
222 const MCPResourceAnnotations &annotations = {}) -> JSON;
243[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
245 JSON::StringView mime_type,
246 const MCPResourceAnnotations &annotations = {}) -> JSON;
271[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
273 const MCPResourceAnnotations &annotations = {})
274 -> JSON;
294[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
296 JSON::StringView blob) -> JSON;
314[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
316
340[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_link(
341 const MCPProtocolVersion version, const JSON::StringView uri,
342 const JSON::StringView name, const JSON::StringView mime_type = {},
343 const JSON::StringView description = {}) -> sourcemeta::core::JSON;
344
371[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_decorate_result(
372 const MCPProtocolVersion version, sourcemeta::core::JSON result,
373 const std::optional<MCPImplementation> &server_info = std::nullopt)
375
400[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_decorate_cacheable_result(
401 const MCPProtocolVersion version, sourcemeta::core::JSON result,
402 const MCPCachePolicy &cache_policy, const JSON::StringView method)
404
434[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_empty_response(
435 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
436 const std::optional<MCPImplementation> &server_info = std::nullopt)
438
471[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_success(
472 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
474 const std::optional<MCPImplementation> &server_info = std::nullopt)
476
507[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_success(
508 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
509 sourcemeta::core::JSON structured, sourcemeta::core::JSON content_blocks,
510 const std::optional<MCPImplementation> &server_info = std::nullopt)
512
538[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_error(
539 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
540 const JSON::StringView message,
541 const std::optional<MCPImplementation> &server_info = std::nullopt)
543
565[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
567 const JSON::StringView name, const JSON::StringView mime_type,
568 const JSON::StringView description = {},
569 const std::optional<std::size_t> size = std::nullopt,
570 const std::optional<double> priority = std::nullopt,
571 const MCPDescriptorPresentation &presentation = {},
572 const MCPResourceAnnotations &annotations = {})
573 -> sourcemeta::core::JSON;
574
594[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_text_content(
595 const JSON::StringView uri, const JSON::StringView mime_type,
597
626[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resources_read_result(
627 const MCPProtocolVersion version, sourcemeta::core::JSON contents,
628 const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON;
629
652[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_template(
653 const MCPProtocolVersion version, const JSON::StringView uri_template,
654 const JSON::StringView name, const JSON::StringView description,
655 const JSON::StringView mime_type,
656 const MCPDescriptorPresentation &presentation = {},
657 const MCPResourceAnnotations &annotations = {}) -> sourcemeta::core::JSON;
658
690[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_descriptor(
691 const MCPProtocolVersion version, const JSON::StringView name,
692 const JSON::StringView description, sourcemeta::core::JSON input_schema,
693 std::optional<sourcemeta::core::JSON> output_schema = std::nullopt,
694 const MCPToolAnnotations &annotations = {},
695 const MCPDescriptorPresentation &presentation = {})
697
722[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tools_list_result(
723 const MCPProtocolVersion version, sourcemeta::core::JSON tools,
724 const std::optional<JSON::StringView> next_cursor,
725 const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON;
726
757[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resources_list_result(
758 const MCPProtocolVersion version, sourcemeta::core::JSON resources,
759 const std::optional<JSON::StringView> next_cursor,
760 const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON;
761
786[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
788 const MCPProtocolVersion version, sourcemeta::core::JSON resource_templates,
789 const std::optional<JSON::StringView> next_cursor,
790 const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON;
791
818[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_prompts_list_result(
819 const MCPProtocolVersion version, sourcemeta::core::JSON prompts,
820 const std::optional<JSON::StringView> next_cursor,
821 const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON;
822
853[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
855 JSON::StringView description, JSON messages)
856 -> JSON;
857
877[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
879 std::optional<std::int64_t> total,
880 std::optional<bool> has_more) -> JSON;
881
921SOURCEMETA_CORE_MCP_EXPORT
923 std::ostream &stream, MCPProtocolVersion version, JSON::StringView method,
924 const JSON &identifier, const JSON &result,
925 std::optional<MCPCachePolicy> cache_policy,
926 std::optional<MCPImplementation> server_info = std::nullopt) -> void;
927
940SOURCEMETA_CORE_MCP_EXPORT
942 std::ostream &stream, MCPProtocolVersion version, JSON::StringView method,
943 const JSON &identifier, JSON &&result,
944 std::optional<MCPCachePolicy> cache_policy,
945 std::optional<MCPImplementation> server_info = std::nullopt) -> void;
946
1008[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_initialize_response(
1009 const sourcemeta::core::JSON &request,
1010 const MCPServerCapabilities &capabilities, const MCPImplementation &server,
1011 const std::span<const JSON::StringView> supported_versions,
1012 const JSON::StringView instructions = {}) -> sourcemeta::core::JSON;
1013
1047[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_server_discover_response(
1048 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
1049 const MCPServerCapabilities &capabilities, const MCPImplementation &server,
1050 const std::span<const JSON::StringView> supported_versions,
1051 const JSON::StringView instructions, const MCPCachePolicy &cache_policy)
1053
1099[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_input_required_response(
1100 const MCPProtocolVersion version, const JSON::StringView method,
1101 const sourcemeta::core::JSON &identifier,
1102 std::optional<sourcemeta::core::JSON> input_requests,
1103 std::optional<JSON::StringView> request_state,
1104 const MCPClientCapabilities &client_capabilities,
1105 const std::optional<MCPImplementation> &server_info = std::nullopt)
1107
1136[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1138 const sourcemeta::core::JSON &envelope)
1139 -> const sourcemeta::core::JSON *;
1140
1162[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1164 const sourcemeta::core::JSON &envelope)
1165 -> std::optional<JSON::StringView>;
1166
1176 std::optional<bool> tools_list_changed = std::nullopt;
1178 std::optional<bool> prompts_list_changed = std::nullopt;
1180 std::optional<bool> resources_list_changed = std::nullopt;
1183 std::optional<std::vector<JSON::StringView>> resource_subscriptions =
1184 std::nullopt;
1185};
1186
1215[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1217 const JSON &parameters)
1218 -> std::optional<MCPSubscriptionFilter>;
1219
1242[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1244 const MCPSubscriptionFilter &supported)
1246
1269[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1270mcp_result_type(const JSON &result) -> std::optional<JSON::StringView>;
1271
1299[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto mcp_resolve_result_type(
1300 MCPProtocolVersion version, const JSON &result,
1301 std::span<const JSON::StringView> supported_extension_types = {})
1302 -> std::optional<JSON::StringView>;
1303
1343[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1345 const JSON &input_requests) -> bool;
1346
1380[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1382 const JSON &input_requests,
1383 std::optional<JSON::StringView> expected_state)
1384 -> bool;
1385
1416[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1418 JSON::StringView method, JSON parameters,
1419 std::optional<JSON> subscription_id,
1420 const MCPSubscriptionFilter *acknowledged = nullptr,
1421 const MCPRequestMeta *request_context = nullptr) -> JSON;
1422
1450[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1452 const MCPProtocolVersion version,
1453 const sourcemeta::core::JSON &subscription_id,
1454 const MCPSubscriptionFilter &requested,
1455 const MCPSubscriptionFilter &supported) -> sourcemeta::core::JSON;
1456
1482[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1484 const MCPProtocolVersion version, const JSON::StringView subscription_id,
1485 const MCPSubscriptionFilter &requested,
1486 const MCPSubscriptionFilter &supported) -> sourcemeta::core::JSON;
1487
1504[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1506 const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier,
1507 const std::optional<MCPImplementation> &server_info = std::nullopt)
1509
1533[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1535 const sourcemeta::core::JSON &envelope)
1536 -> const sourcemeta::core::JSON *;
1537
1560[[nodiscard]] SOURCEMETA_CORE_MCP_EXPORT auto
1562 -> const sourcemeta::core::JSON *;
1563
1564} // namespace sourcemeta::core
1565
1566#endif
std::basic_string_view< Char, CharTraits > StringView
The string view type used by the JSON document.
Definition json_value.h:54
Definition json_value.h:39
JSON::StringView title
Optional human-readable title for the tool.
Definition mcp_results.h:116
std::optional< bool > prompts_list_changed
Opt in to notifications that the prompt list changed.
Definition mcp_results.h:1178
std::optional< bool > tools_list_changed
Opt in to notifications that the tool list changed.
Definition mcp_results.h:1176
bool destructive
true when the tool may mutate or delete state.
Definition mcp_results.h:120
bool idempotent
Definition mcp_results.h:123
const JSON * icons
Optional icon array (2025-11-25 and later).
Definition mcp_results.h:159
std::int64_t ttl_ms
Definition mcp_results.h:101
std::optional< bool > resources_list_changed
Opt in to notifications that the resource list changed.
Definition mcp_results.h:1180
bool open_world
true when the tool interacts with state outside the server's control.
Definition mcp_results.h:125
std::optional< std::vector< JSON::StringView > > resource_subscriptions
Definition mcp_results.h:1183
std::optional< double > priority
Definition mcp_results.h:142
std::optional< std::span< const JSON::StringView > > audience
Optional audience roles ("user" and/or "assistant"). Empty stays explicit.
Definition mcp_results.h:136
bool read_only
true as an advisory hint that the tool does not modify its environment.
Definition mcp_results.h:118
MCPCacheScope scope
Cache scope (public or private).
Definition mcp_results.h:103
JSON::StringView title
Human-readable title (2025-06-18 and later).
Definition mcp_results.h:157
JSON::StringView last_modified
Optional timestamp string. The caller supplies a valid ISO 8601 timestamp.
Definition mcp_results.h:144
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_error(const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier, const JSON::StringView message, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
MCPCacheScope
Definition mcp_results.h:28
SOURCEMETA_CORE_MCP_EXPORT auto mcp_decorate_result(const MCPProtocolVersion version, sourcemeta::core::JSON result, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
constexpr auto mcp_cache_scope_string(const MCPCacheScope scope) noexcept -> JSON::StringView
Definition mcp_results.h:49
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_descriptor(const MCPProtocolVersion version, const JSON::StringView name, const JSON::StringView description, sourcemeta::core::JSON input_schema, std::optional< sourcemeta::core::JSON > output_schema=std::nullopt, const MCPToolAnnotations &annotations={}, const MCPDescriptorPresentation &presentation={}) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_blob_content(JSON::StringView uri, JSON::StringView mime_type, JSON::StringView blob) -> JSON
MCPProtocolVersion
Definition mcp_protocol.h:30
SOURCEMETA_CORE_MCP_EXPORT auto mcp_validate_continuation(MCPProtocolVersion version, const JSON &parameters, const JSON &input_requests) -> bool
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_link(const MCPProtocolVersion version, const JSON::StringView uri, const JSON::StringView name, const JSON::StringView mime_type={}, const JSON::StringView description={}) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_tool_call_arguments(const sourcemeta::core::JSON &envelope) -> const sourcemeta::core::JSON *
SOURCEMETA_CORE_MCP_EXPORT auto mcp_request_input_responses(MCPProtocolVersion version, const sourcemeta::core::JSON &envelope) -> const sourcemeta::core::JSON *
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_subscription_acknowledged_notification(const MCPProtocolVersion version, const sourcemeta::core::JSON &subscription_id, const MCPSubscriptionFilter &requested, const MCPSubscriptionFilter &supported) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_write_result(std::ostream &stream, MCPProtocolVersion version, JSON::StringView method, const JSON &identifier, const JSON &result, std::optional< MCPCachePolicy > cache_policy, std::optional< MCPImplementation > server_info=std::nullopt) -> void
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_prompts_list_result(const MCPProtocolVersion version, sourcemeta::core::JSON prompts, const std::optional< JSON::StringView > next_cursor, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_intersect_subscription_filters(const MCPSubscriptionFilter &requested, const MCPSubscriptionFilter &supported) -> MCPSubscriptionFilter
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_subscription_close_response(const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
constexpr auto mcp_resolve_cache_scope(const JSON::StringView scope) noexcept -> std::optional< MCPCacheScope >
Definition mcp_results.h:77
SOURCEMETA_CORE_MCP_EXPORT auto mcp_parse_subscription_filter(MCPProtocolVersion version, const JSON &parameters) -> std::optional< MCPSubscriptionFilter >
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tool_success(const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier, sourcemeta::core::JSON result, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resources_read_result(const MCPProtocolVersion version, sourcemeta::core::JSON contents, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_request_subscription_id(MCPProtocolVersion version, const sourcemeta::core::JSON &envelope) -> const sourcemeta::core::JSON *
SOURCEMETA_CORE_MCP_EXPORT auto mcp_request_state(MCPProtocolVersion version, const sourcemeta::core::JSON &envelope) -> std::optional< JSON::StringView >
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_completion_result(MCPProtocolVersion version, JSON values, std::optional< std::int64_t > total, std::optional< bool > has_more) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_image_block(MCPProtocolVersion version, JSON::StringView data, JSON::StringView mime_type, const MCPResourceAnnotations &annotations={}) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_decorate_cacheable_result(const MCPProtocolVersion version, sourcemeta::core::JSON result, const MCPCachePolicy &cache_policy, const JSON::StringView method) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_notification(MCPProtocolVersion version, bool from_server, JSON::StringView method, JSON parameters, std::optional< JSON > subscription_id, const MCPSubscriptionFilter *acknowledged=nullptr, const MCPRequestMeta *request_context=nullptr) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_prompts_get_result(MCPProtocolVersion version, JSON::StringView description, JSON messages) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_initialize_response(const sourcemeta::core::JSON &request, const MCPServerCapabilities &capabilities, const MCPImplementation &server, const std::span< const JSON::StringView > supported_versions, const JSON::StringView instructions={}) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resources_list_result(const MCPProtocolVersion version, sourcemeta::core::JSON resources, const std::optional< JSON::StringView > next_cursor, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_text_block(const JSON::StringView text) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_tools_list_result(const MCPProtocolVersion version, sourcemeta::core::JSON tools, const std::optional< JSON::StringView > next_cursor, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_template(const MCPProtocolVersion version, const JSON::StringView uri_template, const JSON::StringView name, const JSON::StringView description, const JSON::StringView mime_type, const MCPDescriptorPresentation &presentation={}, const MCPResourceAnnotations &annotations={}) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_text_content(const JSON::StringView uri, const JSON::StringView mime_type, const JSON::StringView text) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_input_required_response(const MCPProtocolVersion version, const JSON::StringView method, const sourcemeta::core::JSON &identifier, std::optional< sourcemeta::core::JSON > input_requests, std::optional< JSON::StringView > request_state, const MCPClientCapabilities &client_capabilities, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_audio_block(MCPProtocolVersion version, JSON::StringView data, JSON::StringView mime_type, const MCPResourceAnnotations &annotations={}) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_result_type(const JSON &result) -> std::optional< JSON::StringView >
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_empty_response(const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier, const std::optional< MCPImplementation > &server_info=std::nullopt) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource_templates_list_result(const MCPProtocolVersion version, sourcemeta::core::JSON resource_templates, const std::optional< JSON::StringView > next_cursor, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_resource(const MCPProtocolVersion version, const JSON::StringView uri, const JSON::StringView name, const JSON::StringView mime_type, const JSON::StringView description={}, const std::optional< std::size_t > size=std::nullopt, const std::optional< double > priority=std::nullopt, const MCPDescriptorPresentation &presentation={}, const MCPResourceAnnotations &annotations={}) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_resolve_result_type(MCPProtocolVersion version, const JSON &result, std::span< const JSON::StringView > supported_extension_types={}) -> std::optional< JSON::StringView >
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_server_discover_response(const MCPProtocolVersion version, const sourcemeta::core::JSON &identifier, const MCPServerCapabilities &capabilities, const MCPImplementation &server, const std::span< const JSON::StringView > supported_versions, const JSON::StringView instructions, const MCPCachePolicy &cache_policy) -> sourcemeta::core::JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_serialize_resource_annotations(MCPProtocolVersion version, const MCPResourceAnnotations &annotations) -> JSON
SOURCEMETA_CORE_MCP_EXPORT auto mcp_make_embedded_resource(MCPProtocolVersion version, JSON resource, const MCPResourceAnnotations &annotations={}) -> JSON
@ Public
Public caching is permissible across multiple clients/users.
Definition mcp_results.h:30
@ Private
Definition mcp_results.h:33
Definition mcp_results.h:95
Definition mcp_capabilities.h:84
Definition mcp_capabilities.h:54
Definition mcp_headers.h:97
Definition mcp_results.h:134
Definition mcp_capabilities.h:121
Definition mcp_results.h:1174
Definition mcp_results.h:114