Package com.axelor.ai.mcp
Class McpToolNaming
java.lang.Object
com.axelor.ai.mcp.McpToolNaming
Builds a stable, provider-safe
AiTool.code for a synced MCP tool, formatted as
<clientCode>_<sanitizedRemoteName> and capped at 64 characters. Disambiguation is always a
deterministic hash, never a positional or ordering-dependent suffix.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe preferred, readable code, kept verbatim when both halves survive sanitizing unchanged and fit, since this is what the model sees.static StringuniqueCode(String clientCode, String remoteName) Always appends a deterministic hash over both halves, so distinct client/tool pairs cannot collide however they sanitize.
-
Method Details
-
toolCode
The preferred, readable code, kept verbatim when both halves survive sanitizing unchanged and fit, since this is what the model sees. Readability leaves the separator ambiguous, as"a_b" + "c"reads the same as"a" + "b_c", so a caller that persists the result must resolve a clash withuniqueCode(java.lang.String, java.lang.String)rather than assume this is unique. -
uniqueCode
Always appends a deterministic hash over both halves, so distinct client/tool pairs cannot collide however they sanitize. Lets the synchronizer resolve a clash instead of dropping a tool.
-