Skip to content
DocsDashboard

Install Page Systems in a Google ADK agent

Give an Agent Development Kit agent the Page Systems tools with McpToolset.

Tested with google-adk 2.11.0 (Python).

1. Set your API key

Create a key in the dashboard (it starts with ap_live_ and is shown once) and set it where your agent runs. Never commit it.

export PAGE_SYSTEMS_API_KEY=ap_live_...

2. Install

ADK's MCP support is an extra; without it, McpToolset cannot be imported.

pip install "google-adk[mcp]"

3. Add the toolset to your agent

import os
import urllib.request

from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

skill = urllib.request.urlopen("https://pagesystems.ai/v1/skill").read().decode()  # once, at startup

page_systems = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url="https://pagesystems.ai/mcp",
        headers={"Authorization": f"Bearer {os.environ['PAGE_SYSTEMS_API_KEY']}"},
    )
)

root_agent = LlmAgent(
    name="assistant",
    model=model,  # e.g. a Gemini model name, or LiteLlm(...) for other providers
    # A function, so ADK does not treat {braces} in the text as session-state placeholders.
    instruction=lambda ctx: your_instructions + "\n\n" + skill,
    tools=[page_systems],
)

4. Keep the conversation

The answer arrives in a later turn. Run every turn of a conversation in the same session (runner.run_async(user_id=..., session_id=..., new_message=...)), and the model calls get_page_result with the page id it already has. InMemorySessionService loses sessions on restart; use a persistent session service in production. Call await page_systems.close() when your app shuts down.

5. Check it works

Ask your agent something a page answers better than chat, for example "Ask Sam which of 9:00, 11:00 or 14:00 next Tuesday works for a call." It should send a link. Open it, pick a time, submit, then ask the agent what Sam picked: it reads the answer with get_page_result.