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, 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(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
Instance Method Summary
-
#behaviour : Array(String) | Nil
what the tool does, see
#behaviours. -
#behaviours : Array(String)
what the tool does,
@[AC::MCP(behaviour:)]or inferred from the HTTP verb -
#body : String | Nil
the argument that holds the request body, if any
-
#cache_ttl : Int32 | Nil
seconds a resource read can be cached,
nilusesMCPServer.cache_ttl - #description : String | Nil
-
#icons : Array(JSON::Any) | Nil
icons,
srcas written, seeIcons -
#input_schema : JSON::Any
JSON schema describing the tool arguments
-
#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
-
#mime_type : String | Nil
the MIME type of the resource contents
-
#model? : Bool
the model can call the tool, it's not for cards only
- #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
only reads data, can be run by
call_read_only -
#resource : String | Nil
the resource template the route is also readable as, i.e.
-
#root? : Bool
always available, without opening the toolbox
-
#subscribe? : Bool
clients can subscribe to updates of the resource
-
#title : String | Nil
the display name
-
#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: truealso names the proxy tool that runs it andui: trueincludes the MCP Apps metadata. -
#ui : String | Nil
the MCP Apps card rendered for the tool, i.e.
-
#uri_template : URITemplate | Nil
the parsed resource template
- #verb : String
-
#visibility : Array(String) | Nil
who can call the tool,
modeland/orcard.
Constructor Detail
Instance Method Detail
what the tool does, see #behaviours. nil infers it from the HTTP verb
what the tool does, @[AC::MCP(behaviour:)] or inferred from the HTTP verb
streams progress and spools the response to disk, see MCPServer::RequestContext
the resource template the route is also readable as, i.e. app://widgets/{id}
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