get_match_telemetry
Retrieve match telemetry for both teams: total tokens consumed, per-turn thinking time, number of tool calls, and turn count. Use for post-game analysis or mid-game cost monitoring.
Instructions
Read-only. Return server-tracked match statistics for both teams: total tokens consumed, per-turn thinking time, number of tool calls, and turn count. Available during and after a match. Use this for post-game analysis or mid-game cost monitoring. For game-state history (what moves were made) use get_history instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection_id | Yes |
Implementation Reference
- Core implementation: returns aggregated telemetry (turn times, tokens, tool calls, errors) for both teams.
def get_match_telemetry(session: Session, viewer: Team) -> dict: """Return server-side telemetry for both teams.""" result: dict = {} for team in (Team.BLUE, Team.RED): times = session.turn_times_by_team[team] avg = sum(times) / len(times) if times else 0.0 result[team.value] = { "turns_played": len(times), "total_thinking_time_s": round(sum(times), 1), "avg_thinking_time_s": round(avg, 1), "total_tokens": session.tokens_by_team[team], "total_tool_calls": session.tool_calls_by_team[team], "total_errors": session.tool_errors_by_team[team], } return result - src/silicon_pantheon/server/game_tools.py:955-965 (registration)MCP registration of get_match_telemetry as a FastMCP tool, wrapping the core handler via _dispatch-like logic using _viewer_for_any_state.
@mcp.tool() def get_match_telemetry(connection_id: str) -> dict: """Read-only. Return server-tracked match statistics for both teams: total tokens consumed, per-turn thinking time, number of tool calls, and turn count. Available during and after a match. Use this for post-game analysis or mid-game cost monitoring. For game-state history (what moves were made) use get_history instead.""" resolved = _viewer_for_any_state(app, connection_id) if resolved is None: return _error(ErrorCode.GAME_NOT_STARTED, "no game session") session, _viewer = resolved from silicon_pantheon.server.tools import get_match_telemetry as _get_telemetry with session.lock: result = _get_telemetry(session, _viewer) return _ok({"result": result}) - Schema/type definition: takes only connection_id, returns a dict with telemetry. Documented as read-only, available during and after match.
@mcp.tool() - src/silicon_pantheon/server/tools/__init__.py:204-208 (registration)Note explaining get_match_telemetry is deliberately excluded from TOOL_REGISTRY (agent tool list) but is registered as an MCP tool in game_tools.py.
# NOTE: report_tokens and get_match_telemetry are registered as MCP # tools on the server (game_tools.py) but are NOT in TOOL_REGISTRY. # They're infrastructure tools called by the client software directly, # not by the LLM agent. Keeping them out of the registry means they # don't appear in the agent's tool list. - Client-side caller: fetches telemetry on the post-match screen to display turn times, tokens, tool calls, and errors for both teams.
try: r = await app.client.call("get_match_telemetry") if r.get("ok"): self._agent_stats = (r.get("result") or {}) except Exception: pass