Skip to content

Lesson 4 of 12 · 3 min read

Long-Running Tool Calls

Some tools take minutes or hours: a test suite, a data export, a background check. The asynchronous pattern starts the work and returns a handle; the caller tracks it by polling with backoff, a progress stream or a notification; the result is fetched when ready and kept for a stated time; cancellation and timeouts are explicit. MCP (experimental task handles since its 2025-11-25 revision) and A2A support this shape, but the rules are protocol-independent: idempotent start, a durable record of the handle, authorization bound to it, and no worker held while waiting.

Premium lessonReviewed By the AIAgentInterviews editorial team
Get full Premium access · $25

All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.

6 months · One payment · No auto-renewal

Practise it as an interviewer asks it

Course lessons that teach this

Related lessons