Class: Coatepec::MCP::RoutesTool
- Inherits:
-
MCP::Tool
- Object
- MCP::Tool
- Coatepec::MCP::RoutesTool
- Defined in:
- lib/coatepec/mcp/tools.rb
Overview
The rails_routes MCP tool: lists/filters/paginates the target
Rails app's routes.
Class Method Summary collapse
Class Method Details
.call(server_context:, query: nil, limit: 50, offset: 0) ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/coatepec/mcp/tools.rb', line 89 def call(server_context:, query: nil, limit: 50, offset: 0) started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC) data = server_context[:worker_manager].routes(query: query, limit: limit, offset: offset) Response.ok(data: data, meta: (server_context, started_at)) rescue Coatepec::Error => e Response.error(e) end |