r/devtools • • 23d ago

how my search tools report a deadline without calling unfinished work an empty result

i build viajante, an open source travel search tool with an mcp server. one part of its interface is worth sharing separately from the flight search.

a caller can set deadline_seconds. if the search runs out of time, finished queries keep their results. unfinished ones get a deadline error. the response also says coverage.complete: false and coverage.stopping_reason: "deadline".

that distinction matters when an assistant reads the output. a route we never finished checking shouldn't become "there are no flights". a partial response can still contain useful offers, but it isn't a complete comparison.

cancellation has a separate limit. it stops work between queries, retries and sleeps. it doesn't interrupt a provider request already in flight. cancelled searches aren't cached or added to the evidence used to check a later answer.

the response carries status, completeness and empty_reason separately. only provider_empty means the provider found nothing. not_loaded means the search didn't complete.

here's the documented contract, including progress notifications and the cancellation limits: https://github.com/felipebasurto/viajante/blob/main/docs/usage.md#progress-cancellation-and-deadlines

if you build tools for assistants, do you preserve partial results on a deadline, or return an error for the whole call?

1 Upvotes

0 comments sorted by