Uploaded image for project: 'Network Edge'
  1. Network Edge
  2. NE-2488

Implement router_show_config, router_show_info, router_show_sessions MCP Tools

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None

      Description

      Implement the read-only router inspection tools using native Go libraries. These tools provide safe, non-mutating inspection of OpenShift Router pods, allowing users to view configuration, runtime statistics, and active sessions.

      Goals

      1. Implement inspection tools for OpenShift Router pods (HAProxy).
      2. Ensure strict read-only execution.

        Tool Definitions

        1. router_show_config

      • Description: View the router's configuration.
      • Input Schema:
        {
          "type": "object",
          "properties": {
            "pod": { "type": "string", "description": "Router pod name (optional)" }
          }
        }
        
      • Output Schema:
        {
          "type": "string",
          "description": "Router configuration (haproxy.cfg) wrapped in markdown code block"
        }
        

        2. router_show_info

      • Description: Get router runtime information and statistics.
      • Input Schema:
        {
          "type": "object",
          "properties": {
            "pod": { "type": "string", "description": "Router pod name (optional)" }
          }
        }
        
      • Output Schema:
        {
          "type": "string",
          "description": "HAProxy runtime info and stats wrapped in markdown code block"
        }
        

        3. router_show_sessions

      • Description: View all active sessions in the router.
      • Input Schema:
        {
          "type": "object",
          "properties": {
            "pod": { "type": "string", "description": "Router pod name (optional)" }
          }
        }
        
      • Output Schema:
        {
          "type": "string",
          "description": "Active session list wrapped in markdown code block"
        }
        

        Implementation Steps

      1. Implement router_show_config:
        • Logic: Identify the target router pod. Exec into the container and retrieve the configuration. Return as a markdown block.
      2. Implement router_show_info:
        • Logic: Identify the target router pod. Exec into the container and query the HAProxy stats socket (e.g., `show info`, `show stat`).
      3. Implement router_show_sessions:
        • Logic: Identify the target router pod. Exec into the container and query the HAProxy session table.
      4. Constraint Checklist:
        • No usage of `oc` binary (use client-go/remotecommand for exec).
        • Must use structured error handling.
        • Verify `pod` parameter: if missing, select a default router pod.

          Acceptance Criteria

      • MCP tool router_show_config matches schema and returns configuration.
      • MCP tool router_show_info matches schema and returns stats.
      • MCP tool router_show_sessions matches schema and returns session list.
      • All implementation is native Go (no shell-outs to `oc`).

              Unassigned Unassigned
              btofelrh Brett Tofel
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: