12#include <nlohmann/json.hpp>
28 : definition_(std::move(def)) {}
62 const std::string& )
const {
100 const std::string& tool_name,
101 const std::string& server_prefix,
102 const std::string& data_dir) {
104 std::string path = data_dir;
105 if (!server_prefix.empty()) {
106 path +=
"/" + server_prefix;
108 path +=
"/" + tool_name +
".json";
110 std::ifstream file(path);
111 if (!file.is_open()) {
112 throw std::runtime_error(
113 "Tool definition not found: " + path);
116 auto json = nlohmann::json::parse(file);
119 def.
name = json.at(
"name").get<std::string>();
123 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.