THE MEDIA FOR AI THAT ACTUALLY HELPS.French edition · Understand & take action
The interface is in English. Use cases, skills and articles remain in French.
Google

Gérer des agents avec l’API Managed Agents

gemini-agents-api

En bref

L’API Managed Agents est le plan de contrôle de Gemini Enterprise Agent Platform : elle permet de créer, configurer, lister, mettre à jour ou supprimer des ressources d’agents gérées côté serveur, avec instructions système, fichiers en bac à sable, registre de skills et outils locaux ou distants, avant d’ouvrir une conversation. La création est une opération longue qu’il faut interroger jusqu’à son terme. On peut monter des skills depuis le registre plutôt que depuis Cloud Storage, en adaptant la charge utile. Le plan de données, ensuite, sert à interagir avec l’agent déjà provisionné. Cette skill n’est pas un guide d’appel Gemini ponctuel, ni l’API Interactions à elle seule, ni le registre de skills isolé (agent-platform-skill-registry) : elle orchestre la ressource d’agent elle-même.

Ce que ça fait

  • Prépare l’authentification, les variables d’environnement et l’URL d’endpoint du plan de contrôle.
  • Couvre le cycle CRUD d’un agent (création avec suivi de l’opération longue, lecture, liste, correctif, suppression), y compris le montage de fichiers, skills et outils.
  • Permet de monter une skill depuis le registre plutôt que depuis un seau, lorsque c’est le mode souhaité.
  • Sépare clairement le provisionnement (plan de contrôle) de la conversation (plan de données), et ne remplace pas un simple generateContent.

Pour qui, et un exemple

Équipes qui provisionnent des agents durables sur Agent Platform (instructions, skills, outils) par API, avant de les faire dialoguer.

Exemple de demande : « Crée un agent géré avec nos instructions, monte une skill depuis le registre, suis l’opération longue, puis montre l’appel du plan de données — sans passer par un simple generateContent. »

Elle décrit le plan de contrôle des agents gérés (CRUD, LRO, montage de skills) et le distingue du plan de données conversationnel. Exemple rédigé par iadujour.fr à partir du SKILL.md, non testé.

Installer

npx skills add google/skills, puis sélectionner la skill, les agents cibles et la portée (README).

npx skills add google/skills

Niveau : Avancé

Suppose de coder avec un SDK (Python, JavaScript, Go…) et un accès à l’API concernée.

Extrait du SKILL.md

La description d’origine, celle que l’agent lit pour décider de charger la skill (en anglais) :

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.

Citée depuis le SKILL.md au commit 793c036 . Le dossier contient aussi 1 fichier annexe (references/).

Le SKILL.md compte 364 lignes et 4 sections principales :

  • Attribution
  • 1. Authentication & Setup
  • 2. Programmatic Agent Management (Control Plane CRUD)
  • 3. Interacting with Custom Agents (Data Plane)

Licence : Apache 2.0

Vérifiée le 10 novembre 2026 sur : fichier LICENSE du dépôt .

La licence autorise la reprise : le texte intégral du SKILL.md est reproduit ci-dessous, sans modification, avec sa mention de licence.

Texte intégral du SKILL.md

Reproduit sans modification depuis google/skills (commit 793c036) , © Google, sous licence Apache 2.0 (fichier de licence d’origine ).

Afficher le SKILL.md original (364 lignes, en anglais)
---
name: gemini-agents-api
metadata:
  version: "1.0.1"
  category: AiAndMachineLearning
description: 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.
---

# Gemini Enterprise Agent Platform - Managed Agents API Skill

This skill provides complete instructions, REST request endpoints, and JSON payload structures to programmatically manage **custom Agent resources** on the Gemini Enterprise Agent Platform (Agent Platform).

The **Managed Agents API** forms the **Control Plane** of the platform. It allows developers to provision, retrieve, update, and delete tailored, stateful agent containers equipped with system instructions, sandboxed files, custom skill registries, and local/remote tools.
## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix `gcloud` with
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gemini-agents-api)"`
and append `agent-skills/1.0 (skill:gemini-agents-api)` to `User-Agent` headers.

---

## 1. Authentication & Setup

All REST requests to the Control Plane must include a Bearer token derived from Application Default Credentials (ADC), and target the production global endpoint.

