Skip to main content
The ACP TypeScript SDK provides comprehensive type definitions for the Agent Client Protocol. All types are auto-generated from the protocol specification using OpenAPI and validated with Zod schemas.

Type System

The SDK’s type system is built on three key principles:
  1. Auto-generated: Types are generated from the OpenAPI specification to ensure accuracy and consistency with the protocol
  2. Zod validation: All types include Zod schemas for runtime validation
  3. TypeScript-first: Full TypeScript support with strict typing throughout

Importing Types

All types are exported from the schema module:
import type {
  InitializeRequest,
  InitializeResponse,
  NewSessionRequest,
  PromptRequest,
  SessionUpdate
} from '@agentclientprotocol/sdk/schema';

Type Categories

The type system is organized into several categories:

Request Types

Types for requests sent from client to agent. See Request Types for details.
  • InitializeRequest
  • NewSessionRequest
  • LoadSessionRequest
  • PromptRequest
  • SetSessionModeRequest
  • And more…

Response Types

Types for responses from agent to client. See Response Types for details.
  • InitializeResponse
  • NewSessionResponse
  • PromptResponse
  • ListSessionsResponse
  • And more…

Notification Types

Types for one-way notifications. See Notification Types for details.
  • SessionNotification
  • SessionUpdate (union type)
  • CancelNotification
  • CancelRequestNotification

Content Types

Types for representing content in messages:
  • ContentBlock - Union of text, image, audio, resource link, or embedded resource
  • TextContent - Plain text content
  • ImageContent - Image data with MIME type
  • AudioContent - Audio data with MIME type
  • ResourceLink - Reference to a resource
  • EmbeddedResource - Embedded resource content

Capability Types

Types for negotiating features between client and agent:
  • ClientCapabilities - What the client supports
  • AgentCapabilities - What the agent supports
  • PromptCapabilities - Supported content types in prompts
  • FileSystemCapabilities - File system operations
  • McpCapabilities - MCP transport support

Session Types

Types for session management:
  • SessionId - Unique session identifier
  • SessionInfo - Session metadata
  • SessionMode - Session mode configuration
  • SessionConfigOption - Configuration options

Schema Constants

The SDK exports important constants. See Schema Constants for details.
import { PROTOCOL_VERSION, AGENT_METHODS, CLIENT_METHODS } from '@agentclientprotocol/sdk/schema';

Zod Validation

All types include corresponding Zod schemas for runtime validation:
import { InitializeRequestSchema } from '@agentclientprotocol/sdk/schema';

const result = InitializeRequestSchema.parse(data);

Extensibility

All protocol types include an optional _meta field for custom metadata:
export type InitializeRequest = {
  _meta?: {
    [key: string]: unknown;
  } | null;
  // ... other fields
};
This allows both clients and agents to attach additional information without breaking protocol compatibility.

Next Steps

Build docs developers (and LLMs) love