Logo

Getting Started

  • Quickstart Guide
    • Installation
    • Quick Start
      • Option 1: Default Registry (Simplest)
      • Option 2: Fluent Builder API (Most Concise)
      • Option 3: Custom Registry (Full Control)
    • Going Further: Auto-Generate Mocks from MCP Servers
    • Common Patterns
      • Using MockBuilder (Fluent API)
      • Call Recording and Verification
      • Context-Aware Mocks
      • Input-Based Mocking
      • Dynamic Values
      • Complete Evaluation Scenario
    • Scenario Definition Examples
      • Multi-Tool Workflow Scenario
      • Multi-Case Same Tool (Different Inputs, Different Outputs)
      • Dynamic Placeholders Combined with Input Matching
      • Multiple Operators on the Same Field
    • Testing Examples
      • pytest with LangGraph (Recommended)
    • Debugging
    • Next Steps
  • LangGraph Integration
    • Overview
    • ToolNode Wrapper
      • Prerequisites
      • Option A: Default Registry (Simplest) ⭐
      • Option B: Custom Registry (Full Control)
      • API Reference
      • Troubleshooting
        • Mocks Not Working
      • CallRecorder: Tool Call Verification
        • Quick Start
        • API Reference
        • Query Methods
        • Assertion Methods
        • CallRecord Properties
        • Examples
        • Thread Safety
    • Shared Concepts
      • MockBuilder: Fluent Mock Registration
      • Mocked Tool Patterns
        • Pattern 1: Static Mock
        • Pattern 2: Input-Echo Mock
        • Pattern 3: Mocks-Based Mock (Data-Driven)
        • Pattern 4: Conditional Mock (with when predicate)
        • Pattern 5: Dynamic Placeholders
        • Pattern 6: Context-Aware Mock (Runtime Config Access)
      • scenario_metadata Structure
      • Input Matching
      • Dynamic Placeholders
      • Custom Mocked Tools
        • Mocked Tool Signature
        • Example: Custom Key Name
        • Example: Stateful Factory
        • Example: Tenant-Aware Factory
      • Best Practices
        • 1. Register at Startup
        • 2. Keep Mocked Tools Pure
        • 3. Enable Logging for Debugging
      • Mock Signature Validation
        • Validation Points
        • Controlling Validation
        • Example: Registration-Time Validation
        • Example: Runtime Validation
        • What Gets Validated
        • Opting Out
        • MCP Tool Support
    • Using Mirrored Tools
      • Quick Start with Mirroring
      • LangGraph-Optimized Mirroring
      • Mirroring with HTTP Authentication
      • Mirroring with LangGraph Registry Integration
      • Combining with Custom Mocks

