class
ActionController::MCPServer::Tool
- ActionController::MCPServer::Tool
- Reference
- Object
Overview
a route exposed as a tool
Included Modules
- JSON::Serializable
- YAML::Serializable
Extended Modules
- JSON::Schema
Defined in:
action-controller/mcp/description.crConstructors
- .new(name : String, description : Nil | String, verb : String, path : String, params : Array(ActionController::MCPServer::ToolParam), body : Nil | String, input_schema : JSON::Any, root : Bool = false, read_only : Bool | Nil = nil)
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
- .new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Instance Method Summary
-
#body : String | Nil
the argument that holds the request body, if any
- #description : String | Nil
-
#input_schema : JSON::Any
JSON schema describing the tool arguments
- #name : String
- #params : Array(ToolParam)
-
#path : String
the route template, i.e.
-
#proxy : String
the proxy tool that runs this tool, for clients that can't see it
-
#read_only : Bool | Nil
overrides whether the tool only reads data, see
#read_only? -
#read_only? : Bool
only reads data, GET routes unless overridden with
@[AC::MCP(read_only:)] -
#root? : Bool
always available, without opening the toolbox
-
#to_mcp_json(json : JSON::Builder, proxy : Bool = false) : Nil
the tool definition as returned by
tools/list,proxy: truealso names the proxy tool that runs it - #verb : String
Constructor Detail
def self.new(name : String, description : Nil | String, verb : String, path : String, params : Array(ActionController::MCPServer::ToolParam), body : Nil | String, input_schema : JSON::Any, root : Bool = false, read_only : Bool | Nil = nil)
#
def self.new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
#
Instance Method Detail
def to_mcp_json(json : JSON::Builder, proxy : Bool = false) : Nil
#
the tool definition as returned by tools/list, proxy: true also names the
proxy tool that runs it