Skip to content

fix(mcp): scope the not-found hint away from the LLM provider list tool#431

Merged
mocha06 merged 1 commit into
devfrom
rc-dev/fix/provider-not-found-hint
Jul 18, 2026
Merged

fix(mcp): scope the not-found hint away from the LLM provider list tool#431
mocha06 merged 1 commit into
devfrom
rc-dev/fix/provider-not-found-hint

Conversation

@mocha06

@mocha06 mocha06 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Motivation

_provider_tool_error_from_exception appended "Use 'get_llm_providers' to list provider IDs for the organization." to every classified not_found error — including failures inside get_llm_providers itself (e.g. a bad organization UUID). The error then told the agent to retry the exact tool that just failed: self-referential guidance instead of useful discovery.

Outcome

A not_found failure from get_llm_providers now carries the classified problem (kind/code/correlation_id) without the self-referential hint. The per-id provider tools (get_llm_provider_dependencies, etc.) keep the discovery hint. Mirrors the fix already applied to the knowledge-base tools.

Closes #429

_provider_tool_error_from_exception appended the get_llm_providers discovery
hint to every classified not_found error, including failures inside
get_llm_providers itself — telling the caller to retry the tool that just
failed. A keyword-only not_found_hint (default True) now gates the hint; the
list tool passes False while per-id tools keep it. Mirrors the same fix on the
knowledge-base tools.

Closes #429
@mocha06 mocha06 self-assigned this Jul 18, 2026
@mocha06
mocha06 requested a review from adriannoes July 18, 2026 04:23

@adriannoes adriannoes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Surgical fix for the self-referential not_found discovery hint on get_llm_providers. It mirrors the knowledge-base pattern from #427, meets #429 acceptance, and keeps the classified problem envelope (kind/code/correlation_id). Reviewed with checkout+tests (13 provider tool tests green) and CI lint/test green on tip.

What worked well

Keyword-only not_found_hint with list-tool opt-out, a complementary regression pair (list without hint / dependencies with hint), and a minimal surface area.

Review path

  • Checked out ff89f460, ran ruff and packages/mcp/tests/tools/test_llm_provider_tools.py (13 passed); CI green on tip.
  • Call-site matrix and KB parity: only the inventory list needed False; default True remains correct for get_llm_provider_dependencies.
  • Residual wrong-hint UX on non-per-id tools is pre-existing and out of #429 scope; left as a follow-up, not blocking.

@mocha06
mocha06 merged commit abe4aa5 into dev Jul 18, 2026
2 checks passed
@mocha06
mocha06 deleted the rc-dev/fix/provider-not-found-hint branch July 18, 2026 06:42
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.

2 participants