NAME

Claude::Agent::Content::ToolUse - Tool use content block

DESCRIPTION

A tool use content block representing Claude's request to use a tool.

ATTRIBUTES

  • type - Always 'tool_use'

  • id - Unique identifier for this tool use

  • name - Name of the tool being used

  • input - HashRef of input parameters for the tool

COMMON TOOL INPUTS

Different tools accept different inputs:

Read

{ file_path => '/path/to/file', offset => 0, limit => 100 }

Write

{ file_path => '/path/to/file', content => '...' }

Edit

{ file_path => '/path/to/file', old_string => '...', new_string => '...' }

Bash

{ command => '...', description => '...', timeout => 60000 }

Glob

{ pattern => '**/*.pm', path => '/path/to/search' }

Grep

{ pattern => 'search term', path => '/path/to/search' }

METHODS

is_mcp_tool

if ($block->is_mcp_tool) { ... }

Returns true if this is an MCP tool (name starts with 'mcp__').

mcp_server

my $server = $block->mcp_server;

Returns the MCP server name if this is an MCP tool.

mcp_tool_name

my $tool = $block->mcp_tool_name;

Returns the MCP tool name (without server prefix) if this is an MCP tool.

AUTHOR

LNATION, <email at lnation.org>

LICENSE

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under The Artistic License 2.0 (GPL Compatible).