Skip to main content

Mail

Tools for agent messaging, mail threads, and communication between agents. The mail system provides a comprehensive messaging infrastructure for multi-agent coordination, including thread management, message handling, and file reservation capabilities.

Tools

mail_register_agent

Registers an agent in the mail system with specified capabilities and metadata.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe unique identifier for the agent
namestringYesThe name of the agent
capabilitiesstring[]NoThe capabilities of the agent
metadataobjectNoAdditional metadata for the agent

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_register_agent", {
agentId: "agent-001",
name: "Code Review Agent",
capabilities: ["code-review", "testing"],
metadata: { version: "1.0" }
});

mail_list_agents

Lists all registered agents in the mail system.

Parameters:

ParameterTypeRequiredDescription
---No parameters required

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_list_agents", {});

mail_get_agent

Gets details of a specific agent by its ID.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe unique identifier of the agent to retrieve

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_get_agent", {
agentId: "agent-001"
});

mail_create_thread

Creates a new mail thread with specified subject, participants, and optional type.

Parameters:

ParameterTypeRequiredDescription
subjectstringYesThe subject of the thread
participantsstring[]YesThe participants in the thread
typestringNoThe type of thread: "agent-to-agent", "agent-to-user", or "broadcast"
metadataobjectNoAdditional metadata for the thread

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_create_thread", {
subject: "Code Review Discussion",
participants: ["agent-001", "agent-002"],
type: "agent-to-agent",
metadata: { priority: "high" }
});

mail_find_or_create_thread

Finds an existing thread matching the criteria or creates a new one if not found.

Parameters:

ParameterTypeRequiredDescription
subjectstringYesThe subject of the thread
participantsstring[]YesThe participants in the thread
typestringNoThe type of thread: "agent-to-agent", "agent-to-user", or "broadcast"
metadataobjectNoAdditional metadata for the thread

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_find_or_create_thread", {
subject: "Bug Fix Coordination",
participants: ["agent-001", "agent-002", "agent-003"],
type: "agent-to-agent"
});

mail_list_threads

Lists mail threads with optional filters for type, status, participant, and search.

Parameters:

ParameterTypeRequiredDescription
typestringNoFilter by thread type: "agent-to-agent", "agent-to-user", or "broadcast"
statusstringNoFilter by thread status: "open", "closed", or "archived"
participantstringNoFilter by participant
searchstringNoSearch query
limitnumberNoMaximum number of threads to return
offsetnumberNoOffset for pagination

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_list_threads", {
type: "agent-to-agent",
status: "open",
limit: 10,
offset: 0
});

mail_get_thread

Gets details of a specific thread by its ID.

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread to retrieve

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_get_thread", {
threadId: "thread-123"
});

mail_update_thread_status

Updates the status of a thread (open, closed, or archived).

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread to update
statusstringYesThe new status for the thread: "open", "closed", or "archived"

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_update_thread_status", {
threadId: "thread-123",
status: "closed"
});

mail_archive_thread

Archives a thread by its ID.

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread to archive

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_archive_thread", {
threadId: "thread-123"
});

mail_fetch_inbox

Fetches messages from the inbox for a specific agent with optional pagination and filters.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe agent ID to fetch inbox for
limitnumberNoMaximum number of messages to fetch
offsetnumberNoOffset for pagination
unreadOnlybooleanNoFilter by read status

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_fetch_inbox", {
agentId: "agent-001",
limit: 20,
unreadOnly: true
});

mail_send_message

Sends a message in a thread from one agent to one or more recipients.

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to send the message to
fromstringYesThe sender agent ID
tostring[]YesThe recipient agent IDs
contentstringYesThe message content
messageTypestringNoThe message type
metadataobjectNoAdditional metadata for the message

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_send_message", {
threadId: "thread-123",
from: "agent-001",
to: ["agent-002", "agent-003"],
content: "Please review the changes in module X.",
messageType: "request",
metadata: { urgency: "normal" }
});

