Skip to content

Commit 3962d0b

Browse files
wukathcopybara-github
authored andcommitted
fix: Add debug level logging to mcp sse agent sample
We gated the HTTP debug info behind debug level logging - this fixes the sample agent so that it returns the debug info Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 940676911
1 parent 400f512 commit 3962d0b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • contributing/samples/mcp/mcp_sse_agent

contributing/samples/mcp/mcp_sse_agent/agent.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
15+
import logging
1616
import os
1717
import pprint
1818
from typing import Any
@@ -24,6 +24,13 @@
2424
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
2525
from google.adk.tools.tool_context import ToolContext
2626

27+
# Configure logging; the mcp_tool logger must be set to
28+
# DEBUG to capture http_debug_info
29+
logging.basicConfig(level=logging.INFO)
30+
logging.getLogger('google_adk.google.adk.tools.mcp_tool.mcp_tool').setLevel(
31+
logging.DEBUG
32+
)
33+
2734
_allowed_path = os.path.dirname(os.path.abspath(__file__))
2835

2936
connection_params = SseConnectionParams(

0 commit comments

Comments
 (0)