Skip to main content

Conversation with Agents

This guide explains the three connection methods for interacting with AgenticStar agents and concepts common to all methods.

Three Connection Methods

You can interact with AgenticStar agents using three different methods depending on your use case. Regardless of the method, the basic structure of requests sent to and responses received from agents is the same.

Chat API / SSEMCPA2A
ProtocolREST + SSEStreamable HTTP / JSON-RPCJSON-RPC
Endpoint/v1/chat/completions/v1/mcp/v1/a2a
Scopechat:execmcp:execa2a:exec
DiscoveryNone (see API spec)Auto-retrieved via tools/listAuto-retrieved via Agent Card
Expected ClientsOwn application / HTTP clientClaude / MCP-compatible AI agentsA2A-compatible AI agents
Documentation DetailsAPI Reference →Connection Guide ↓Connection Guide ↓

How to Choose a Method

Which method should you choose?
  • Chat API / SSE — When integrating agent functionality into your own application. You control requests and responses directly.
  • MCP — When connecting from MCP-compatible AI agents like Claude to AgenticStar. Agents automatically retrieve tool definitions.
  • A2A — When connecting from Google A2A-compatible agents to AgenticStar. Agents automatically retrieve skills via Agent Card.

Common Request Parameters

Across all three connection methods, requests sent to agents are internally converted to the same format. The following parameters are available for all methods.

ParameterTypeRequiredDescription
prompt / textstringRequiredInstruction text to send to the agent
conversationIdstringSpecify to continue an existing conversation. If omitted, a new conversation is created.
agentModebooleantrue (default) = autonomous agent execution. false = direct LLM response.
agentLevelstring"default" (default) or "high_performance". Switches the LLM model used for agent reasoning.
filesarrayAttached files. For Chat API, pre-upload + fileId; for MCP, send with base64 encoding.

Execution Paths

The agent automatically selects an execution path based on task complexity. No specification is needed on the developer side. All connection methods have the same behavior.

Simple Path

Path where the LLM generates responses directly. Used for normal chat responses and simple questions. Completes in seconds.

Complex Path

Path where agents autonomously execute tasks using tools. Used for long-duration tasks including web search, file operations, and code execution. Takes 30 seconds to several minutes.

Response Model

Regardless of the connection method, agent responses include the following information. The format varies by protocol, but the content is the same.

ElementDescription
textAgent response text
conversationIdConversation ID. Specify in your next request to continue the conversation.
deliverablesList of deliverable files generated by the agent (filename, path, MIME type, etc.)
executionStepsAgent execution trace (step details like tool calls and code execution)
interactionInteraction request to user (only when applicable)

Interactions

Interactions occur when the agent needs user input during task execution. Clients should present options or confirmations to users based on the interaction type and send responses with the same conversationId to continue the conversation.

TypeDescriptionClient Action
choicePresent options and ask the user to select oneSend selection as text
confirmationAsk the user for confirmation (approve/deny)Send approval/denial as text

Continuing Conversations

Interactions with agents are managed by conversationId. By specifying the conversationId from the response in your next request, you can maintain context for continuous dialogue. If you omit conversationId, a new conversation starts.

note

You cannot send multiple simultaneous requests to the same conversationId (HTTP 409 Conflict). Wait for the previous request to complete or cancel it before sending a new request.

Cancellation

You can cancel an in-progress agent execution. The cancellation method varies by connection method.

ProtocolCancellation Method
Chat API / SSEPOST /v1/chat/completions/{conversationId}/cancel
MCPCall the cancel_chat tool
A2ASend the tasks/cancel method

Task Data Model

A Task object is generated whenever an agent performs an action such as tool execution, file operations, or search. This data model is common across all Chat API / SSE, MCP, and A2A protocols.

Task Object Fields

