Skip to content

class ActionController::MCPServer::Tool
inherits Reference #

a route exposed as a tool

Included modules

JSON::Serializable YAML::Serializable

Extended modules

JSON::Schema

Constructors#

.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)#

View source

.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)#

View source

.new(pull : JSON::PullParser)#

View source

.new(*, __pull_for_json_serializable pull : JSON::PullParser)#

View source

.new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)#

View source

Methods#

#body : String | ::Nil#

the argument that holds the request body, if any

View source

#description : String | ::Nil#

View source

#input_schema : JSON::Any#

JSON schema describing the tool arguments

View source

#name : String#

View source

#params : Array(ToolParam)#

View source

#path : String#

the route template, i.e. /users/:id

View source

#root? : Bool#

always available, without opening the toolbox

View source

#to_mcp_json(json : JSON::Builder) : Nil#

the tool definition as returned by tools/list

View source

#verb : String#

View source