Skip to main content

Table of Contents

Module spoon_ai.tools

Module spoon_ai.tools.turnkey_tools

Turnkey Tools - Secure Blockchain Operations

This module provides Turnkey SDK tools for secure blockchain operations including:

  • Transaction signing and broadcasting
  • Message and EIP-712 signing
  • Multi-account management
  • Activity audit and monitoring
  • Wallet and account operations

TurnkeyBaseTool Objects​

class TurnkeyBaseTool(BaseTool)

Base class for Turnkey tools with shared client initialization

client​

@property
def client()

Lazy initialization of Turnkey client

SignEVMTransactionTool Objects​

class SignEVMTransactionTool(TurnkeyBaseTool)

Sign EVM transaction using Turnkey

execute​

async def execute(sign_with: str, unsigned_tx: str, **kwargs) -> str

Sign EVM transaction

SignMessageTool Objects​

class SignMessageTool(TurnkeyBaseTool)

Sign arbitrary message using Turnkey

execute​

async def execute(sign_with: str,
message: str,
use_keccak256: bool = True,
**kwargs) -> str

Sign message

SignTypedDataTool Objects​

class SignTypedDataTool(TurnkeyBaseTool)

Sign EIP-712 structured data using Turnkey

execute​

async def execute(sign_with: str, typed_data: dict, **kwargs) -> str

Sign EIP-712 typed data

BroadcastTransactionTool Objects​

class BroadcastTransactionTool(TurnkeyBaseTool)

Broadcast signed transaction to blockchain

execute​

async def execute(signed_tx: str, rpc_url: str = None, **kwargs) -> str

Broadcast transaction

ListWalletsTool Objects​

class ListWalletsTool(TurnkeyBaseTool)

List all wallets in the organization

execute​

async def execute(**kwargs) -> str

List wallets

ListWalletAccountsTool Objects​

class ListWalletAccountsTool(TurnkeyBaseTool)

List accounts for a specific wallet

execute​

async def execute(wallet_id: str,
limit: str = None,
before: str = None,
after: str = None,
**kwargs) -> str

List wallet accounts

GetActivityTool Objects​

class GetActivityTool(TurnkeyBaseTool)

Get activity details by ID

execute​

async def execute(activity_id: str, **kwargs) -> str

Get activity details

ListActivitiesTool Objects​

class ListActivitiesTool(TurnkeyBaseTool)

List recent activities in the organization

execute​

async def execute(limit: str = "10",
before: str = None,
after: str = None,
filter_by_status: list = None,
filter_by_type: list = None,
**kwargs) -> str

List activities

WhoAmITool Objects​

class WhoAmITool(TurnkeyBaseTool)

Get organization information

execute​

async def execute(**kwargs) -> str

Get organization info

BuildUnsignedEIP1559TxTool Objects​

class BuildUnsignedEIP1559TxTool(BaseTool)

Build unsigned EIP-1559 transaction (supports NeoX)

execute​

async def execute(from_addr: str,
to_addr: str = None,
value_wei: str = "0",
data_hex: str = "0x",
priority_gwei: str = "1",
max_fee_gwei: str = None,
gas_limit: str = None,
rpc_url: str = None,
**kwargs) -> str

Build unsigned transaction (auto-detects NeoX)

ListAllAccountsTool Objects​

class ListAllAccountsTool(TurnkeyBaseTool)

List all accounts across all wallets in the organization

execute​

async def execute(limit: str = "50", **kwargs) -> str

List all accounts across all wallets

BatchSignTransactionsTool Objects​

class BatchSignTransactionsTool(TurnkeyBaseTool)

Batch sign transactions for multiple accounts

execute​

async def execute(to_address: str,
value_wei: str,
data_hex: str = "0x",
max_accounts: str = "3",
enable_broadcast: bool = False,
rpc_url: str = None,
**kwargs) -> str

Batch sign transactions for multiple accounts

CreateWalletTool Objects​

class CreateWalletTool(TurnkeyBaseTool)

Create a new wallet

execute​

async def execute(wallet_name: str,
accounts_json: str = None,
mnemonic_length: str = "24",
**kwargs) -> str

Create a new wallet

GetWalletTool Objects​