Guides

  • MCP Tool Mirroring Guide
    • Installation
    • Overview
      • When to Use Mirroring
    • Quick Start
      • Basic Mirroring (stdio)
      • HTTP Server Mirroring
      • One-Line Convenience Functions
    • LLM-Powered Generation
      • Quality Presets
    • HTTP Authentication
      • Security Features
    • Customizing Mock Data
    • CI/CD Optimization
      • Caching
    • API Reference
      • ToolMirror Class
      • Mirroring Methods
      • Convenience Functions
    • Integration with Approaches
    • See Also
  • Matchers and Resolvers Guide
    • Overview
    • Input Matchers
      • Basic Usage
      • Supported Operators
      • Multiple Conditions
      • Catch-All Patterns
      • Real-World Examples
        • Example 1: Customer Tier Logic
        • Example 2: Bill Filtering
    • Value Resolvers
      • Basic Usage
      • Timestamp Placeholders
      • Input Reference Placeholders
      • Generator Placeholders
      • Real-World Examples
        • Example 1: Invoice Creation
        • Example 2: User Profile
        • Example 3: Billing Period
    • Combining Matchers and Resolvers
    • Using with LangGraph
    • Best Practices
      • 1. Order Patterns from Specific to General
      • 2. Use Defaults for Missing Fields
      • 3. Use Sequences for Related IDs
      • 4. Combine Operators for Range Matching
      • 5. Use $exists for Optional Fields
    • Debugging
      • Check if a Pattern Matches
      • Check for Placeholders
      • Enable Debug Logging
    • API Reference
      • Matchers
      • Resolvers
    • Next Steps
  • MockBuilder: Fluent Mock Registration
    • Quick Start
    • Using the Default Registry
    • API Reference
    • Methods
    • Examples
      • Static Return Value
      • Conditional Mocking
      • Input Echoing
      • Custom Callable
      • Chaining Methods
      • Scenario Predicates and Input Conditions
    • Notes and Limits
    • Integration Examples
      • With LangGraph Per-Invocation Mocking
      • With Default Registry (Simplest)
    • Input Condition Behavior
      • Builder vs. Data-Driven
    • Advanced Mock Function Patterns
      • Complex Logic with returns_fn()
      • Error Simulation
      • Scenario Predicates with when()
      • Combining when() + echoes_input() + returns()
      • Mock Factory with registry.register() for Full Control
    • See Also
  • Call Recording Guide
    • Overview
    • Quick Start
    • Setup
      • With Custom Registry
      • Key Point
    • Query Methods
      • Examples
    • Assertion Methods
      • Examples
    • CallRecord Properties
      • Inspecting CallRecords
    • pytest Integration
      • Basic Fixture Pattern
      • Resetting Between Tests
      • Parametrized Tests
    • Advanced Patterns
      • Verifying Tool Call Sequences
      • Checking Call Counts
      • Verifying Mock vs Real Calls
      • Combining with Signature Validation
    • Thread Safety
    • See Also
  • Context-Aware Mocks
    • Overview
      • When to Use
    • Quick Start
    • How It Works
      • Signature Inspection
      • The get_configurable_context Helper
    • Examples
      • Example 1: User Identity Mock
      • Example 2: Tenant-Specific Data
      • Example 3: Request-Specific Mock
      • Example 4: Combined with scenario_metadata
    • Testing with Context-Aware Mocks
      • pytest Example
      • Multi-Tenant Test
    • Key Points
    • More Patterns
      • Mock Factory Using Both scenario_metadata and config
      • Using {{config.*}} Placeholders in Scenario Definitions
      • Multi-Tenant Mock with Config-Driven Behavior
    • See Also
  • Mock Signature Validation Guide
    • Overview
    • Validation Options
    • Registration-Time Validation
      • How to Enable
    • Runtime Validation
      • How to Enable
    • Validating Scenario Metadata Cases
    • Strict Mock Errors
    • Opting Out
    • What Gets Validated
    • MCP Tool Support
    • Complete Example
      • Belt-and-Suspenders Validation
      • pytest Integration
    • API Reference
    • See Also

Reference

  • Mock Data Format Reference
    • Basic Structure
      • Single Case
      • Multiple Cases with Input Matching
      • Case Fields
    • Input Matching Operators
      • Comparison Operators
      • Set Operators
      • String Operators
      • Existence Operator
      • Combined Operators
    • Dynamic Placeholders
      • Timestamp Placeholders
      • Input Reference Placeholders
      • Config Reference Placeholders
      • Generator Placeholders
    • Complete Examples
      • Customer Service Mock
      • Invoice Creation Mock
      • Bills Query Mock
    • Matching Precedence
      • No-Match Behavior
    • Validation
      • Required Fields
      • Type Coercion
      • Null Handling
  • Dependencies
    • Core Dependencies
      • langchain-core
      • pydantic
      • langgraph
    • Development Dependencies
    • Optional Dependencies
      • For LLM-powered mock generation
      • For MCP mirroring support
    • Version Compatibility
      • Python Versions
      • LangChain Ecosystem
    • Dependency Graph
    • Minimal Installation
    • Troubleshooting
      • Dependency Conflicts
      • Missing Optional Dependencies
  • Mock Input Validation Reference
    • Overview
    • Signature Validation
      • What it catches
      • What happens at runtime
    • Parameter Validation for Data-Driven Mocks
    • Validating Full Scenario Metadata
    • Data-Driven Mock Notes
    • What This Page Does Not Cover
    • See Also
  • Architecture Overview
    • High-Level Architecture
    • Module Structure
    • Core Components
      • 1. InputMatcher
      • 2. ValueResolver
      • 3. MockBuilder
      • 4. CallRecorder
      • 5. MockToolsRegistry (LangGraph)
    • LangGraph Integration Flow
      • Wrapper Pattern ⭐ (Recommended)
    • MCP Mirroring Architecture
    • Thread Safety
    • Extension Points
StuntDouble
  • Search


© Copyright 2025-2026, StuntDouble Contributors.

Built with Sphinx using a theme provided by Read the Docs.