Every chat tool is registered in tool_registry with a side-effects taxonomy. The tool_role_palettes table grants tools to roles. Mike's chat session loads only the palette for his current role — the LLM sees a filtered catalog and cannot invoke ungranted tools. Telemetry from tool_invocations drives a nightly recompute of invocation_count_7d, so least-used tools surface for review.
From SELECT category, COUNT(*) FROM tool_registry GROUP BY category. Tool catalog ships in src/chat_tools/prompt.ts as CHAT_TOOLS_FOR_PROMPT.
Total: 50 tools across 12 categories. Numbers reflect canonical R561 catalog; live count may differ if tools were added/retired this round (check src/chat_tools/prompt.ts — CHAT_TOOLS_FOR_PROMPT).
| value | writes | requires HITL | example tool |
|---|---|---|---|
none | none | no | search_tools |
reads_ns | read-only NS via SuiteQL | no | get_customer_by_name |
writes_ns | direct NS write (rare; via RESTlet) | yes — bypasses queue is forbidden | (legacy only; deprecated) |
writes_d1 | D1 mutation only (no NS) | depends — risk-tier driven | add_entity_note |
stages_proposed_action | row in proposed_actions | YES — ADR-031 invariant | update_vendor_cost |
writes_kv | CACHE binding write | no | set_kill_switch (admin only) |
sends_email | EMAIL binding | yes — via HITL | send_customer_quote |
reindex | Vectorize reindex | no | reindex_knowledge_corpus |
cron_trigger | manual trigger of a cron path | no — admin only | run_anomaly_hunter_now |
| role | tools granted (approx) | writes allowed | typical user |
|---|---|---|---|
admin | 50 (all) | all side-effects incl. stages_proposed_action | Mike |
pricing | ~18 | stages_proposed_action (pricing) + reads_ns | price analyst |
ar | ~14 | writes_d1 (notes) + reads_ns | AR collector |
sales | ~16 | stages_proposed_action (quotes) + sends_email (HITL) | sales rep |
purchasing | ~12 | stages_proposed_action (vendor cost) + reads_ns | buyer |
order_mgmt_admin | ~22 (absorbed inventory + logistics + USDA per R96) | stages_proposed_action (SO/PO) + reads_ns | ops lead |
warehouse | ~8 | reads_ns + writes_d1 (movement notes) | warehouse |
finance | ~14 | reads_ns + writes_d1 (memo) | finance ops |
exec | ~10 (read-heavy) | reads only + customer_health reads | execs |
compliance | ~6 (audit-focused) | reads only + audit reindex | compliance |
| endpoint | purpose |
|---|---|
POST /api/admin/tool-registry/seed | idempotent seed of tool_registry from CHAT_TOOLS_FOR_PROMPT |
GET /api/tool-registry/list | list all tools, filterable by category · side_effects · role |
POST /api/admin/tool-role-palette/grant | grant tool to role (admin only) |
POST /api/admin/tool-role-palette/revoke | revoke tool from role |
GET /api/tool-registry/usage | invocation_count_7d view sorted ascending — least-used surface |
Catalog source: src/chat_tools/prompt.ts · CHAT_TOOLS_FOR_PROMPT. Role filter: filterToolsForRole(role_id). Implementations: src/chat_tools/impls.ts.