Class: TalkToYourApp::Plugins::Health::Tools::RunCheck

Inherits:
Tool
  • Object
show all
Defined in:
lib/talk_to_your_app/plugins/health/tools/run_check.rb

Overview

Runs a named health check and returns its normalized result. An unknown name is a usage error (MCP tool error); a check that runs but fails or raises returns a normal result whose ‘status` carries the outcome.

Instance Method Summary collapse

Methods inherited from Tool

argument, arguments, connection, default_arguments, description, dispatch, input_schema_hash, invoke, name, normalize_response, to_mcp_definition, to_mcp_tool

Instance Method Details

#call(args, _ctx) ⇒ Object



17
18
19
20
21
22
# File 'lib/talk_to_your_app/plugins/health/tools/run_check.rb', line 17

def call(args, _ctx)
  result = TalkToYourApp::Health.run(args[:name])
  return error("Unknown health check: #{args[:name]}") if result.nil?

  json(result)
end