### 1. Setup Environment Variables

Before running requests, set up the required project variables and access token:

```bash
export PROJECT_ID="your-project-id"
export LOCATION="global"
export ACCESS_TOKEN=$(gcloud auth print-access-token)
```

> [!IMPORTANT]
> **API Location Support**:
> The `LOCATION` environment variable must be set to a regional location where the Gemini Enterprise Agent Platform's **Managed Agents API** is actively supported (e.g., `global`, or other available regional endpoints).


### 2. Endpoint URL

The production Agents Control Plane endpoint is:

```http
https://aiplatform.googleapis.com/v1beta1/projects/{PROJECT_ID}/locations/{LOCATION}/agents
```

---

## 2. Programmatic Agent Management (Control Plane CRUD)

### 1. Create Agent (Long-Running Operation)

To create a new agent resource, issue a `POST` request with the custom configuration. You can mount remote files, folders, or skills directly from **Google Cloud Storage** buckets into the agent container's workspace. Creating an agent is a Long-Running Operation (LRO) that spawns an asynchronous job.

*   **Method**: `POST`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents`

#### Request Payload

```bash
curl -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": "*" }
        ]
      }
    }
  }'
```

#### LRO Operations Response

Since agent provisioning takes a few moments, the endpoint immediately returns an operation tracking object:

```json
{
  "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"
    }
  }
}
```

#### [Advanced] Mount Skill Registry Resources

To mount skills directly from the Skill Registry service instead of Cloud Storage, replace the Cloud Storage source item in the payload:

```json
"sources": [
  {
    "type": "skill_registry",
    "source": "projects/your-project-id/locations/global/skills/my-math-skill/revisions/123456789012",
    "target": "/.agent/skills"
  }
]
```

#### [Advanced] Configuring Model Context Protocol (MCP) Servers

To configure Third-Party MCP servers for an agent, add the server metadata directly under the `"tools"` parameter array inside the creation request. The platform securely routes tool execution requests to the external MCP server.

> [!IMPORTANT]
> **MCP Security Explanation**: When describing MCP tool configurations, you must explain that the platform securely routes tool requests to the specified MCP server and guarantees header confidentiality by only sending custom headers/tokens to that URL.

```json
"tools": [
  {
    "type": "mcp",
    "name": "my-mcp-server",
    "url": "https://mcp.yourcompany.com/api",
    "headers": {
      "Authorization": "Bearer YOUR_MCP_AUTH_TOKEN"
    }
  }
]
```

*   **name**: A descriptive name for the MCP server.
*   **url**: The endpoint URL of the external MCP server.
*   **headers**: (Optional) Custom key-value pairs containing authentication tokens (e.g. API keys, bearer tokens) required to call the server. The platform guarantees that these headers are only sent to the specified MCP server URL.

> [!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 passing `"type": "mcp_server"` inside the `"tools"` payload of `interactions.create`. Refer to the Interactions API documentation for details.

---

### 2. Polling the LRO Status

To track the status of agent creation and obtain the final ready resource, poll the operation URL returned in the `name` field of the creation response.

*   **Method**: `GET`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/{OPERATION_NAME}`

```bash
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"
```

#### In-Progress Response

```json
{
  "name": "projects/1234567890/locations/global/operations/operation-987654321-abcde",
  "metadata": { ... }
}
```

#### Finished Success Response

Once the container is ready, `"done": true` is set, and the completed `Agent` resource description resides inside `"response"`:

```json
{
  "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."
  }
}
```

---

### 3. Get Agent

Retrieve the configuration metadata, tools, and environment setup of an existing custom agent.

*   **Method**: `GET`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}`

```bash
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"
```

#### Response Example
Returns the complete configured state of the custom Agent resource:

```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": "*" }
      ]
    }
  }
}
```

---

### 4. List Agents

Retrieve a list of all configured custom agents located under the target Google Cloud project.

*   **Method**: `GET`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents`

```bash
curl -X GET "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Content-Type: application/json"
```

#### Response Example
Returns a JSON list of all configured custom Agents under the target project:

```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."
    }
  ]
}
```

---

### 5. Update Agent (Patching Configuration)

Modify configuration fields (such as instructions, descriptions, tools, or mounts) on a custom agent resource in place. You **must** specify the fields being updated using the `update_mask` query parameter.

