Canonical Input Is a Stable Projection
Different harnesses can use different raw parameter names. Grok Build projects a small set of stable semantics into x.ai/tool metadata, giving presentation, telemetry, and cross-tool analysis a shared vocabulary.
CanonicalToolMeta fields with version = 1, and be able to explain why input may have missing fields or be omitted entirely.
pathFile or search path
offsetNormalized start position
limitRead or result limit
commandCommand to execute
descriptionCommand description
cwdWorking directory vocabulary
directoryDirectory listing target
patternSearch pattern
Actual Fields of CanonicalToolMeta
version is the number 1. input is an optional JSON value and is omitted entirely when there is no stable projection.
input Stays Lightweight
It is a canonical projection, not a mirror of raw input. Non-shared fields like grep flags and replace_all may be discarded; large fields such as before/after edit text and full write content do not enter the projection and can be obtained from raw_input.
file_path, offset, and limit. Grok Build's normalization layer maps its own tool inputs to shared fields such as path. This comparison only covers publicly visible tool input naming and does not infer Claude Code's internal implementation.pub mod field {
pub const PATH: &str = "path";
pub const OFFSET: &str = "offset";
pub const LIMIT: &str = "limit";
pub const COMMAND: &str = "command";
pub const DESCRIPTION: &str = "description";
pub const CWD: &str = "cwd";
pub const DIRECTORY: &str = "directory";
pub const PATTERN: &str = "pattern";
}
pub const TOOL_META_VERSION: u32 = 1;
pub struct CanonicalToolMeta {
pub version: u32,
pub name: String,
pub kind: ToolKind,
pub namespace: ToolNamespace,
pub label: Cow<'static, str>,
pub read_only: bool,
pub input: Option<serde_json::Value>,
}
grok-build-main, files xai-grok-tools/src/tool_taxonomy.rs and normalization.rs, verified on 2026-07-17. No content canonical field exists in the source; fictitious metadata fields and version examples from older pages have been removed.Create a Projection for an Edit Call
The raw input contains file_path, old_string, new_string, and replace_all. Write out the canonical input and identify which fields should remain in raw_input.
path/offset/limit/command/description/cwd/directory/pattern, and the metadata version is the number 1. input may omit sensitive or large fields.