ParameterTypeRequiredDescription
messageIdstringID of the message the task belongs to
conversationIdstringID of the conversation the task belongs to
actionTypestringAction type. See actionType list below for details
statusstringTask status: "pending" | "in_progress" | "completed" | "failed" | "success" | "error". Value varies by actionType and data path
timestampnumberTask timestamp (Unix milliseconds)
createdAtstringTask creation date/time (ISO 8601)
updatedAtstringTask update date/time (ISO 8601)
titlestringTask title (for display)
descriptionstringDetailed description of the task
callIdstring | nullTool call ID. Links tool_start with corresponding tool_result. Null for file_operation / search_result / mcp_tool
contentstringTask output content
metadataobjectTask metadata. Contains different fields depending on actionType
filesTaskFile[]Array of files associated with the task

TaskFile Object Fields

ParameterTypeDescription
filenamestringFile name
fileTypestringFile type: "image" | "pdf" | "pptx" | "text" | "video" | "other"
sizenumberFile size (bytes)
filepathstringFile path (relative path or URL)

Task Lifecycle

tool_start is only sent for specific tools (local_assistant / generate_video / Sandbox). It can be linked with corresponding result events (tool_result, etc.) using callId. search_result / command_execution / mcp_tool / file_operation are sent independently without tool_start (callId is null).

JSON
// Pattern A: tool_start → tool_result pair (linked via callId)
// local_assistant / generate_video / Sandbox only
{ "actionType": "tool_start", "callId": "0cf24f34-...", ... }
{ "actionType": "tool_result", "callId": "0cf24f34-...", ... }

// Pattern B: Independent send (callId is null)
{ "actionType": "search_result", "callId": null, ... }
{ "actionType": "file_operation", "callId": null, ... }
{ "actionType": "mcp_tool", "callId": null, ... }

// Pattern C: No tool_start + callId present (LLM call_id preserved)
{ "actionType": "tool_result", "callId": "call_T3GIhcQQ...", ... }

actionType List

actionType indicates the task type. tool_start is only sent for specific tools, while others are sent independently as result events.

actionTypePhaseDescriptionExample Tools
tool_startStartStart notification for specific tool. Includes Sandbox preparationlocal_assistant, generate_video, Sandbox
tool_resultCompleteResult of general tool execution. Identify tool type via metadata.sub_event_typebash, read, write, edit, multiedit, grep, glob, ls, webfetch, task, local_assistant, generate_video, generation_image, create_slide
search_resultCompleteWeb search completion resultsearch_web
command_executionCompleteShell command execution resultexecute_command
mcp_toolCompleteMCP tool execution result (no metadata)mcp_tool, Perplexity
file_operationIndependentFile creation completion notification (includes files[])

metadata Structure by actionType

The metadata field content varies by actionType. Below are representative patterns.

tool_start

Start notification sent for local_assistant / generate_video / Sandbox.

JSON
{
"actionType": "tool_start",
"callId": "0cf24f34-bbd9-4833-88c4-d7f520ce3aae",
"title": "local assistant",
"description": "Processing local_assistant",
"status": "in_progress",
"metadata": {
"tool_name": "local_assistant",
"call_id": "0cf24f34-bbd9-4833-88c4-d7f520ce3aae",
"status": "starting"
}
}

search_result

metadata on web search completion includes search query, result count, and search results array.

JSON
{
"actionType": "search_result",
"status": "completed",
"title": "Executed web search",
"description": "Searched for \"AI market trends 2026\"",
"metadata": {
"query": "AI market trends 2026",
"searchType": "web",
"searchEngine": "brave",
"resultCount": 5,
"results": [
{ "title": "...", "url": "...", "description": "..." }
]
},
"timestamp": 1710410000000
}

command_execution

metadata for shell command execution includes command, exit code, and output.

JSON
{
"actionType": "command_execution",
"status": "success",
"callId": null,
"metadata": {
"command": "npm test",
"exitCode": 0,
"output": "Tests passed: 42/42",
"errorOutput": "",
"workingDirectory": "/workspace"
}
}

mcp_tool

MCP tool results do not include a metadata field. Tool information is set in title and description.

JSON
{
"actionType": "mcp_tool",
"status": "in_progress",
"callId": null,
"title": "Perplexity",
"description": "Running Perplexity"
}

file_operation