class GetWalletTool(TurnkeyBaseTool)

Get wallet information by wallet ID

execute​

async def execute(wallet_id: str, **kwargs) -> str

Get wallet information

CreateWalletAccountsTool Objects​

class CreateWalletAccountsTool(TurnkeyBaseTool)

Add accounts to an existing wallet

execute​

async def execute(wallet_id: str, accounts_json: str, **kwargs) -> str

Add accounts to existing wallet

CompleteTransactionWorkflowTool Objects​

class CompleteTransactionWorkflowTool(TurnkeyBaseTool)

Complete transaction workflow: build, sign, and optionally broadcast

execute​

async def execute(sign_with: str,
to_address: str,
value_wei: str,
data_hex: str = "0x",
enable_broadcast: bool = False,
rpc_url: str = None,
**kwargs) -> str

Complete transaction workflow

get_turnkey_tools​

def get_turnkey_tools() -> List[BaseTool]

Get all Turnkey tools

Module spoon_ai.tools.tool_manager

ToolManager Objects​

class ToolManager()

reindex​

def reindex() -> None

Rebuild the internal name->tool mapping. Useful if tools have been renamed dynamically.

Module spoon_ai.tools.neofs_tools

NeoFS Tools for spoon_ai framework

Simple wrappers around NeoFS client methods. Tools do NOT auto-create bearer tokens - Agent manages tokens. All parameters map directly to client method parameters.

get_shared_neofs_client​

def get_shared_neofs_client() -> NeoFSClient

Get shared NeoFSClient instance for all NeoFS tools.

Returns the same client instance across all tool calls to ensure bearer token authentication works correctly.

CreateBearerTokenTool Objects​

class CreateBearerTokenTool(BaseTool)

Create a bearer token for NeoFS operations

CreateContainerTool Objects​

class CreateContainerTool(BaseTool)

Create a NeoFS container

UploadObjectTool Objects​

class UploadObjectTool(BaseTool)

Upload object to container

DownloadObjectByIdTool Objects​

class DownloadObjectByIdTool(BaseTool)

Download object by ID

GetObjectHeaderByIdTool Objects​

class GetObjectHeaderByIdTool(BaseTool)

Get object header by ID

DownloadObjectByAttributeTool Objects​

class DownloadObjectByAttributeTool(BaseTool)

Download object by attribute

GetObjectHeaderByAttributeTool Objects​

class GetObjectHeaderByAttributeTool(BaseTool)

Get object header by attribute

DeleteObjectTool Objects​

class DeleteObjectTool(BaseTool)

Delete an object

SearchObjectsTool Objects​

class SearchObjectsTool(BaseTool)

Search objects in container

SetContainerEaclTool Objects​

class SetContainerEaclTool(BaseTool)

Set eACL for container

GetContainerEaclTool Objects​

class GetContainerEaclTool(BaseTool)

Get eACL for container

ListContainersTool Objects​

class ListContainersTool(BaseTool)

List all containers

GetContainerInfoTool Objects​

class GetContainerInfoTool(BaseTool)

Get container info

DeleteContainerTool Objects​

class DeleteContainerTool(BaseTool)

Delete container

GetNetworkInfoTool Objects​

class GetNetworkInfoTool(BaseTool)

Get network info

GetBalanceTool Objects​

class GetBalanceTool(BaseTool)

Get balance for an address

Module spoon_ai.tools.rag_tools

Module spoon_ai.tools.x402_payment

X402PaymentHeaderTool Objects​

class X402PaymentHeaderTool(BaseTool)

Create a signed X-PAYMENT header for a given resource.

X402PaywalledRequestTool Objects​

class X402PaywalledRequestTool(BaseTool)

Fetch a paywalled resource, handling the x402 402 negotiation automatically.

Module spoon_ai.tools.mcp_tool

MCPTool Objects​

class MCPTool(BaseTool, MCPClientMixin)

call_mcp_tool​

async def call_mcp_tool(tool_name: str, **kwargs)

Override the mixin method to add tool-specific error handling.

list_available_tools​

async def list_available_tools() -> list

List available tools from the MCP server.

Module spoon_ai.tools.base

ToolFailure Objects​

class ToolFailure(Exception)

Exception to indicate a tool execution failure.