Skip to main content
Unsupported HAIP 1 archive. This is historical chat and streaming documentation, not the HAIP 2 review protocol. Its APIs, package examples and security advice must not be used for a HAIP 2 deployment. Start with the current HAIP 2 guides.

Overview

HAIP provides seamless integration with external tools and APIs through the Model Context Protocol (MCP). Tools can be dynamically advertised, invoked, and monitored with real-time progress updates.

Tool Lifecycle

Tool Advertisement

Tool List

Agents advertise available tools using the TOOL_LIST event:

Tool Schema

Detailed tool schemas are provided using the TOOL_SCHEMA event:

Tool Invocation

Tool Call

Tools are invoked using the TOOL_CALL event:

Tool Updates

Long-running tools can provide progress updates:

Tool Completion

Tools signal completion with the TOOL_DONE event:

Tool Cancellation

Tools can be cancelled using the TOOL_CANCEL event:

MCP Integration

HAIP seamlessly integrates with the Model Context Protocol for tool execution.

MCP Tool Handler

MCP Tool Registration

Tool Examples

See the SDK Tools guide for detailed tool implementation examples.

File Upload Tool

Database Query Tool

Tool Management

Tool State Management

Best Practices

Progress Updates

Provide regular progress updates for long-running operations to keep users informed.

Error Handling

Comprehensive error handling with detailed error reporting and recovery.

Resource Management

Clean up resources and cancel operations when tools are cancelled or sessions end.

Schema Validation

Automatic validation of tool schemas and argument types for type safety.