Task on file creation completion includes a files[] array.

JSON
{
"actionType": "file_operation",
"status": "completed",
"callId": null,
"metadata": {
"operationType": "create",
"filePaths": ["/home/ubuntu/todo.md"]
},
"files": [{
"filename": "todo.md",
"fileType": "text",
"size": 1918,
"filepath": "/plans/conv-id/files/todo.md"
}]
}

tool_result

metadata for general tool results includes tool-specific fields and sub_event_type. You can identify the tool type via sub_event_type.

bash (sub_event_type: bash_executed)

JSON
{
"actionType": "tool_result",
"callId": "call_T3GIhcQQft13amxdhcJ4cBDz",
"title": "success",
"description": "{'result': 'ok'}",
"status": "in_progress",
"metadata": {
"tool_name": "bash",
"call_id": "call_T3GIhcQQft13amxdhcJ4cBDz",
"sub_event_type": "bash_executed",
"command": "python3 script.py",
"exit_code": 0,
"stdout": "{'result': 'ok'}\n",
"stderr": "",
"status": "success",
"duration_ms": 24,
"working_dir": "/opt/.autonomous_agent/.sandbox-runtime",
"title": "Execute: python3 script.py"
}
}

write (sub_event_type: file_edited)

JSON
{
"actionType": "tool_result",
"title": "created",
"description": "File created: /workspace/src/app.py",
"status": "in_progress",
"metadata": {
"tool_name": "write",
"sub_event_type": "file_edited",
"file_path": "/workspace/src/app.py",
"lines_written": 45,
"status": "created"
}
}

Representative Tool List

You can identify tool type via metadata.tool_name and metadata.sub_event_type from tool_result. Below are representative tools.

tool_nameDescription
bashBash command execution
readFile reading
write / edit / multieditFile writing/editing
grep / glob / lsFile search
webfetchWeb page retrieval
taskSubtask launch
generate_videoVideo generation

Chat API / SSE

An OpenAI-compatible Chat Completions API. Call directly from HTTP clients and receive responses in real-time via SSE (Server-Sent Events) streaming. For detailed specifications on requests and responses, see the API reference.

MCP (Model Context Protocol)

An interface for connecting MCP-compatible AI agents (like Claude) to AgenticStar. Agents automatically retrieve tool definitions on connection and autonomously perform task execution, file retrieval, and cancellation in AgenticStar.

Connection Specification

EndpointPOST /v1/mcp
ProtocolStreamable HTTP / JSON-RPC 2.0
AuthenticationBearer JWT (scope: mcp:exec)
ModeStateless

Tool List

Tool NameScopeDescription
execute_chatmcp:execSend a task to the agent and retrieve execution results
get_file_contentmcp:execDownload deliverable files generated by the agent
cancel_chatmcp:execCancel an in-progress task

Connection Configuration Example

Add the following to your MCP client configuration file.

JSON
{
"mcpServers": {
"agenticstar": {
"url": "https://api.agenticstar.jp/v1/mcp",
"headers": {
"Authorization": "Bearer <access_token>"
}
}
}
}

A2A (Agent-to-Agent Protocol)

An interface for connecting Google A2A protocol-compatible agents to AgenticStar. Client agents automatically retrieve skill information from Agent Card and perform task submission, streaming, and cancellation.

Connection Specification

Agent CardGET /.well-known/agent-card.json
EndpointPOST /v1/a2a
ProtocolJSON-RPC 2.0
AuthenticationBearer JWT (scope: a2a:exec)

Skill List

Skill NameScopeDescription
execute_taska2a:execSend a task to the agent for autonomous execution (agentMode: true)
direct_llma2a:execQuery LLM directly (agentMode: false)

Supported Methods

MethodDescription
message/sendSend a message and wait for completion
message/streamSend a message and receive streaming via SSE
tasks/getRetrieve task status
tasks/cancelCancel a task

Agent Card

A2A clients retrieve Agent Card from the following URL to automatically understand skills, authentication methods, and capabilities.

GET https://api.agenticstar.jp/.well-known/agent-card.json