Tool: design_infra
Design Agent helps users manage the entire lifecycle of application infrastructure on Google Cloud Platform. It provides a set of specialized sub-agents to handle different aspects of infrastructure design and generation.
Supported Commands and Required Information:
manage_app_design: Design and architect infrastructure on Google Cloud Platform required for application infrastructure design intents.- Description:
- This command can generate the Google Cloud architecture, then render the Mermaid diagram as well as generate the Terraform code.
- This command may also accept Infrastructure as Code (IaC) when iterating on a design (e.g. import Terraform code into existing application template).
- This command can also be used to retrieve the Terraform code for an existing application template or app design.
- Design Session:
- Each design session is associated with an Application Design Center (ADC) application template (identified by
applicationTemplateURI). - The agent will maintain the state of application designs and its Terraform artifacts.
- To iterate on a design, you MUST provide the application template ID in the form of
projects/{projectid}/locations/{region}/spaces/{spaceid}/applicationTemplates/{templateid}. - To create a new design, do not supply the application template ID.
- Each design session is associated with an Application Design Center (ADC) application template (identified by
- User Query: Should describe the high-level application architecture, requirements, and constraints. You may specify environment variables, port, etc. Or specific request for IaC import or Terraform code retrieval.
- Example: "Design a 3-tier web app with a load balancer, frontend, backend, and a database."
- Example: "Import application design from IaC, here are my terraform files: - main.tf
terraform\n<main.tf file content>\n, - variables.tfterraform\n<variables file content>\n..." - Example: "Show me the Terraform code for application template
projects/.../applicationTemplates/test-app"
- Important Guidelines
- Design Iteration:: If the user wants to modify or update an existing design, they MUST provide the
application_template_idin the query.- Example: "Update design
projects/{projectid}/locations/{region}/spaces/{spaceid}/applicationTemplates/{templateid}: add a Cloud SQL instance."
- Example: "Update design
projectinput must be formatted asprojects/{projectid}.
- Design Iteration:: If the user wants to modify or update an existing design, they MUST provide the
- Goal: Generates a comprehensive design using Application Design Center (ADC) concepts or imports an application design from IaC.
- Returns: An XML-formatted string containing one or more of:
Message,serializedDesign,applicationTemplateURI,terraformCode,mermaidCode, andInstructions.
- Description:
generate_terraform: Generate Terraform configs a single resource.- User Query: specific request for Terraform code.
- Example: "Generate Terraform for a GKE cluster with a spot node pool."
- Hint: If user wants to generate Terraform for an ADC application template, they MUST use
manage_app_designinstead.- Example: "Generate Terraform for application template
tmpl_12345" should be routed tomanage_app_design.
- Example: "Generate Terraform for application template
- Goal: Produces valid, deployable Terraform HCL code.
- User Query: specific request for Terraform code.
generate_gcloud: Generate gcloud commands.- User Query: A request to perform an action using the Google Cloud CLI.
- Example: "Give me the gcloud command to create a Pub/Sub topic."
- Goal: Generates a sequence of executable
gcloudcommands.
- User Query: A request to perform an action using the Google Cloud CLI.
generate_bigquery: Generate BigQuery commands.- User Query: A request for BigQuery commands.
- Example: "Give me the bq command to create a dataset."
- Goal: Generates a sequence of executable
bqcommands.
- User Query: A request for BigQuery commands.
generate_kubernetes_yaml: Generate Kubernetes YAML.- User Query: A request for Kubernetes manifests.
- Example: "Create a Kubernetes Deployment for Nginx with 3 replicas."
- Goal: Produces valid Kubernetes YAML manifests.
- User Query: A request for Kubernetes manifests.
debug_deployment: Debug deployment failure in ADC application.- User Query: A request to debug a deployment failure in ADC application. It needs to contain a helper phrase like 'Help me debug this application' and only the application_uri and no other information.
- Example: "Help me debug this application - projects/test-project/locations/us-central1/spaces/test-space/applicationTemplates/test-app"
- Goal: Diagnoses deployment issues and returns instructions to fix the problem.
- Follow-up Actions:
- If the output contains
gcloudcommands, follow the instructions and run the gcloud command to fix the issue. - If the output describes an infrastructure design change, call the
manage_app_designtool to apply recommended changes in the infrastructure.
- If the output contains
- User Query: A request to debug a deployment failure in ADC application. It needs to contain a helper phrase like 'Help me debug this application' and only the application_uri and no other information.
Usage:
To use this tool, the caller must specify the command argument corresponding to the desired sub-agent and provide the user_query with the specific intent.
The following sample demonstrate how to use curl to invoke the design_infra MCP tool.
| Curl Request |
|---|
curl --location 'https://geminicloudassist.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "design_infra", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request for DesignInfra
DesignInfraRequest
| JSON representation |
|---|
{ "project": string, "userQuery": string, "contextId": string, "command": string } |
| Fields | |
|---|---|
project |
Required. The project resource name in the format |
userQuery |
Required. The natural language prompt provided by the user. |
contextId |
Optional. This is an optional session ID to continue a conversation. |
command |
Required. The command being invoked. Valid values are: - "manage_app_design" - "generate_terraform" - "generate_gcloud" - "generate_yaml" - "debug_deployment" |
Output Schema
Represents the response for DesignInfra. This message is only used as an output_schema_override.
DesignInfraResponse
| JSON representation |
|---|
{ "content": string, "contextId": string, "metadata": { object } } |
| Fields | |
|---|---|
content |
Contains the textual response received from the agent. |
contextId |
Represents the session ID; clients must persist this. |
metadata |
Contains the metadata returned from the agent. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
Tool Annotations
Destructive Hint: ✅ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ✅