Conjure.Tools (Conjure v0.1.1-alpha)
View SourceDefines tool schemas for the Claude API.
This module provides the tool definitions that should be passed to the Claude API to enable skill execution. The tools include:
view- Read file contents or directory listingsbash_tool- Execute bash commandscreate_file- Create new files with contentstr_replace- Replace strings in files
Example
tools = Conjure.Tools.definitions()
# Pass to Claude API request body under "tools" key
Summary
Functions
Returns the tool names that are available.
The 'bash_tool' for executing bash commands.
The 'create_file' tool for creating new files.
Returns all tool definitions for skills support.
Parses a tool_use block from Claude's response into a ToolCall.
Parses multiple tool_use blocks from a response.
The 'str_replace' tool for editing files.
Checks if a tool name is valid.
The 'view' tool for reading files and directories.
Functions
@spec available_tool_names() :: [String.t()]
Returns the tool names that are available.
@spec bash_tool() :: map()
The 'bash_tool' for executing bash commands.
@spec create_file_tool() :: map()
The 'create_file' tool for creating new files.
Returns all tool definitions for skills support.
Options
:only- List of tool names to include (default: all):except- List of tool names to exclude
@spec parse_tool_use(map()) :: {:ok, Conjure.ToolCall.t()} | {:error, term()}
Parses a tool_use block from Claude's response into a ToolCall.
@spec parse_tool_uses([map()]) :: [Conjure.ToolCall.t()]
Parses multiple tool_use blocks from a response.
@spec str_replace_tool() :: map()
The 'str_replace' tool for editing files.
Checks if a tool name is valid.
@spec view_tool() :: map()
The 'view' tool for reading files and directories.