class ActionController::MCPServer::Tool

Overview

a route exposed as a tool

Included Modules

Extended Modules

Defined in:

action-controller/mcp/description.cr

Constructors

Instance Method Summary

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

[View source]
def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]
def self.new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node) #

[View source]

Instance Method Detail

def body : String | Nil #

the argument that holds the request body, if any


[View source]
def description : String | Nil #

[View source]
def input_schema : JSON::Any #

JSON schema describing the tool arguments


[View source]
def name : String #

[View source]
def params : Array(ToolParam) #

[View source]
def path : String #

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


[View source]
def proxy : String #

the proxy tool that runs this tool, for clients that can't see it


[View source]
def read_only : Bool | Nil #

overrides whether the tool only reads data, see #read_only?


[View source]
def read_only? : Bool #

only reads data, GET routes unless overridden with @[AC::MCP(read_only:)]


[View source]
def root? : Bool #

always available, without opening the toolbox


[View source]
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


[View source]
def verb : String #

[View source]