Answer progress0%
← All questions

Production question

How do I track latency for MCP tool calls?

Record the duration of every tool call as a histogram and compare p50, p95 and p99 per server and tool over the same window. Averages hide the slow tail, and percentiles from different instances must not be averaged together. Flowlines shows p50, p95 and p99 latency per tool next to the users and AI clients affected.

The answer

MCP tool latency is the time between your server receiving a tool call and returning its result. Record it at the tool boundary, then break it into the downstream calls the tool makes, so a slow call points to the dependency that caused it.

MeasureWhat it tells youWatch out for
p50 durationThe typical call.A stable median can hide a slow tail.
p95 and p99 durationThe calls users notice.Small samples make high percentiles unstable.
Latency by dependencyWhich API or database is slow.Duplicate spans inflate counts and timing.
Timeouts and cancellationsCalls the client gave up on.Report them separately from errors.

Compare the same tool on the same server and environment. A tool that searches across many records can be slower for good reasons, and a different mix of jobs changes the distribution. In Flowlines, read a slow tool alongside its use cases and affected sessions to decide whether the latency actually stops people from finishing their work.

How should I set latency alerts for MCP tools?

  1. Alert on p95 per tool over 5 to 10 minutes, and only above a minimum number of calls.
  2. Report timeouts and cancellations separately from slow successful calls.
  3. Compare against the same hour last week, since MCP traffic often follows working hours.
  4. Break a slow tool down by its dependency spans before changing the tool itself.
  5. Watch response size too: large results slow the client and cost context, even when the server is fast.
  6. Track initialize and tools/list latency separately from tool calls, because they affect every session.

Published

100 MCP sessions a month, free

Answer it with your own production evidence.