Class: OmnifocusMcp::Tools::Definitions::GetPerspectiveViewTool
- Inherits:
-
FastMcp::Tool
- Object
- FastMcp::Tool
- OmnifocusMcp::Tools::Definitions::GetPerspectiveViewTool
- Extended by:
- OperationFactory
- Defined in:
- lib/omnifocus_mcp/tools/definitions/get_perspective_view_tool.rb
Overview
‘FastMcp::Tool` for `get_perspective_view`.
Instance Method Summary collapse
Methods included from OperationFactory
default_operation_factory, extended, operation_factory, operation_factory=
Instance Method Details
#call(**args) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/omnifocus_mcp/tools/definitions/get_perspective_view_tool.rb', line 37 def call(**args) McpEnvelope.safely("getting perspective view") do params = Params::GetPerspectiveViewParams.from_mcp(args) limit = Operations::GetPerspectiveView.normalize_limit(params.limit) # TODO: I don't like this nested function call operation.call( Params::GetPerspectiveViewParams.new( perspective_name: params.perspective_name, limit: limit, fields: params.fields ) ).fold( on_ok: lambda do |items| McpEnvelope::ToolReply.success(Presenters::PerspectiveView.format(args[:perspectiveName], items, limit)) end, on_error: ->(err) { McpEnvelope::ToolReply.failure(Messages::ListTools.perspective_view_failure(err)) } ) end end |