Skip to content

LLM provider tools: scope the not-found discovery hint away from the list tool #429

Description

@mocha06

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.

Fix (mirror #427 / 98c3a8d)

  • 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions