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, behaviour : Nil | Array(String) = nil, ui : Nil | String = nil, visibility : Nil | Array(String) = nil, title : Nil | String = nil, icons : Nil | Array(JSON::Any) = nil, resource : Nil | String = nil, mime_type : Nil | String = nil, subscribe : Bool = false, cache_ttl : Int32 | Nil = nil, long_running : Bool = false, max_bytes : Int64 | Nil = nil)#
.new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)#
Methods#
#behaviour : Array(String) | ::Nil#
what the tool does, see behaviours. nil infers it from the HTTP verb
#behaviours : Array(String)#
what the tool does, @[AC::MCP(behaviour:)] or inferred from the HTTP verb
#cache_ttl : Int32 | ::Nil#
seconds a resource read can be cached, nil uses MCPServer.cache_ttl
#long_running? : Bool#
streams progress and spools the response to disk, see MCPServer::RequestContext
#max_bytes : Int64 | ::Nil#
the maximum response size, in bytes, of a long running route
#resource : String | ::Nil#
the resource template the route is also readable as, i.e. app://widgets/{id}
#to_mcp_json(json : JSON::Builder, proxy : Bool = false, ui : Bool = false, host : String | Nil = nil, bound : Hash(String, String) | Nil = nil) : Nil#
the tool definition as returned by tools/list, proxy: true also names the
proxy tool that runs it and ui: true includes the MCP Apps metadata.
host resolves icon paths
#ui : String | ::Nil#
the MCP Apps card rendered for the tool, i.e. ui://bookings/card.html
#visibility : Array(String) | ::Nil#
who can call the tool, model and/or card. nil is both