Skip to content

Mutual exclusivity validation for namespace and all_namespaces in Argo and Helm MCP tools #100

@KaranJagtiani

Description

@KaranJagtiani

Several MCP tools accept both namespace and all_namespaces parameters but don't validate that they're mutually exclusive. The k8s_get tool in kubectl.py already has this validation, but the same pattern is missing in Argo and Helm tools. Passing both parameters simultaneously leads to undefined behavior.

Scope

  • MCP (mcp/tools/argo.py):

    • Add mutual exclusivity validation to argo_list_experiments (around line 239): raise a ValueError if both namespace and all_namespaces are provided.
    • Add the same validation to argo_list_analysisruns (around line 295).
    • Follow the existing pattern from k8s_get in mcp/tools/kubectl.py (lines 90-96).
  • MCP (mcp/tools/helm.py):

    • Add mutual exclusivity validation to helm_list_releases (around line 30): raise a ValueError if both namespace and all_namespaces are provided.

Acceptance criteria

  • Passing both namespace and all_namespaces to any of the three tools returns a clear error message.
  • Passing only namespace or only all_namespaces continues to work as expected.
  • Default behavior (neither provided) is unchanged.
  • Validation matches the existing pattern in k8s_get.

How to test manually

  1. Run the Engine and MCP server locally (see engine/README.md and mcp/README.md).
  2. From the UI, ask: "List all experiments across all namespaces in the kube-system namespace" (intentionally conflicting).
  3. Verify the tool returns a clear error about mutually exclusive parameters.
  4. Ask: "List all helm releases in the default namespace" — verify it works normally.
  5. Ask: "List all helm releases across all namespaces" — verify it works normally.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersmcpTailor-made MCP powering Skyflo.ai

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions