Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
tool_base.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
13#pragma once
14
16
17#include <string>
18
19namespace entropic {
20
21struct ServerResponse; // forward declaration (server_base.h)
22
28 std::string name;
29 std::string description;
30 std::string input_schema;
31};
32
45class ToolBase {
46public:
47 virtual ~ToolBase() = default;
48
54 explicit ToolBase(ToolDefinition def);
55
61 const std::string& name() const;
62
68 const ToolDefinition& definition() const;
69
76 virtual ServerResponse execute(const std::string& args_json) = 0;
77
88 virtual std::string anchor_key(const std::string& args_json) const;
89
100
101protected:
103};
104
116 const std::string& tool_name,
117 const std::string& server_prefix,
118 const std::string& data_dir);
119
120} // namespace entropic
Abstract base class for individual MCP tools.
Definition tool_base.h:45
virtual ServerResponse execute(const std::string &args_json)=0
Execute this tool with the given arguments.
const std::string & name() const
Get the tool name.
Definition tool_base.cpp:36
ToolDefinition definition_
Tool definition.
Definition tool_base.h:102
virtual MCPAccessLevel required_access_level() const
Minimum access level required to execute this tool.
Definition tool_base.cpp:68
virtual std::string anchor_key(const std::string &args_json) const
Generate anchor key for this tool result.
Definition tool_base.cpp:57
const ToolDefinition & definition() const
Get the full tool definition.
Definition tool_base.cpp:46
Configuration structs with defaults.
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.
Definition tool_base.cpp:81
MCPAccessLevel
MCP tool access level for per-identity authorization.
Definition config.h:38
Structured result from tool execution.
Definition server_base.h:33
Parsed tool definition from JSON schema file.
Definition tool_base.h:27
std::string name
Tool name (e.g., "read_file")
Definition tool_base.h:28
std::string input_schema
JSON Schema for arguments (raw JSON string)
Definition tool_base.h:30
std::string description
Human-readable description.
Definition tool_base.h:29