Follow-up to the review on #427, which fixed this pattern for the knowledge base tools.
Problem
_provider_tool_error_from_exception in packages/mcp/src/pipefy_mcp/tools/llm_provider_tools.py appends "Use 'get_llm_providers' to list provider IDs for the organization." to every classified not_found error. That includes failures inside get_llm_providers itself (e.g. a bad organization UUID), so the error tells an agent to retry the exact tool that just failed — self-referential guidance instead of useful discovery.
- Add a
not_found_hint: bool = True parameter to _provider_tool_error_from_exception and pass not_found_hint=False at the get_llm_providers call site; per-id tools (get_llm_provider_dependencies, etc.) keep the hint.
- Regression tests:
get_llm_providers + not_found asserts the hint is absent; a per-id tool still asserts it present.
Acceptance
- A
not_found failure from get_llm_providers carries the classified problem (kind/code/correlation_id) without the self-referential hint.
- Per-id provider tools keep the discovery hint.
- Tests cover both paths.
Follow-up to the review on #427, which fixed this pattern for the knowledge base tools.
Problem
_provider_tool_error_from_exceptioninpackages/mcp/src/pipefy_mcp/tools/llm_provider_tools.pyappends "Use 'get_llm_providers' to list provider IDs for the organization." to every classifiednot_founderror. That includes failures insideget_llm_providersitself (e.g. a bad organization UUID), so the error tells an agent to retry the exact tool that just failed — self-referential guidance instead of useful discovery.Fix (mirror #427 / 98c3a8d)
not_found_hint: bool = Trueparameter to_provider_tool_error_from_exceptionand passnot_found_hint=Falseat theget_llm_providerscall site; per-id tools (get_llm_provider_dependencies, etc.) keep the hint.get_llm_providers+not_foundasserts the hint is absent; a per-id tool still asserts it present.Acceptance
not_foundfailure fromget_llm_providerscarries the classified problem (kind/code/correlation_id) without the self-referential hint.