Skip to main content

Module tool_inputs

Module tool_inputs 

Source
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§

AllowedPrompt
An allowed prompt permission for plan mode.
AskUserQuestionInput
Input for the AskUserQuestion tool - asks the user questions.
BashInput
Input for the Bash tool - executes shell commands.
EditInput
Input for the Edit tool - performs string replacements in files.
EnterPlanModeInput
Input for the EnterPlanMode tool - enters planning mode.
ExitPlanModeInput
Input for the ExitPlanMode tool - exits planning mode.
GlobInput
Input for the Glob tool - finds files matching a pattern.
GrepInput
Input for the Grep tool - searches file contents.
KillShellInput
Input for the KillShell tool - kills a running background shell.
NotebookEditInput
Input for the NotebookEdit tool - edits Jupyter notebooks.
Question
A question to ask the user.
QuestionMetadata
Metadata for questions.
QuestionOption
An option for a question.
ReadInput
Input for the Read tool - reads file contents.
SkillInput
Input for the Skill tool - executes a skill.
TaskInput
Input for the Task tool - launches subagents.
TaskOutputInput
Input for the TaskOutput tool - retrieves output from background tasks.
TodoItem
A single todo item in a task list.
TodoWriteInput
Input for the TodoWrite tool - manages task lists.
WebFetchInput
Input for the WebFetch tool - fetches and processes web content.
WebSearchInput
Input for the WebSearch tool - searches the web.
WriteInput
Input for the Write tool - writes content to a file.

Enums§

GrepOutputMode
Output mode for the Grep tool.
NotebookCellType
Type of Jupyter notebook cell.
NotebookEditMode
Type of edit to perform on a notebook cell.
SubagentType
Type of specialized subagent for the Task tool.
TodoStatus
Status of a todo item.
ToolInput
Unified enum representing input for any Claude Code tool.