12#include <nlohmann/json.hpp>
28 : definition_(std::move(def)) {}
58 const std::string& )
const {
82 const std::string& tool_name,
83 const std::string& server_prefix,
84 const std::string& data_dir) {
86 std::string path = data_dir;
87 if (!server_prefix.empty()) {
88 path +=
"/" + server_prefix;
90 path +=
"/" + tool_name +
".json";
92 std::ifstream file(path);
93 if (!file.is_open()) {
94 throw std::runtime_error(
95 "Tool definition not found: " + path);
98 auto json = nlohmann::json::parse(file);
101 def.
name = json.at(
"name").get<std::string>();
105 logger->info(
"Loaded tool definition: {} from {}",
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
Activate model on GPU (WARM → ACTIVE).
ToolDefinition load_tool_definition(const std::string &tool_name, const std::string &server_prefix, const std::string &data_dir)
Load a tool definition from a JSON file.
MCPAccessLevel
MCP tool access level for per-identity authorization.
@ WRITE
Read + write operations (e.g., write_file, execute)
MCPServerBase concrete base class + ServerResponse.