feat: add integration tools abstraction and TrustFoundry legal research

🟢 open · #169 · Open-Legal-Products/mike ← trustfoundry-ai/mike · opened 1mo ago by iamgroot2285 · +697-5 across 8 files · ↗ on GitHub

From the PR description

Summary

  • Add ToolIntegration interface for plugging external tool providers into assistant chat. The current design targets integrations backed by API keys; providers requiring OAuth or per-user token management would need additional key-storage infrastructure.
  • Surface integration tool display names in SSE tool_call_start events so the frontend shows user-friendly labels (e.g. "Running TrustFoundry Legal Research...") - display names are defined per-provider, keeping everything encapsulated in a single module
  • Return explicit error results for unrecognized tool calls instead of silently dropping them
  • Add docs/integrations.md documenting optional third-party integration setup
  • Implement TrustFoundry as the first integration: legal search, citation validation, and usage tools

Why

Mike's chat tools were hardcoded - no way to add external tool providers without editing chatTools.ts directly. The ToolIntegration abstraction lets new providers be added as self-contained modules with their own tool definitions, display names, and execution logic.

Test

  • npm run build --prefix backend
  • npm run build --prefix frontend
  • Verified TrustFoundry tools appear in chat when TRUSTFOUNDRY_ENABLED=true and TRUSTFOUNDRY_API_KEY are set; hidden when disabled

Our analysis

Add a pluggable tool-integration layer for external chat providers — read the full analysis →

Think the analysis missed something the PR description covers?

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-169.md from inside the repo you want the changes in.

⬇ Download capture-pull-169.md