Expand description
Typed tool input definitions for Claude Code tools.
This module provides strongly-typed structs for the input parameters of each
Claude Code tool. Using these types instead of raw serde_json::Value provides:
- Compile-time type checking
- IDE autocompletion and documentation
- Self-documenting API
§Example
use claude_codes::{ToolInput, BashInput};
// Parse a tool input from JSON
let json = serde_json::json!({
"command": "ls -la",
"description": "List files in current directory"
});
let input: ToolInput = serde_json::from_value(json).unwrap();
if let ToolInput::Bash(bash) = input {
assert_eq!(bash.command, "ls -la");
}Structs§
- Allowed
Prompt - An allowed prompt permission for plan mode.
- AskUser
Question Input - Input for the AskUserQuestion tool - asks the user questions.
- Bash
Input - Input for the Bash tool - executes shell commands.
- Edit
Input - Input for the Edit tool - performs string replacements in files.
- Enter
Plan Mode Input - Input for the EnterPlanMode tool - enters planning mode.
- Exit
Plan Mode Input - Input for the ExitPlanMode tool - exits planning mode.
- Glob
Input - Input for the Glob tool - finds files matching a pattern.
- Grep
Input - Input for the Grep tool - searches file contents.
- Kill
Shell Input - Input for the KillShell tool - kills a running background shell.
- Notebook
Edit Input - Input for the NotebookEdit tool - edits Jupyter notebooks.
- Question
- A question to ask the user.
- Question
Metadata - Metadata for questions.
- Question
Option - An option for a question.
- Read
Input - Input for the Read tool - reads file contents.
- Skill
Input - Input for the Skill tool - executes a skill.
- Task
Input - Input for the Task tool - launches subagents.
- Task
Output Input - Input for the TaskOutput tool - retrieves output from background tasks.
- Todo
Item - A single todo item in a task list.
- Todo
Write Input - Input for the TodoWrite tool - manages task lists.
- WebFetch
Input - Input for the WebFetch tool - fetches and processes web content.
- WebSearch
Input - Input for the WebSearch tool - searches the web.
- Write
Input - Input for the Write tool - writes content to a file.
Enums§
- Grep
Output Mode - Output mode for the Grep tool.
- Notebook
Cell Type - Type of Jupyter notebook cell.
- Notebook
Edit Mode - Type of edit to perform on a notebook cell.
- Subagent
Type - Type of specialized subagent for the Task tool.
- Todo
Status - Status of a todo item.
- Tool
Input - Unified enum representing input for any Claude Code tool.