Skip to content

Composite Tools Supports Default Return Values #2989

@jerm-dro

Description

@jerm-dro

Summary

Composite tool steps can be skipped for a few reasons:

  • an error occurs, but the composite tool is configured to continue on errors from the step: FailureMode: "continue"
  • the step can be conditional: Condition: "false".

Problems / confusion arise when we depend on the output of a skipped step. The templating engine expands these missing values to "<no value>".

Proposed Solution

Hoisting a slightly modified version of @tgrunnagle's solution from one of the threads below:

We'd require a

step: {
    ...
    // a key value pair is required in defaultResults iff:
    // (the step is conditional OR failure mode is continue) 
    //  AND the key is referenced in downstream steps.
    defaultResults: {
        "some_returned_value_name": "default value for downstream"
    }
}

The defaultResults are used if the step is skipped for any reason.

Acceptance Criteria

  • An integration tests demonstrating default results being used for both conditional and failureMode=continue steps.
  • Unit tests for validation that assert an error is produced if a step may be skipped, its outputs are referenced downstream, and no defaults are configured.
  • Documentation describing when and how to configure the defaultResults in the CRD for vMCP.

Relevant Links

  • A prior discussion where potential solutions are discussed starts here
  • Multiple discussions here highlighting confusing or incorrect behavior solved by configuring defaults.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgoPull requests that update go codekubernetesItems related to KubernetesvmcpVirtual MCP Server related issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions