Expand description
Tool-id โ sanitized-name mapping for LLM and MCP surfaces.
LLM APIs (OpenAI function-calling, Anthropic tools, MCP) require
identifiers to match [a-zA-Z0-9_-]. ATD tool ids use : and .
for namespace/domain/action structure. This module translates in
both directions.
Note that sanitization is lossy โ a:b and a.b both map to
a_b. Reverse lookup therefore requires the caller to provide
the set of known original ids.
Functionsยง
- desanitize_
tool_ name - Map a sanitized name back to the original tool id by searching
the provided known-id set. Returns
Noneif no match. - detect_
collisions - Check whether sanitization would cause a collision within the given set of ids. Useful for detecting adapter-shape problems before they surface as confusing LLM behavior.
- sanitize_
tool_ name - Map an ATD tool id to an LLM-/MCP-safe name.