Feature: MCP Adapter coverage – round 3
  Exercise uncovered lines in src/cleveragents/mcp/adapter.py:
    - L25   TYPE_CHECKING import (runtime-untestable, skipped)
    - L131  MCPTransport.connect() raises NotImplementedError
    - L135-136 MCPTransport.call() raises NotImplementedError
    - L348-352 dispatch_notification catches listener exceptions
    - L531-535 register_tools builds slot_dicts from inferred resource slots

  # -----------------------------------------------------------------
  # Base MCPTransport abstract methods (lines 131, 135-136)
  # -----------------------------------------------------------------

  Scenario: Base MCPTransport connect raises NotImplementedError
    Given mcpcov3 a bare MCPTransport instance
    When mcpcov3 I call connect on the base transport
    Then mcpcov3 the error should be a NotImplementedError

  Scenario: Base MCPTransport call raises NotImplementedError
    Given mcpcov3 a bare MCPTransport instance
    When mcpcov3 I call call on the base transport with method "tools/list" and params
    Then mcpcov3 the error should be a NotImplementedError

  # -----------------------------------------------------------------
  # Notification listener exception handling (lines 348-352)
  # -----------------------------------------------------------------

  Scenario: Dispatch notification swallows listener exception
    Given mcpcov3 a connected adapter with a notification listener that raises
    When mcpcov3 I dispatch notification "tools/list_changed" with no params
    Then mcpcov3 no error should propagate
    And mcpcov3 the healthy listener should have received the notification

  Scenario: Dispatch notification with all listeners failing
    Given mcpcov3 a connected adapter with only failing notification listeners
    When mcpcov3 I dispatch notification "tools/list_changed" with no params
    Then mcpcov3 no error should propagate

  # -----------------------------------------------------------------
  # Resource slot inference in register_tools (lines 531-535)
  # -----------------------------------------------------------------

  Scenario: Register tools with file_path param infers file resource slot
    Given mcpcov3 a connected adapter with a tool having file_path in its schema
    And mcpcov3 an empty tool registry
    When mcpcov3 I register tools with namespace "mcp-fs"
    Then mcpcov3 the registry should contain tool "mcp-fs/write_file"
    And mcpcov3 tool "mcp-fs/write_file" source_metadata should have resource_slots
    And mcpcov3 resource slot 0 should have name "file" and type "file"

  Scenario: Register tools with directory param infers directory resource slot
    Given mcpcov3 a connected adapter with a tool having directory in its schema
    And mcpcov3 an empty tool registry
    When mcpcov3 I register tools with namespace "mcp-fs"
    Then mcpcov3 the registry should contain tool "mcp-fs/list_dir"
    And mcpcov3 tool "mcp-fs/list_dir" source_metadata should have resource_slots
    And mcpcov3 resource slot 0 should have name "directory" and type "directory"

  Scenario: Register tools with repo_path param infers repository resource slot
    Given mcpcov3 a connected adapter with a tool having repo_path in its schema
    And mcpcov3 an empty tool registry
    When mcpcov3 I register tools with namespace "mcp-git"
    Then mcpcov3 the registry should contain tool "mcp-git/git_status"
    And mcpcov3 tool "mcp-git/git_status" source_metadata should have resource_slots
    And mcpcov3 resource slot 0 should have name "repository" and type "git-checkout"

  Scenario: Register tools with multiple resource params infers multiple slots
    Given mcpcov3 a connected adapter with a tool having file_path and directory in its schema
    And mcpcov3 an empty tool registry
    When mcpcov3 I register tools with namespace "mcp-multi"
    Then mcpcov3 the registry should contain tool "mcp-multi/copy_file"
    And mcpcov3 tool "mcp-multi/copy_file" source_metadata should have resource_slots with count 2
