INNER CODE UNIT · Python

r

Arthur-Ficial/apfel · mcp/calculator/server.py:160

            r = math.sqrt(a)
        elif name == "power":
            r = a ** b
        elif name == "round_number":
            decimals = int(args.get("decimals", args.get("n", nums[1] if len(nums) > 1 else 0)))
            r = round(a, decimals)
        else:
            return f"Error: unknown tool '{name}'"

        if isinstance(r, float) and r == int(r) and not math.isinf(r):
            r = int(r)
        return str(r)
    except Exception as e:
        return f"Error: {e}"


def read_message():
    line = sys.stdin.readline()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…