Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions samples/agent/adk/mcp_app_proxy/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from google.adk.sessions import InMemorySessionService
from google.genai import types
from pydantic import PrivateAttr
from tools import get_calculator_app, calculate_via_mcp, get_pong_app_a2ui_json
from tools import get_calculator_app, calculate_via_mcp, get_pong_app_a2ui_json, score_update
from agent_executor import get_a2ui_enabled, get_a2ui_catalog, get_a2ui_examples

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -160,6 +160,13 @@ def _build_agent_card(self) -> AgentCard:
tags=["html", "app", "demo", "tool"],
examples=["open pong", "show pong"],
),
AgentSkill(
id="score_update",
name="Score Update",
description="Updates the score for Pong game.",
tags=["pong", "score", "tool"],
examples=[],
),
],
)

Expand Down Expand Up @@ -194,7 +201,12 @@ def _build_llm_agent(
name=self._agent_name,
description="An agent that provides access to MCP Apps.",
instruction=instruction,
tools=[get_calculator_app, calculate_via_mcp, get_pong_app_a2ui_json],
tools=[
get_calculator_app,
calculate_via_mcp,
get_pong_app_a2ui_json,
score_update,
],
planner=BuiltInPlanner(
thinking_config=types.ThinkingConfig(
include_thoughts=True,
Expand Down
52 changes: 52 additions & 0 deletions samples/agent/adk/mcp_app_proxy/catalogs/0.8/mcp_app_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,58 @@
"required": [
"content"
]
},
"Column": {
"type": "object",
"additionalProperties": false,
"properties": {
"alignment": { "type": "string" },
"distribution": { "type": "string" },
"children": {
"type": "array",
"items": { "type": "object" }
}
}
},
"PongScoreBoard": {
"type": "object",
"additionalProperties": false,
"properties": {
"playerScore": {
"type": "object",
"description": "Player score value or path.",
"additionalProperties": false,
"properties": {
"literalNumber": { "type": "number" },
"literalString": { "type": "string" },
"path": { "type": "string" }
}
},
"cpuScore": {
"type": "object",
"description": "CPU score value or path.",
"additionalProperties": false,
"properties": {
"literalNumber": { "type": "number" },
"literalString": { "type": "string" },
"path": { "type": "string" }
}
}
}
},
"PongLayout": {
"type": "object",
"additionalProperties": false,
"properties": {
"mcpComponent": {
"type": "object",
"description": "McpApp component definition."
},
"scoreboardComponent": {
"type": "object",
"description": "PongScoreBoard component definition."
}
}
}
}
}
95 changes: 95 additions & 0 deletions samples/agent/adk/mcp_app_proxy/catalogs/0.9/mcp_app_catalog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
{
"catalogId": "a2ui.org:a2ui/v0.9/mcp_app_catalog.json",
"components": {
"Column": {
"type": "object",
"allOf": [
{
"$ref": "common_types.json#/$defs/ComponentCommon"
},
{
"type": "object",
"properties": {
"component": {
"const": "Column"
},
"alignment": {
"type": "string"
},
"distribution": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/anyComponent"
}
}
},
"required": [
"component"
],
"additionalProperties": false
}
]
},
"McpApp": {
"type": "object",
"allOf": [
Expand Down Expand Up @@ -36,13 +68,76 @@
"additionalProperties": false
}
]
},
"PongScoreBoard": {
"type": "object",
"allOf": [
{
"$ref": "common_types.json#/$defs/ComponentCommon"
},
{
"type": "object",
"properties": {
"component": {
"const": "PongScoreBoard"
},
"playerScore": {
"$ref": "common_types.json#/$defs/DynamicNumber",
"description": "Player score value or path."
},
"cpuScore": {
"$ref": "common_types.json#/$defs/DynamicNumber",
"description": "CPU score value or path."
}
},
"required": [
"component"
],
"additionalProperties": false
}
]
},
"PongLayout": {
"type": "object",
"allOf": [
{
"$ref": "common_types.json#/$defs/ComponentCommon"
},
{
"type": "object",
"properties": {
"component": {
"const": "PongLayout"
},
"mcpComponent": {
"$ref": "#/$defs/McpApp"
},
"scoreboardComponent": {
"$ref": "#/$defs/PongScoreBoard"
}
},
"required": [
"component"
],
"additionalProperties": false
}
]
}
},
"$defs": {
"anyComponent": {
"oneOf": [
{
"$ref": "#/$defs/McpApp"
},
{
"$ref": "#/$defs/PongScoreBoard"
},
{
"$ref": "#/$defs/PongLayout"
},
{
"$ref": "#/$defs/Column"
}
]
}
Expand Down
Loading
Loading