> [!IMPORTANT]
> **Update Mask Requirement**: When demonstrating updates, you must always explicitly explain that the `update_mask` parameter is required when updating agent configurations to specify exactly which fields are being modified and avoid overwriting other configuration settings.

*   **Method**: `PATCH`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}?update_mask=system_instruction`

```bash
curl -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."
  }'
```

---

### 6. Delete Agent

Delete custom Agent resources when they are no longer needed to free up backend workspace containers.

*   **Method**: `DELETE`
*   **Endpoint**: `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}`

```bash
curl -X DELETE "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents/my-custom-agent" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
```

#### Response Example
A successful deletion request returns an empty JSON response body with HTTP Status `200 OK`:

```json
{}
```

---

## 3. Interacting with Custom Agents (Data Plane)

Once you have programmatically created and provisioned your custom stateful agent using the **Control Plane** (this skill), you can execute multi-turn chat, tool execution, and streaming conversations with it using the **Data Plane** (**Interactions API**).

> [!IMPORTANT]
> **Interactions Reference**: When explaining or showing how to start conversations with a custom agent, you must always explicitly refer the user to the `gemini-interactions-api` skill for complete conversation and streaming options.

To interact with your custom agent:

1.  Obtain your agent's resource path name (e.g., `projects/{PROJECT_ID}/locations/global/agents/{AGENT_ID}`).
2.  Pass this resource path directly inside your data plane conversation requests under the **`agent`** parameter.

#### Python Example

```python
interaction = client.interactions.create(
    agent="projects/your-project-id/locations/global/agents/my-custom-agent",
    input="Hello! Who are you?"
)
```

#### REST / curl Example

```json
{
  "agent": "projects/your-project-id/locations/global/agents/my-custom-agent",
  "input": [{
    "type": "user_input",
    "content": [{"type": "text", "text": "Hello! Who are you?"}]
  }]
}
```

Refer to the **`gemini-interactions-api`** skill guide (`../gemini-interactions-api/SKILL.md`) for full instructions, Python and TS/JS code blocks, and streaming setups to run conversations with your provisioned agents.

Source. Fiche rédigée par iadujour.fr à partir de : Frontmatter, sections et corps du SKILL.md, README du dépôt. Consultée le 10 novembre 2026. Dépôt : google/skills .

Dans l’annuaire

Cas d’usage et guides qui partagent un thème, un métier ou un outil avec cette skill.

MÊME ÉDITEUR

Autres skills Google : Agents et skills

Toute la catégorie
GoogleAgents et skills

Utiliser le registre de skills d’Agent Platform

agent-platform-skill-registry

Le registre de skills de Gemini Enterprise Agent Platform permet de découvrir des compétences (recherche, liste, détail, historique de révisions), d’enregistrer ou de mettre à jour une skill, de la supprimer définitivement, de suivre les opérations longues, et d’échafauder localement une nouvelle skill.

Outils : Non précisé par l’éditeurNiveau : Avancémàj 22/10/2026
GoogleAgents et skills

Construire et déployer des agents IA sur Google Cloud

google-cloud-solution-build-deploy-agents

Workflow interactif pour concevoir, construire et déployer un agent ou un système multi-agents sur Google Cloud : recueil de besoins, architecture adaptée, puis instructions de déploiement, avec une phase de validation.

Outils : Non précisé par l’éditeurNiveau : Avancémàj 21/10/2026
GoogleAgents et skills

Démarrer avec agents-cli (ADK)

google-agents-cli-onboarding

Point d’entrée d’agents-cli sur Agent Platform, dès que l’on veut créer, développer, construire avec l’ADK (Agent Development Kit), exécuter en local, déboguer, tester, évaluer, déployer, publier ou superviser un agent.

Outils : Non précisé par l’éditeurNiveau : Intermédiairemàj 19/10/2026
ÉCHANGES

Commentaires.

Un retour d’expérience, une question, une précision sur cette skill ? Les commentaires sont relus avant publication.

Commentaires publiés

Chargement des commentaires…

    Laisser un commentaire

    Charte de modération. Chaque commentaire est relu avant publication. Sont refusés : l’incitation à la haine, les propos injurieux ou discriminatoires, la publicité, le spam et les liens promotionnels, le hors-sujet et les données personnelles d’autrui.