# Lab L09 verification output (Node on PATH: lab-local 24.22.3; Inspector pinned 2.16.0)
# Date: 2026-11-26T12:56:42Z  Host: macOS 27.2.1 arm64  uv 0.10.2  node(PATH) v24.22.3
# Command: ./run.sh verify
# uv.lock sha256: 0efb8682c3a5a107191ad7f11f2b60280996c7047f35d40a2954b230cff4077f | package-lock.json sha256: e5b632a74bc2e869949d9ae32f48f5f14edf9f564bd10e1ac00818dd9cc5b2b5
# Exit code: 0

== pytest
============================= test session starts ==============================
platform darwin -- Python 3.12.12, pytest-9.2.0, pluggy-1.7.0 -- /Users/majorproduction/turningpoint-course-exports/mcp-v2-20261126/lab-l09/.venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/majorproduction/turningpoint-course-exports/mcp-v2-20261126/lab-l09
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.16.0
collecting ... collected 13 items

tests/test_in_memory.py::test_lists_two_tools_one_resource_one_prompt PASSED [  7%]
tests/test_in_memory.py::test_tool_descriptions_are_present PASSED       [ 15%]
tests/test_in_memory.py::test_add_note_returns_structured_content_matching_output_schema PASSED [ 23%]
tests/test_in_memory.py::test_get_note_bad_input_is_a_tool_error_not_a_crash[n-1-expected the format N-001] PASSED [ 30%]
tests/test_in_memory.py::test_get_note_bad_input_is_a_tool_error_not_a_crash[../../secret-expected the format N-001] PASSED [ 38%]
tests/test_in_memory.py::test_get_note_bad_input_is_a_tool_error_not_a_crash[N-404-No note with id N-404] PASSED [ 46%]
tests/test_in_memory.py::test_schema_violation_is_reported_as_is_error PASSED [ 53%]
tests/test_in_memory.py::test_state_change_is_visible_in_resource PASSED [ 61%]
tests/test_in_memory.py::test_store_is_reset_between_tests PASSED        [ 69%]
tests/test_in_memory.py::test_prompt_uses_argument PASSED                [ 76%]
tests/test_stdio.py::test_stdio_modern_negotiates_2026_07_28 PASSED      [ 84%]
tests/test_stdio.py::test_stdio_legacy_handshake_still_works PASSED      [ 92%]
tests/test_stdio.py::test_stdio_server_keeps_stdout_clean PASSED         [100%]

============================== 13 passed in 3.79s ==============================
node v24.22.3: OK for Inspector 2.16.0 (^22.23.4 || ^24.22.1 || >=26.12.1)
== Inspector version
2.16.0
== Inspector CLI: tools/list
[notes-server] starting on stdio
{
  "tools": [
    {
      "name": "add_note",
      "title": "Add a note",
      "description": "Create a note in the demo store and return it. The returned object is structured content.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "title": {
            "description": "Short title (1-80 characters)",
            "maxLength": 80,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          },
          "body": {
            "default": "",
            "description": "Note text (up to 2000 characters)",
            "maxLength": 2000,
            "title": "Body",
            "type": "string"
          },
          "tags": {
            "default": [],
            "description": "Up to 5 lowercase tags",
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "title"
        ],
        "title": "add_noteArguments"
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "body": {
            "title": "Body",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "id",
          "title",
          "body",
          "tags"
        ],
        "title": "Note"
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false
      }
    },
    {
      "name": "get_note",
      "title": "Get a note by id",
      "description": "Return one note by its id (format N-001).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "note_id": {
            "description": "Note id such as N-001",
            "title": "Note Id",
            "type": "string"
          }
        },
        "required": [
          "note_id"
        ],
        "title": "get_noteArguments"
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "body": {
            "title": "Body",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "id",
          "title",
          "body",
          "tags"
        ],
        "title": "Note"
      },
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      }
    }
  ]
}
== Inspector CLI: tools/call get_note note_id=N-001
[notes-server] starting on stdio
{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"id\": \"N-001\",\n  \"title\": \"Demo: buy cables\",\n  \"body\": \"Two demo USB-C cables.\",\n  \"tags\": [\n    \"demo\",\n    \"shopping\"\n  ]\n}"
    }
  ],
  "structuredContent": {
    "id": "N-001",
    "title": "Demo: buy cables",
    "body": "Two demo USB-C cables.",
    "tags": [
      "demo",
      "shopping"
    ]
  },
  "isError": false
}
== Inspector CLI: tools/call get_note note_id=bad (expect isError true)
[notes-server] starting on stdio
Tool 'get_note' failed: "Error executing tool get_note: Invalid note id 'bad': expected the format N-001."
{
  "content": [
    {
      "type": "text",
      "text": "Error executing tool get_note: Invalid note id 'bad': expected the format N-001."
    }
  ],
  "isError": true
}
{"error":{"code":"tool_is_error","message":"Tool 'get_note' returned isError:true."}}
(Inspector CLI exit code 5 for the isError result, as expected)
== Inspector CLI: resources/read notes://index
[notes-server] starting on stdio
{
  "contents": [
    {
      "uri": "notes://index",
      "mimeType": "application/json",
      "text": "[{\"id\": \"N-001\", \"title\": \"Demo: buy cables\"}, {\"id\": \"N-002\", \"title\": \"Demo: weekly review\"}]"
    }
  ]
}

L09 VERIFY: pytest and Inspector CLI both completed
