30 #ifndef PT_MCP_TOOLDECLARATION_H
31 #define PT_MCP_TOOLDECLARATION_H
33 #include <Pt/Mcp/Api.h>
34 #include <Pt/Mcp/Type.h>
35 #include <Pt/NonCopyable.h>
88 Tool(
const std::string& name,
const std::string& description);
92 Tool& addParam(
const std::string& name,
const Type& type,
93 const std::string& description =
"");
95 Tool& setOptional(
const std::string& paramName);
99 const std::string& name()
const
102 const std::string& description()
const
103 {
return _description; }
105 const std::vector<Property>& params()
const
108 std::size_t paramCount()
const
109 {
return _params.size(); }
111 int getParamIndex(
const std::string& name)
const;
117 std::string _description;
118 std::vector<Property> _params;
132 const std::string& serverVersion);
136 Tool& addTool(
const std::string& name,
const std::string& description);
138 const Tool* getTool(
const std::string& name)
const;
140 const std::string& serverName()
const
141 {
return _serverName; }
143 const std::string& serverVersion()
const
144 {
return _serverVersion; }
167 const char* protocolVersion = 0)
const;
170 std::string _serverName;
171 std::string _serverVersion;
172 std::vector<Tool*> _tools;
179 #endif // PT_MCP_TOOLDECLARATION_H
Core module.
Definition: Allocator.h:33
Manages the decomposition of types during serialization.
Definition: Decomposer.h:44
virtual void format(Decomposer *result, std::ostream &os) const =0
Formats the decomposed result into an MCP content block.
void format(Decomposer *result, std::ostream &os) const override
Formats the decomposed result into an MCP content block.
JSON Schema type descriptor for MCP tool parameters.
Definition: Type.h:46
Formats a tool result as MCP content.
Definition: ToolDeclaration.h:51
Protects derived classes from being copied.
Definition: NonCopyable.h:54
Formats tool results as MCP text content.
Definition: ToolDeclaration.h:70