Invoke agents and manage sessions¶
Invoke agents from an MCP client or another agent, and create, query, and update invocation sessions. This page does not configure the agent itself, its model, or its tools.
Prerequisites¶
Prepare credentials that can access the target workspace and the target agent ID. For service endpoints, authentication, and general request formats, see Make your first AI Studio API call.
Before invocation, you can get the agent invocation instructions. If you need to persist or maintain a session, retain its ID after creating it.
Call sequence¶
First get agent invocation instructions to confirm invocation information for the target agent.
Choose invocation from an MCP client or from another agent based on the caller.
To manage context separately, create a session and retain its ID to query, update, or read messages.
After invoking or updating, query session details and messages to confirm observable session results.
API operations¶
Get invocation information and invoke an agent¶
Task |
Use it when |
|---|---|
Confirm target-agent invocation information before calling it. |
|
The caller is an MCP client. |
|
The caller is another agent. |
Create and maintain sessions¶
Task |
Use it when |
|---|---|
You need a session ID to manage context continuously. |
|
Select or confirm a target session. |
|
View current information for one session. |
|
View messages in a session. |
|
You have the session ID and need to modify the session. |
Confirm the result¶
The invocation action page defines the specific result after invocation. After creating or updating a session, use Get session details and List session messages to confirm session content.