|
cxxmcp 1.2.4
C++ MCP SDK
|
Small JSON Schema builders for MCP tool and elicitation metadata. More...
#include <string>#include <type_traits>#include <utility>#include <vector>#include "cxxmcp/protocol/reflect.hpp"#include "cxxmcp/protocol/types.hpp"Go to the source code of this file.
Namespaces | |
| namespace | mcp::protocol::detail |
| Auto-generates JSON Schema from a Reflect<T> specialization. | |
Functions | |
| template<class T > | |
| Json | mcp::protocol::schema_for () |
| Returns the JSON Schema advertised for a C++ type. | |
| template<typename Struct , typename Field > | |
| void | mcp::protocol::detail::add_reflected_field_schema (Json &properties, Json &required, const FieldDescriptor< Struct, Field > &fd) |
| template<typename Struct > | |
| void | mcp::protocol::detail::add_reflected_field_schema (Json &, Json &, const ExtensionsField< Struct > &) |
| template<typename Struct , typename Field > | |
| void | mcp::protocol::detail::add_reflected_field_schema (Json &, Json &, const DeserializeOnlyField< Struct, Field > &) |
| template<class T > | |
| Json | mcp::protocol::detail::reflect_schema () |
| template<class T > | |
| Json | mcp::protocol::tool_input_schema_for () |
| Returns the root object schema required by MCP tool arguments. | |
| template<class T > | |
| Json | mcp::protocol::tool_output_schema_for () |
| Returns the root object schema required by MCP structuredContent. | |
| ObjectSchemaBuilder | mcp::protocol::object_schema () |
| Creates a fluent object-schema builder. | |
Variables | |
| template<class T > | |
| constexpr bool | mcp::protocol::is_tool_schema_type_v = is_tool_schema_type<T>::value |
Small JSON Schema builders for MCP tool and elicitation metadata.
|
inline |
Returns the JSON Schema advertised for a C++ type.
For types with a Reflect<T> specialization, generates schema from reflected fields. For all other types, delegates to SchemaTraits<T>.
|
inline |
Returns the root object schema required by MCP tool arguments.
MCP tools/call always sends arguments as an object. Reflected and custom DTO types already map to object schemas; scalar authoring helpers are wrapped in a single required value property so the advertised schema still describes the protocol envelope.