Loading...
Loading...
Manages custom Agent resources on Gemini Enterprise Agent Platform. Use when the user wants to programmatically create, configure, list, update, or delete stateful, server-managed Agent resources (including mounting files, skills, and tools) before executing conversations.
npx skill4agent add google/skills gemini-managed-agents-apiexport PROJECT_ID="your-project-id"
export LOCATION="global"
export ACCESS_TOKEN=$(gcloud auth print-access-token)[!IMPORTANT] API Location Support: Theenvironment variable must be set to a regional location where the Gemini Enterprise Agent Platform's Managed Agents API is actively supported (e.g.,LOCATION, or other available regional endpoints).global
https://aiplatform.googleapis.com/v1beta1/projects/{PROJECT_ID}/locations/{LOCATION}/agentsPOSTPOSThttps://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agentscurl -X POST "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"id": "my-custom-agent",
"base_agent": "antigravity-preview-05-2026",
"description": "A professional agent configured with remote tools and mounted Cloud Storage directories.",
"system_instruction": "You are a helpful, domain-expert assistant.",
"tools": [
{"type": "code_execution"},
{"type": "filesystem"},
{"type": "google_search"},
{"type": "url_context"}
],
"base_environment": {
"type": "remote",
"sources": [
{
"type": "gcs",
"source": "gs://your-agent-bucket-name/skills",
"target": "/.agent/skills"
}
],
"network": {
"allowlist": [
{ "domain": "*" }
]
}
}
}'{
"name": "projects/1234567890/locations/global/operations/operation-987654321-abcde",
"metadata": {
"@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.CreateAgentOperationMetadata",
"genericMetadata": {
"createTime": "2026-05-14T19:00:00.123456Z",
"updateTime": "2026-05-14T19:00:01.654321Z"
}
}
}"sources": [
{
"type": "skill_registry",
"source": "projects/your-project-id/locations/global/skills/my-math-skill/revisions/123456789012",
"target": "/.agent/skills"
}
]"tools""tools": [
{
"type": "mcp",
"name": "my-mcp-server",
"url": "https://mcp.yourcompany.com/api",
"headers": {
"Authorization": "Bearer YOUR_MCP_AUTH_TOKEN"
}
}
][!TIP] Overriding MCP at Interaction Time (Data Plane): You can dynamically override or supply MCP tools directly when creating a conversation interaction (Data Plane) by passinginside the"type": "mcp_server"payload of"tools". Refer to the Interactions API documentation for details.interactions.create
nameGEThttps://aiplatform.googleapis.com/v1beta1/{OPERATION_NAME}curl -X GET "https://aiplatform.googleapis.com/v1beta1/projects/1234567890/locations/global/operations/operation-987654321-abcde" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json"{
"name": "projects/1234567890/locations/global/operations/operation-987654321-abcde",
"metadata": { ... }
}"done": trueAgent"response"{
"name": "projects/1234567890/locations/global/operations/operation-987654321-abcde",
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.Agent",
"name": "projects/your-project-id/locations/global/agents/my-custom-agent",
"base_agent": "antigravity-preview-05-2026",
"description": "A professional agent configured with remote tools and mounted Cloud Storage directories.",
"system_instruction": "You are a helpful, domain-expert assistant."
}
}GEThttps://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}curl -X GET "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents/my-custom-agent" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json"{
"name": "projects/your-project-id/locations/global/agents/my-custom-agent",
"base_agent": "antigravity-preview-05-2026",
"description": "A professional agent configured with remote tools and mounted Cloud Storage directories.",
"system_instruction": "You are a helpful, domain-expert assistant.",
"tools": [
{"type": "code_execution"},
{"type": "filesystem"},
{"type": "google_search"},
{"type": "url_context"}
],
"base_environment": {
"type": "remote",
"sources": [
{
"type": "gcs",
"source": "gs://your-agent-bucket-name/skills",
"target": "/.agent/skills"
}
],
"network": {
"allowlist": [
{ "domain": "*" }
]
}
}
}GEThttps://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agentscurl -X GET "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json"{
"agents": [
{
"name": "projects/your-project-id/locations/global/agents/my-custom-agent",
"base_agent": "antigravity-preview-05-2026",
"description": "A professional agent configured with remote tools and mounted Cloud Storage directories.",
"system_instruction": "You are a helpful, domain-expert assistant."
},
{
"name": "projects/your-project-id/locations/global/agents/my-telecom-agent",
"base_agent": "antigravity-preview-05-2026",
"description": "A highly specialized telecom support agent.",
"system_instruction": "You are a professional telecom support agent. Follow system policies carefully."
}
]
}update_maskPATCHhttps://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}?update_mask=system_instructioncurl -X PATCH "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents/my-custom-agent?update_mask=system_instruction" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "my-custom-agent",
"system_instruction": "You are a highly specialized telecom support agent. Follow system policies carefully."
}'DELETEhttps://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}curl -X DELETE "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents/my-custom-agent" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"200 OK{}projects/{PROJECT_ID}/locations/global/agents/{AGENT_ID}agentinteraction = client.interactions.create(
agent="projects/your-project-id/locations/global/agents/my-custom-agent",
input="Hello! Who are you?"
){
"agent": "projects/your-project-id/locations/global/agents/my-custom-agent",
"input": [{
"role": "user",
"content": [{"type": "text", "text": "Hello! Who are you?"}]
}]
}gemini-interactions-api../gemini-interactions-api/SKILL.md