Skip to content

API Reference parrot_tools.zammad

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.zammad

View source

ZammadToolkit — exposes Zammad helpdesk operations as agent tools.

Composes a :class:~parrot.interfaces.zammad.ZammadInterface and turns each public async method into a tool via :class:AbstractToolkit. delete_ticket is excluded from the generated tool set for safety (it remains callable directly on the toolkit instance or on ZammadInterface).

Configuration falls back to the ZAMMAD_* keys in :mod:parrot.conf (via :class:ZammadInterface) when constructor arguments are omitted.

Alias AbstractToolkit

Re-exported from parrot_tools.toolkit.AbstractToolkit.

Class CloseTicketInput

Input schema for zammad_close_ticket.

Fields:

Field Type Default Description
ticket_id int Ticket ID to close

Class CreateTicketInput

Input schema for zammad_create_ticket.

Fields:

Field Type Default Description
title str Ticket title
group str Ticket group/queue
customer str Customer email or ID
article_subject Optional[str] None Article subject
article_body str Article body text
article_type str 'note' Article type
article_internal bool False Internal note flag
priority_id Optional[int] None Priority ID
state_id Optional[int] None State ID
on_behalf_of Optional[str] None User ID/login/email to act as

Class CreateUserInput

Input schema for zammad_create_user.

Fields:

Field Type Default Description
firstname str First name
lastname str Last name
email str Email address
organization Optional[str] None Organization name
roles list[str] Roles
active bool True Active flag

Class DeleteTicketInput

Input schema for the (excluded) delete_ticket method.

Fields:

Field Type Default Description
ticket_id int Ticket ID to delete

Class GetArticlesInput

Input schema for zammad_get_articles.

Fields:

Field Type Default Description
ticket_id int Ticket ID

Class GetAttachmentInput

Input schema for zammad_get_attachment.

Fields:

Field Type Default Description
ticket_id int Ticket ID the attachment belongs to
article_id int Article ID the attachment belongs to
attachment_id int Attachment ID

Class GetTicketInput

Input schema for zammad_get_ticket.

Fields:

Field Type Default Description
ticket_id int Ticket ID
expand bool False Request the enriched view

Class GetUserInput

Input schema for zammad_get_user.

Fields:

Field Type Default Description
user_id int User ID
expand bool False Request the enriched view

Class ListTicketsInput

Input schema for zammad_list_tickets.

Fields:

Field Type Default Description
state_ids Optional[list[int]] None Optional list of state IDs to filter by
page int 1 Page number (1-indexed)
per_page int 100 Number of tickets per page

Class SearchTicketsInput

Input schema for zammad_search_tickets.

Fields:

Field Type Default Description
query str Zammad search query string
page int 1 Page number (1-indexed)
per_page int 100 Number of results per page

Class SearchUsersInput

Input schema for zammad_search_users.

Fields:

Field Type Default Description
query str Zammad user search query string

Class UpdateTicketInput

Input schema for zammad_update_ticket.

Fields:

Field Type Default Description
ticket_id int Ticket ID to update
title Optional[str] None New title
group Optional[str] None New group
state_id Optional[int] None New state ID
priority_id Optional[int] None New priority ID
article_body Optional[str] None Article body for the update
article_type str 'note' Article type
article_internal bool True Internal note flag
on_behalf_of Optional[str] None User ID/login/email to act as

Class ZammadToolkit

Toolkit exposing Zammad helpdesk operations as agent tools.

Parameter Type Default Description
instance_url str | None None Zammad instance base URL. Falls back to ZAMMAD_INSTANCE (via ZammadInterface).
token str | None None API token for Bearer authentication. Falls back to ZAMMAD_TOKEN.
default_customer str | None None Default customer email.
default_group str | None None Default ticket group.
on_behalf_of_header str 'From' Header name for on-behalf-of impersonation.
attachment_dir str | None None Directory to save downloaded attachments.
closed_state_id int 4 State ID Zammad uses for "closed" tickets; used by :meth:close_ticket. Defaults to 4, matching a stock Zammad installation; override for customized state schemes.
**kwargs Any {} Forwarded to :class:AbstractToolkit.

Attributes:

Attribute Type Description
exclude_tools tuple[str, ...]

Method ZammadToolkit.start

Create and open the underlying ZammadInterface session.

start() -> None

