Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/google/adk/tools/mcp_tool/mcp_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
# part of the ADK public API; consumers flip the env var, not the symbol.
from .._gemini_schema_util import _to_gemini_schema
from ..base_authenticated_tool import BaseAuthenticatedTool
from ..set_model_response_tool import SET_MODEL_RESPONSE_FUNCTION_CALL_NAME
from ..tool_context import ToolContext
from ..transfer_to_agent_tool import transfer_to_agent
from .mcp_session_manager import _http_debug_var
Expand All @@ -70,6 +71,7 @@
REQUEST_EUC_FUNCTION_CALL_NAME,
REQUEST_CONFIRMATION_FUNCTION_CALL_NAME,
REQUEST_INPUT_FUNCTION_CALL_NAME,
SET_MODEL_RESPONSE_FUNCTION_CALL_NAME,
transfer_to_agent.__name__,
})

Expand Down
8 changes: 7 additions & 1 deletion src/google/adk/tools/set_model_response_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
from .base_tool import BaseTool
from .tool_context import ToolContext

# Name the framework dispatches this tool under. Exposed as a module-level
# constant (mirroring functions.py's REQUEST_*_FUNCTION_CALL_NAME) so other
# modules -- e.g. the MCP reserved-name guard -- can refer to it without
# hardcoding the literal.
SET_MODEL_RESPONSE_FUNCTION_CALL_NAME = 'set_model_response'


def _merge_json_schema_descriptions(
target: dict[str, Any], source: dict[str, Any]
Expand Down Expand Up @@ -215,7 +221,7 @@ def set_model_response() -> str:
self.func = set_model_response

super().__init__(
name=self.func.__name__,
name=SET_MODEL_RESPONSE_FUNCTION_CALL_NAME,
description=self.func.__doc__.strip() if self.func.__doc__ else '',
)

Expand Down
1 change: 1 addition & 0 deletions tests/unittests/tools/mcp_tool/test_mcp_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def test_init_with_empty_description(self):
"adk_request_credential",
"adk_request_confirmation",
"adk_request_input",
"set_model_response",
"transfer_to_agent",
],
)
Expand Down