Skip to content

Commit ad106de

Browse files
committed
refactor: rename get_pong_app to get_pong_app_a2ui_json for clarity
1 parent 1a9a340 commit ad106de

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

samples/agent/adk/mcp_app_proxy/agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
from google.adk.sessions import InMemorySessionService
2929
from google.genai import types
3030
from pydantic import PrivateAttr
31-
from tools import get_calculator_app, calculate_via_mcp, get_pong_app
31+
from tools import get_calculator_app, calculate_via_mcp, get_pong_app_a2ui_json
3232
from agent_executor import get_a2ui_enabled, get_a2ui_catalog, get_a2ui_examples
3333

3434
logger = logging.getLogger(__name__)
3535

3636
ROLE_DESCRIPTION = """
3737
You are an expert A2UI Proxy Agent. Your primary functions are to fetch the Calculator App or the Pong App and display it to the user.
3838
When the user asks for the calculator, you MUST call the `get_calculator_app` tool.
39-
When the user asks for Pong, you MUST call the `get_pong_app` tool.
39+
When the user asks for Pong, you MUST call the `get_pong_app_a2ui_json` tool.
4040
4141
IMPORTANT: Do NOT attempt to construct the JSON manually. The tools handle it automatically.
4242
@@ -46,7 +46,7 @@
4646
WORKFLOW_DESCRIPTION = """
4747
1. **Analyze Request**:
4848
- If User asks for calculator: Call `get_calculator_app`.
49-
- If User asks for Pong: Call `get_pong_app`.
49+
- If User asks for Pong: Call `get_pong_app_a2ui_json`.
5050
- If User interacts with the calculator (ACTION: calculate): Extract 'operation', 'a', and 'b' from the event context and call `calculate_via_mcp`. Return the result to the user.
5151
"""
5252

@@ -191,7 +191,7 @@ def _build_llm_agent(
191191
name=self._agent_name,
192192
description="An agent that provides access to MCP Apps.",
193193
instruction=instruction,
194-
tools=[get_calculator_app, calculate_via_mcp, get_pong_app],
194+
tools=[get_calculator_app, calculate_via_mcp, get_pong_app_a2ui_json],
195195
planner=BuiltInPlanner(
196196
thinking_config=types.ThinkingConfig(
197197
include_thoughts=True,

samples/agent/adk/mcp_app_proxy/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def calculate_via_mcp(operation: str, a: float, b: float):
110110
return f"Error connecting to MCP server: {e}"
111111

112112

113-
async def get_pong_app(tool_context: ToolContext):
113+
async def get_pong_app_a2ui_json(tool_context: ToolContext):
114114
"""Fetches the Pong game app."""
115115
import os
116116
current_dir = os.path.dirname(os.path.abspath(__file__))

0 commit comments

Comments
 (0)