Method ZammadToolkit.stop

Close the underlying ZammadInterface session.

stop() -> None

Method ZammadToolkit.create_ticket

Create a new support ticket in Zammad.

create_ticket(title: str, group: str, customer: str, article_body: str, article_subject: Optional[str] = None, article_type: str = 'note', article_internal: bool = False, priority_id: Optional[int] = None, state_id: Optional[int] = None, on_behalf_of: Optional[str] = None) -> dict[str, Any]

Parameter Type Default Description
title str
group str
customer str
article_body str
article_subject Optional[str] None
article_type str 'note'
article_internal bool False
priority_id Optional[int] None
state_id Optional[int] None
on_behalf_of Optional[str] None

Returns: dict[str, Any]

Method ZammadToolkit.get_ticket

Retrieve a single Zammad ticket by ID.

get_ticket(ticket_id: int, expand: bool = False) -> dict[str, Any]

Parameter Type Default Description
ticket_id int
expand bool False

Returns: dict[str, Any]

Method ZammadToolkit.list_tickets

List Zammad tickets, optionally filtered by state.

list_tickets(state_ids: Optional[list[int]] = None, page: int = 1, per_page: int = 100) -> dict[str, Any]

Parameter Type Default Description
state_ids Optional[list[int]] None
page int 1
per_page int 100

Returns: dict[str, Any]

Method ZammadToolkit.update_ticket

Update an existing Zammad ticket.

update_ticket(ticket_id: int, title: Optional[str] = None, group: Optional[str] = None, state_id: Optional[int] = None, priority_id: Optional[int] = None, article_body: Optional[str] = None, article_type: str = 'note', article_internal: bool = True, on_behalf_of: Optional[str] = None) -> dict[str, Any]

Parameter Type Default Description
ticket_id int
title Optional[str] None
group Optional[str] None
state_id Optional[int] None
priority_id Optional[int] None
article_body Optional[str] None
article_type str 'note'
article_internal bool True
on_behalf_of Optional[str] None

Returns: dict[str, Any]

Method ZammadToolkit.close_ticket

Close a Zammad ticket by setting its state to 'closed'.

close_ticket(ticket_id: int) -> dict[str, Any]

Parameter Type Default Description
ticket_id int

Returns: dict[str, Any]

Method ZammadToolkit.search_tickets

Search Zammad tickets by query string.

search_tickets(query: str, page: int = 1, per_page: int = 100) -> dict[str, Any]

Parameter Type Default Description
query str
page int 1
per_page int 100

Returns: dict[str, Any]

Method ZammadToolkit.delete_ticket

Delete a Zammad ticket by ID.

Excluded from the generated tool set via exclude_tools — not exposed to LLMs. Remains callable directly for programmatic use.

delete_ticket(ticket_id: int) -> dict[str, Any]

Parameter Type Default Description
ticket_id int

Returns: dict[str, Any]

Method ZammadToolkit.get_user

Retrieve a single Zammad user by ID.

get_user(user_id: int, expand: bool = False) -> dict[str, Any]

Parameter Type Default Description
user_id int
expand bool False

Returns: dict[str, Any]

Method ZammadToolkit.search_users

Search Zammad users by query string.

search_users(query: str) -> list[dict[str, Any]]

Parameter Type Default Description
query str

Returns: list[dict[str, Any]]

Method ZammadToolkit.create_user

Create a new Zammad user.

create_user(firstname: str, lastname: str, email: str, organization: Optional[str] = None, roles: Optional[list[str]] = None, active: bool = True) -> dict[str, Any]

Parameter Type Default Description
firstname str
lastname str
email str
organization Optional[str] None
roles Optional[list[str]] None
active bool True

Returns: dict[str, Any]

Method ZammadToolkit.get_articles

List all articles for a Zammad ticket.

get_articles(ticket_id: int) -> list[dict[str, Any]]

Parameter Type Default Description
ticket_id int

Returns: list[dict[str, Any]]

Method ZammadToolkit.get_attachment

Download a Zammad attachment and return its content and metadata.

get_attachment(ticket_id: int, article_id: int, attachment_id: int) -> dict[str, Any]

Parameter Type Default Description
ticket_id int
article_id int
attachment_id int

Returns: dict[str, Any]

Alias tool_schema

Re-exported from parrot_tools.decorators.tool_schema.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally