mathtools

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mathtools registers MCP tools that wrap the Go standard math package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(s *mcp.Server)

Register adds all math stdlib tools to the server.

Types

type BinaryIn

type BinaryIn struct {
	X float64 `json:"x" jsonschema:"first input"`
	Y float64 `json:"y" jsonschema:"second input"`
}

BinaryIn is the input shape for two-argument math tools.

type ConstantsOut

type ConstantsOut struct {
	Pi      float64 `json:"pi"`
	E       float64 `json:"e"`
	Phi     float64 `json:"phi"`
	Sqrt2   float64 `json:"sqrt2"`
	SqrtE   float64 `json:"sqrt_e"`
	SqrtPi  float64 `json:"sqrt_pi"`
	SqrtPhi float64 `json:"sqrt_phi"`
	Ln2     float64 `json:"ln2"`
	Log2E   float64 `json:"log2_e"`
	Ln10    float64 `json:"ln10"`
	Log10E  float64 `json:"log10_e"`
}

ConstantsOut lists the named mathematical constants exposed by math_constants.

type Result

type Result struct {
	Function string             `json:"function" jsonschema:"name of the math function that was evaluated"`
	Inputs   map[string]float64 `json:"inputs" jsonschema:"the inputs the function was applied to"`
	Result   float64            `json:"result" jsonschema:"computed result as a float64"`
}

Result is the output shape for math tools. Inputs are echoed back so the caller can verify that arguments were sent and interpreted correctly.

type UnaryIn

type UnaryIn struct {
	X float64 `json:"x" jsonschema:"input value"`
}

UnaryIn is the input shape for single-argument math tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL