version: "1.0"

# MCP Server Metadata
server:
  name: "switchExample"
  version: "1.0.0"
  title: "Switch Node Example"
  instructions: "This example demonstrates conditional routing using switch nodes with JSON Logic."

# Tool Definitions
tools:
  - name: "test_switch"
    description: "Test switch node with conditional routing"
    inputSchema:
      type: "object"
      properties:
        value:
          type: "number"
          description: "A numeric value to route based on"
      required:
        - value
    outputSchema:
      type: "object"
      properties:
        result:
          type: "string"
          description: "The routing result"
    nodes:
      # Entry node: Receives tool arguments
      - id: "entry"
        type: "entry"
        next: "switch_node"
      
      # Switch node: Routes based on value
      - id: "switch_node"
        type: "switch"
        conditions:
          - rule:
              ">":
                - { var: "entry.value" }
                - 10
            next: "high_path"
          - rule:
              ">":
                - { var: "entry.value" }
                - 0
            next: "low_path"
        next: "zero_path"  # Default: zero/negative path
      
      # High path (> 10)
      - id: "high_path"
        type: "transform"
        transform:
          expr: '{ "result": "high" }'
        next: "exit"
      
      # Low path (> 0 but <= 10)
      - id: "low_path"
        type: "transform"
        transform:
          expr: '{ "result": "low" }'
        next: "exit"
      
      # Zero/negative path (default)
      - id: "zero_path"
        type: "transform"
        transform:
          expr: '{ "result": "zero_or_negative" }'
        next: "exit"
      
      # Exit node: Returns the result
      - id: "exit"
        type: "exit"
