Class: Mathpix::MCP::Tools::BaseTool

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/mathpix/mcp/base_tool.rb

Overview

Base class for all Mathpix MCP tools

Uses official Ruby MCP SDK (MCP::Tool) Provides common utilities for Mathpix-specific tools

Examples:

Tool implementation

class ExampleTool < BaseTool
  description "Example tool"
  input_schema(
    properties: { message: { type: "string" } },
    required: ["message"]
  )

  def self.call(message:, server_context:)
    client = server_context[:mathpix_client]
    # Use client to make API calls
    text_response("Result: #{message}")
  end
end