mail_reply_message

Replies to a specific message in a thread.

Parameters:

ParameterTypeRequiredDescription
messageIdstringYesThe message ID to reply to
fromstringYesThe sender agent ID
contentstringYesThe reply content
metadataobjectNoAdditional metadata for the reply

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_reply_message", {
messageId: "msg-456",
from: "agent-002",
content: "Review completed. All tests pass.",
metadata: { status: "approved" }
});

mail_get_message

Gets a specific message by its ID.

Parameters:

ParameterTypeRequiredDescription
messageIdstringYesThe unique identifier of the message to retrieve

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_get_message", {
messageId: "msg-456"
});

mail_get_messages

Gets all messages in a specific thread.

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to get messages from

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_get_messages", {
threadId: "thread-123"
});

mail_mark_read

Marks one or more messages as read for a specific agent.

Parameters:

ParameterTypeRequiredDescription
messageIdsstring[]YesThe message IDs to mark as read
agentIdstringYesThe agent ID marking the messages as read

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_mark_read", {
messageIds: ["msg-456", "msg-457", "msg-458"],
agentId: "agent-001"
});

mail_acknowledge

Acknowledges receipt of one or more messages.

Parameters:

ParameterTypeRequiredDescription
messageIdsstring[]YesThe message IDs to acknowledge
agentIdstringYesThe agent ID acknowledging the messages

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_acknowledge", {
messageIds: ["msg-456", "msg-457"],
agentId: "agent-002"
});

Searches messages with optional filters for thread, sender, and pagination.

Parameters:

ParameterTypeRequiredDescription
querystringYesThe search query
agentIdstringYesThe agent ID performing the search
threadIdstringNoFilter by thread ID
fromstringNoFilter by sender
limitnumberNoMaximum number of results
offsetnumberNoOffset for pagination

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_search", {
query: "code review",
agentId: "agent-001",
limit: 25,
offset: 0
});

mail_summarize_thread

Generates a summary of a thread.

Parameters:

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to summarize
agentIdstringYesThe agent ID requesting the summary

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_summarize_thread", {
threadId: "thread-123",
agentId: "agent-001"
});

mail_reserve_files

Reserves files for exclusive access by an agent.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe agent ID requesting the reservation
filesstring[]YesThe file paths to reserve
reasonstringNoThe reason for reservation
durationnumberNoDuration of reservation in seconds

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_reserve_files", {
agentId: "agent-001",
files: ["src/module.ts", "src/utils.ts"],
reason: "Refactoring module structure",
duration: 3600
});

mail_release_files

Releases file reservations held by an agent.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe agent ID releasing the reservation
filesstring[]YesThe file paths to release

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_release_files", {
agentId: "agent-001",
files: ["src/module.ts", "src/utils.ts"]
});

mail_force_reserve_files

Forcefully reserves files, overriding existing reservations if necessary.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe agent ID requesting the forced reservation
filesstring[]YesThe file paths to force reserve
reasonstringNoThe reason for forced reservation
durationnumberNoDuration of reservation in seconds

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_force_reserve_files", {
agentId: "agent-admin",
files: ["src/critical.ts"],
reason: "Emergency hotfix required",
duration: 1800
});

mail_list_reservations

Lists file reservations with optional filters for agent and file.

Parameters:

ParameterTypeRequiredDescription
agentIdstringNoFilter by agent ID
filestringNoFilter by file path

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_list_reservations", {
agentId: "agent-001"
});

mail_check_conflicts

Checks if there are any conflicts for reserving specified files.

Parameters:

ParameterTypeRequiredDescription
agentIdstringYesThe agent ID checking for conflicts
filesstring[]YesThe file paths to check for conflicts

Example:

const result = await codebolt.tools.executeTool("codebolt.mail", "mail_check_conflicts", {
agentId: "agent-002",
files: ["src/module.ts", "src/config.ts"]
});