Skip to main content

Overview

This guide provides practical examples for common use cases with the MCP Gateway. All examples use standard MCP tool calling format.

Example 1: Discovering and Executing an Action

Step 1: Discover Available Actions

Response:

Step 2: Get Full Action Details

Response:

Step 3: Execute the Action

Response:

Example 2: Searching for Actions

Response:

Get Details and Execute

After finding the right action, get full details and execute:
Then execute with proper parameters.

Example 3: Batch Execution

Reading Multiple Emails

Response:

Example 4: Parallel Multi-Action Execution

Fetching Data from Multiple Sources

Response:

Example 5: Using Response Projection

Extract Specific Fields from Large Response

Response:

Filter and Aggregate Data

Response:

Example 6: Agent Mode - Getting Instructions

Retrieve Agent Instructions

Response:

Example 7: Agent Mode - Listing Applications

Get All Apps with Action Summaries

Response:

Example 8: Agent Mode - Context Management

List All Contexts

Response:

Search for Specific Contexts

Response:

Get Context Details

Response:

Create New Context

Response:

Example 9: Complete Workflow

Multi-Step Workflow Example

Step 1: Discover available actions
Step 2: Get full details for specific actions
Step 3: Execute actions in sequence or parallel
Step 1 Response:
Step 2 Response:
Step 3 Response:

Best Practices

1. Use Summary Mode for Discovery

Always start with detail_level: "summary" when exploring actions to save tokens and improve performance.

2. Get Full Schemas Before Execution

Always call list_actions with specific operationIds to get complete parameter specifications before executing actions.

3. Use Batch Operations for Efficiency

When executing the same action multiple times, use run_action_batch instead of multiple run_action calls.

4. Leverage Parallel Execution

Use run_multi_actions when you need to fetch data from multiple sources simultaneously.

5. Use Response Projection for Large Data

Apply response_projection to reduce response size when you only need specific fields from large responses.

Common Patterns

Pattern: Discover → Get Details → Execute

  1. Use list_actions with detail_level: "summary" to discover
  2. Use list_actions with operationIds to get full schemas
  3. Use run_action with complete parameters to execute

Pattern: Search → Execute

  1. Use search_actions to find relevant actions
  2. Get full details for selected actions
  3. Execute with proper parameters

Pattern: Batch Processing

  1. Identify the action to execute multiple times
  2. Prepare base_context with shared parameters
  3. Prepare batch_context with varying parameters
  4. Execute with run_action_batch

Next Steps