Skip to content

feat(mcp): clear retryable errors + cold-start note for hosted clients - #20

Open
abrahamperz wants to merge 1 commit into
mainfrom
fix/mcp-cold-start-notice
Open

abrahamperz wants to merge 1 commit into
mainfrom
fix/mcp-cold-start-notice

Conversation

@abrahamperz

Copy link
Copy Markdown
Owner

Qué

Que el cliente del MCP sepa reintentar cuando una llamada falla por cold-start o un sitio lento, en vez de recibir el genérico "error executing tool".

Por qué

Hoy, cualquier excepción normal en un handler llega al cliente enmascarada como "error executing tool fetch_markdown" (el propio código ya lo comenta en _guarded). Eso fue justo lo que vimos al probar tras el deploy: la 1ª llamada (cold start) falló con ese mensaje opaco, y el reintento funcionó.

Cambios

  1. _call() envuelve los 6 tools hospedados: una excepción que no sea ToolError se re-lanza como ToolError con la razón + "retry once" (amable con cold-start). Los ToolError (SSRF, seed errors) pasan sin tocar.
  2. Instrucciones del server: añaden una línea avisando que la primera llamada tras inactividad puede ir lenta o fallar una vez por cold-start → reintentar.
  3. Tests cubren ambas ramas de _call.

Notas

  • Costo 0: no mantiene nada caliente (eso subiría el gasto). Solo mejora el mensaje y avisa al agente para que reintente.
  • No se puede "avisar en vivo" durante un cold-start puro (el código aún no corre); esto es lo máximo sin subir consumo.

🤖 Generated with Claude Code

A plain exception from a tool handler reached MCP clients as an opaque
"error executing tool" (what a cold-start / slow-target failure looked
like). Now:

- _call() wraps every hosted tool: non-ToolError exceptions are re-raised
  as ToolError with the reason + a retry hint; ToolErrors pass through.
- Server instructions note that the first call after idle may need a retry
  while the function cold-starts.
- Tests cover both _call branches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bytecrawl Ready Ready Preview Oct 10, 2026 3:38pm UTC

This branch was successfully deployed

1 active deployment
Preview — 2c1ed1cf Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant