Skip to main content

Types

Type definitions for the Python SDK.

Result Types

PromptResult

Result from client.prompt().

Example

SessionResult

Result from session.send().

StreamEvent

Event from streaming responses.

Example

Tool Types

ToolResult

Result returned from tool handlers.

Content Block Types

Example

Tool

A tool definition.

McpServer

An MCP server containing multiple tools.

Token Types

CreateTokenOptions

Options for create_token().

TokenBudget

Budget configuration.

TokenPermissions

Optional permission constraints.

Helper Functions

create_token()

Create a JWT token.

create_budget()

Create a budget configuration.

Example

text_result()

Create a text tool result.

error_result()

Create an error tool result.

create_mcp_server()

Create an MCP server.

Error Types

ChuckyError

Base exception class.

Specific Errors

Example

Type Hints

Commonly Used Types

Pydantic Integration

For complex schemas, use Pydantic models: