Skip to main content

Composite tools and workflows

Composite tools let you define multi-step workflows that execute across multiple backends with parallel execution, conditional logic, approval gates, and error handling.

Overview

A composite tool combines multiple backend tool calls into a single workflow. When a client calls a composite tool, Virtual MCP orchestrates the execution across backends, handling dependencies and collecting results.

Key capabilities

  • DAG-based execution: Steps run in parallel when dependencies allow
  • Template expansion: Dynamic arguments using step outputs
  • Elicitation: Request user input mid-workflow (approval gates, choices)
  • Error handling: Configurable abort, continue, or retry behavior
  • Timeouts: Workflow and per-step timeout configuration
info

Elicitation (user prompts during workflow execution) is defined in the CRD but has not been extensively tested. Use with caution in production environments.

Use cases

Incident investigation

Gather data from multiple monitoring systems in parallel:

Deployment with approval

Human-in-the-loop workflow for production deployments:

Cross-system data aggregation

Collect and correlate data from multiple backends:

Workflow definition

Parameters

Define input parameters with types and defaults:

parameters:
required_param: { type: 'string' }
optional_param: { type: 'integer', default: 10 }

Steps

Each step can be a tool call or an elicitation:

steps:
- id: step_name # Unique identifier
tool: backend.tool # Tool to call
arguments: # Arguments with template expansion
arg1: '{{.params.input}}'
dependsOn: [other_step] # Dependencies for DAG execution
condition: '{{.steps.check.output.approved}}' # Optional condition
timeout: '30s' # Step timeout
onError:
action: abort # abort | continue | retry

Elicitation (user prompts)

Request input from users during workflow execution:

- id: approval
type: elicitation
message: 'Proceed with deployment?'
schema:
type: object
properties:
confirm: { type: boolean }
timeout: '5m'

Error handling

Configure behavior when steps fail:

ActionDescription
abortStop workflow immediately
continueLog error, proceed to next step
retryRetry with exponential backoff
onError:
action: retry
maxRetries: 3

Template syntax

Access workflow context in arguments:

TemplateDescription
{{.params.name}}Input parameter
{{.steps.id.output}}Step output
{{.steps.id.content}}Elicitation response content
{{.steps.id.action}}Elicitation action (accept/decline/cancel)

Complete example