feat: add integration tools abstraction and TrustFoundry legal research
From the PR description
Summary
- Add
ToolIntegrationinterface 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_startevents 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.mddocumenting 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 backendnpm run build --prefix frontend- Verified TrustFoundry tools appear in chat when
TRUSTFOUNDRY_ENABLED=trueandTRUSTFOUNDRY_API_KEYare 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.