atd-protocol
Wire types, codec, and sanitization rules for the Agent Tool Dispatch (ATD) protocol.
This is the schema crate — the Rust source of the ATD wire format. Every other
crate in the workspace depends on it. It carries no logic beyond
serialization, framing, and tool-name sanitization, so it can be shared by
both client (atd-sdk) and server (atd-runtime) sides without pulling in a
transport.
What's in here
ToolDefinition— full metadata for a tool (id, schema, safety, trust, resources, bindings)ToolSummary— compact form returned bydiscoverToolResult— success + error variants of a tool-call outcomeToolSafety,ToolCapability,ToolTrust,ToolBinding,ToolResources,ToolErrorDef— sub-structures- Enums:
SafetyLevel,ToolVisibility,TrustLevel,BindingProtocol,ToolTier Request/Response— the top-level wire envelope, plus theERR_*error code constantsAtdError— the protocol error taxonomyread_frame/write_frame(+ deadline variants) — the length-prefixed framing codecsanitize_tool_name/desanitize_tool_name/detect_collisions— the tool-id sanitization rules
All types are serde-compatible with the ATD wire format (length-prefixed
JSON). The schema feature derives schemars::JsonSchema and powers the
checked-in atd-protocol-schema.json build artifact.
Quick example
use ;
let safety = ToolSafety ;
Related crates
atd-sdk— Rust client SDKatd-runtime— server-side runtimeatd-mcp-bridge— MCP bridge binary
The byte-level contract is documented in
docs/protocol/wire-format.md
and docs/protocol/error-codes.md.
License
Apache-2.0. See LICENSE.