๐Ÿš€ Everything is free โ€” help us improve! Submit feedback and shape the platform.
๐ŸงชTDD Challengeยทadvancedยทโฑ๏ธ 40โ€“55mยทโญ 250 XP

M-052Build an MCP Tool Composition Pipeline

Description

Nebula Corp's AI assistants need to chain multiple MCP tools together to answer complex queries. Build a tool composition engine that takes a plan (a sequence of tool calls where later steps can reference earlier results), executes them in order, and returns the combined result. Handle errors gracefully โ€” if one step fails, the pipeline should report which step failed and why.

Test Cases (3)

Simple single-step pipeline
Single step should execute and return result
Input:executePipeline([{ id: 'step1', tool: 'lookup_customer', args: { customerId: 'C001' } }])
Expected:CONTAINS:Alice
Multi-step with references
Step 2 should use step 1's result
Input:executePipeline([{ id: 'step1', tool: 'lookup_customer', args: { customerId: 'C001' } }, { id: 'step2', tool: 'get_plan_price', args: { plan: '$step1.data.plan' } }])
Expected:CONTAINS:49
Pipeline failure stops execution
Should stop at first failure and report which step failed
Input:executePipeline([{ id: 'step1', tool: 'lookup_customer', args: { customerId: 'C999' } }, { id: 'step2', tool: 'get_plan_price', args: { plan: '$step1.data.plan' } }])
Expected:CONTAINS:failed

Related Lessons

Click Run / Check to validate your solution