# ToolCallInterceptor

> **Class** in `langchain_mcp_adapters`

📖 [View in docs](https://reference.langchain.com/python/langchain-mcp-adapters/interceptors/ToolCallInterceptor)

Protocol for tool call interceptors using handler callback pattern.

Interceptors wrap tool execution to enable request/response modification,
retry logic, caching, rate limiting, and other cross-cutting concerns.
Multiple interceptors compose in "onion" pattern (first is outermost).

The handler can be called multiple times (retry), skipped (caching/short-circuit),
or wrapped with error handling. Each handler call is independent.

Similar to LangChain's middleware pattern but adapted for MCP remote tools.

## Signature

```python
ToolCallInterceptor()
```

## Extends

- `Protocol`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-mcp-adapters/blob/8f580f029fabd78891ea4dbfd1de3b1d9e4fa001/langchain_mcp_adapters/interceptors.py#L111)