Skip to main content
Glama
kelseyee

Calculator MCP

by kelseyee

divide

Perform floating-point division for two numbers using this tool. Input values 'a' (dividend) and 'b' (divisor) to calculate the result. Ensure 'b' is non-zero for accurate division.

Instructions

执行浮点数除法运算 Args: b: 除数(必须非零)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The divide tool handler: decorated with @mcp.tool(), performs a / b after checking b != 0.
    @mcp.tool() def divide(a: float, b: float) -> float: """执行浮点数除法运算 Args: b: 除数(必须非零) """ if b == 0: raise ValueError("除数不能为零") return a / b
  • calculator.py:22-22 (registration)
    Registers the divide function as an MCP tool.
    @mcp.tool()

Other Tools

Related Tools

  • @EthanHenrickson/math-mcp
  • @parameshwaran1/mcpserverexample
  • @githubpradeep/calc-mcp71
  • @avanishd-3/math-mcp
  • @wrtnlabs/calculator-mcp
  • @githubpradeep/calc-mcp72

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kelseyee/mcp_calculator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server