Skip to main content

Async agent tools use case

Start a new project using the Claude async MCP tool server use case example.

Python SDK

Claude async MCP tool server use case

Clone this repo

The problem

The main issue with MCP—and LLM tool calling in general—is that it is synchronous, with no built-in mechanisms for handling failure.

Even though MCP standardizes a tool-calling convention, it ignores the other issues that arise from building a distributed system and as the developer you are burdened with figuring out:

  • Supervision, such as timeouts, to detect issues
  • Retry logic for application-level errors
  • Deduplication and/or idempotency guarantees
  • Recovery for process crashes

The solution

The solution is promises.

The MCP Server Quickstart guide uses weather forecasting as an example use case.

This example flips it around and uses historic weather data gathering as our example, a use case which could take a much longer time and better reflect the need for a background job.

And, instead of a single tool such as get_weather_data, we will create three tools:

  • start gathering
  • probe status
  • await result

The key is that the start gathering tool, instead of blocking on the result of the data gather job, kicks off a background job and returns a promise ID.

Integrating Resonate into a MCP server preserves the standardized tool calling while completely transforming it into a Durable Distributed System.