Grok Build · Tool Classification
ToolKind Provides Default Read-Only Semantics
is_read_only() is the default classification at the tool-kind layer. Individual tools can override it, and whether a tool ultimately executes still depends on rules, sandboxes, Hooks, and interactive approval.
Learning Objective Accurately identify real
ToolKind branches, remember that Task returns false and there is no TaskOutput kind in the source code, and explain the boundary between read-only classification and full permission decisions.
Core Visual · Instructional Decision Diagram
Instructional decision diagram: illustrates multi-layer control relationships, not a single function call chain.
Real Classification Branches
is_read_only() == true
ReadSearchLspListDirListMemorySearchMemoryGetWebSearchWebFetchEnterPlanExitPlanAskUser
These kinds default to read-only. Individual tools can still override this default via their own metadata.
is_read_only() == false
EditDeleteWriteMoveExecutePlanTaskSkillSearchToolUseToolMonitorGoalUpdate
This branch also includes background tasks, media generation, deployment, and more. Task is explicitly in the false branch.
Boundary Note:
is_read_only describes the default side-effect semantics; it alone does not imply "auto-execute" or "must prompt." Command rules, workspace permissions, sandboxes, Hooks, and user approval all affect the final outcome. In the display layer, the label for Execute is Run Command.Real Source Code Evidence
crates/codegen/xai-grok-tools/src/tool_taxonomy.rs · Lines 37–113 (excerpt)
pub fn presentation_name(self) -> &'static str {
match self {
ToolKind::Execute => "Run Command",
/* other presentation_name branches omitted */
}
}
pub fn is_read_only(self) -> bool {
match self {
ToolKind::Read
| ToolKind::Search
| ToolKind::Lsp
| ToolKind::ListDir
| ToolKind::List
| ToolKind::MemorySearch
| ToolKind::MemoryGet
| ToolKind::WebSearch
| ToolKind::WebFetch
| ToolKind::EnterPlan
| ToolKind::ExitPlan
| ToolKind::AskUser => true,
ToolKind::Edit
| ToolKind::Delete
| ToolKind::Write
| ToolKind::Move
| ToolKind::Execute
| ToolKind::Plan
| ToolKind::BackgroundTaskAction
| ToolKind::WaitTasksAction
| ToolKind::KillTaskAction
| ToolKind::Skill
| ToolKind::Task
| ToolKind::ImageGen
| ToolKind::VideoGen
| ToolKind::ImageToVideo
| ToolKind::ReferenceToVideo
| ToolKind::DeployApp
| ToolKind::SearchTool
| ToolKind::UseTool
| ToolKind::Monitor
| ToolKind::GoalUpdate
| ToolKind::Other => false,
}
}
Source snapshot note: Based on the local repository at
grok-build-main, files crates/codegen/xai-grok-tools/src/types/tool.rs and tool_taxonomy.rs, verified on 2026-07-17. Comments in the excerpt explicitly mark the omitted portions.Class Exercise
02
Identify the classification, then complete the permission context
Analyze Task, Execute, and WebFetch individually. First write the kind's default read-only value and display label, then list the four control signals that must be checked before final execution.
Takeaway:
ToolKind::is_read_only() provides a reusable kind-level default. Task is false, there is no TaskOutput kind in the source, and the unified label for Execute is Run Command. Full permission evaluation requires reading further runtime environment and user control signals.