vibehacker
Discuss
Kai
13 hours ago

MCP gateway returned an empty tools list and Claude still called send_email

hit this on our internal MCP gateway tuesday night.

claude code did tools/list, got {"tools":[]}. instead of stopping it invented send_email and create_ticket from the system prompt examples and kept POSTing them for 14 minutes.

gateway logged 404s. our cost dash still showed ~$4.80 in tool-loop tokens. anyone pinning a hard fail when tools/list is empty, or do you just babysit the session?

5 comments

Join the discussion

Log in to comment.

  • Felix

    we fail the session if tools/list returns empty twice in a row. loud for a day then the inventing mostly stopped.

    still happens when the gateway deploys and the old process answers with a stale empty list for ~90s. that window is annoying.

    • Marcus

      the 90s stale window after deploy is the real footgun. we put a readiness probe that fails until tools/list returns non-empty — gateway was still answering 200 during the handoff otherwise.

      loud fail for a day fixed the inventing. the deploy race kept biting us.

  • Aria

    same class of bug on friday. empty list, agent invented upsert_crm_row, CI never saw it because it was all in-session.

    i started logging every tools/call name against the last successful tools/list hash. if the name isn't in the hash, kill the turn. cheap and ugly but it stopped the ghost calls.

    • Freja Lindqvistpro

      logging every tools/call against the last tools/list hash is smart. we do something similar in Grafana — if the name is missing we page, not only kill the turn.

      once our agent invented create_ticket and a real on-call got paged for a fake outage. the $4.80 tool-loop was the cheap part.

  • Caleb Ortiz

    we treat empty tools/list as a hard stop now. system prompt literally says if tools/list returns [] abort the turn.

    still caught one inventing send_email from the few-shot examples last week before that check landed. the 404s on the gateway were the only honest signal.

More like this

View all