INNER CODE UNIT · Python

r

Arthur-Ficial/apfel · mcp/http-test-server/server.py:123

            r = math.sqrt(a)
        elif name == "power":
            r = a ** b
        elif name == "round_number":
            decimals = int(args.get("decimals", 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 handle_request(body):
    method = body.get("method", "")
    req_id = body.get("id")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…