{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "read-me",
      "metadata": {},
      "source": "# Call a scientific tool from an Aner notebook\n\nUse Aner `0.1.2-dev.7` on macOS or Linux. Open this notebook at the project root containing the already approved energy 401.run and examples/agent_energy_mcp.aner. The cells call the service in a separate Aner process over MCP."
    },
    {
      "cell_type": "code",
      "id": "select-service",
      "metadata": {},
      "source": [
        "import aner.agent\n",
        "let service = \"examples/agent_energy_mcp.aner\""
      ],
      "outputs": [],
      "execution_count": null
    },
    {
      "cell_type": "markdown",
      "id": "read-denial",
      "metadata": {},
      "source": "## Try the unapproved observation\nThe native service returns a scope denial for row 402."
    },
    {
      "cell_type": "code",
      "id": "denied",
      "metadata": {},
      "source": [
        "print(agent.mcp_prediction(service, 402))"
      ],
      "outputs": [],
      "execution_count": null
    },
    {
      "cell_type": "markdown",
      "id": "read-receipt",
      "metadata": {},
      "source": "## Read the approved measurement\nThe fitted predictor returns kWh and a receipt for row 401."
    },
    {
      "cell_type": "code",
      "id": "approved",
      "metadata": {},
      "source": [
        "print(agent.mcp_prediction(service, 401))"
      ],
      "outputs": [],
      "execution_count": null
    },
    {
      "cell_type": "markdown",
      "id": "reconnect",
      "metadata": {},
      "source": "## Reconnect\nRun the next cell in the same project. The returned receipt ID identifies the saved prediction."
    },
    {
      "cell_type": "code",
      "id": "replayed",
      "metadata": {},
      "source": [
        "print(agent.mcp_prediction(service, 401))"
      ],
      "outputs": [],
      "execution_count": null
    }
  ],
  "metadata": {
    "aner": {
      "execution_mode": "persistent-session",
      "runtime_mode": "production"
    },
    "kernelspec": {
      "display_name": "Aner",
      "language": "aner",
      "name": "aner"
    },
    "language_info": {
      "name": "aner",
      "file_extension": ".aner"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
