# KtoolDocs consumer contract
The crate exposes exactly these public operations:
```rust
pub fn ktool_docs(arguments: &str) -> Result<String, String>
pub fn is_known_ktool(name: &str) -> bool
```
`ktool_docs` arguments must be JSON for an object containing exactly one field, `name`, whose value is a nonempty string. Missing, additional, duplicate, nonstring, or empty fields, nonobject values, and malformed JSON return `Err("invalid KtoolDocs arguments")`. The name is used without trimming and is matched exactly and case-sensitively. An unrecognized name returns `Err("unknown Ktool")` without echoing input or offering discovery information.
A successful lookup returns compact JSON with fields in this order: `name` (string), `latest_version` (string), `docs` (string), `deprecated` (boolean), and `replacement` (string or null). The 24 active catalog entries use contract version `1.0.0`, are not deprecated, and have null replacements. `is_known_ktool` uses the same exact, case-sensitive catalog and performs no parsing or I/O.
The recognized names are `KtoolDocs`, `CurrentTime`, `KmapCreateNode`, `KmapOpenNode`, `KmapUpdateNode`, `KmapPenalizeNodes`, `KmapConnectNodes`, `SendMessage`, `WebSearch`, `SetLaunchNode`, `ListContacts`, `ListGroups`, `GetGroup`, `RustCodeCreate`, `RustCodeDocs`, `RustCodeOpen`, `RustCodeOverwrite`, `RustCodeCheck`, `RustCodePublish`, `WebCodeDocs`, `WebCodeOpen`, `WebCodeOverwrite`, `WebCodeCheck`, and `WebCodePublish`.
For RustCode, the selected profile is a backend-owned authorization input. `RustCodeCreate`, `RustCodeDocs`, and `RustCodeOpen` accept only `library` and `version`; they derive the authority from the backend-selected profile and never accept a model-supplied authority. The other RustCode calls operate on source boxes from the active Rust library. `RustCodeOverwrite` silently appends exactly one LF when the affected complete supported file lacks a trailing LF. Files already ending in LF, including CRLF, remain byte-identical; no other bytes are changed.
The operation is a stateless compiled-metadata lookup: it does not list, search, suggest, authorize, register, inspect a filesystem or Kmap, use a network, or prove that a named tool is live. Lookup is linear in the small compiled catalog and response length and performs no I/O.