showcase/integrations/langgraph-python/qa/frontend-tools.md
/demos/frontend-tools on the dashboard host/api/copilotkit GET returns langgraph_status: "reachable"); OPENAI_API_KEY is set; LANGGRAPH_DEPLOYMENT_URL points at a deployment exposing the frontend_tools graph (registered under agent name frontend_tools)frontend_tools.py registers NO server-side tools — the agent forwards the frontend tool schema at runtime; the browser owns the handleruseFrontendTool: change_background (parameter: background: string — a CSS background value, colors or gradients). Handler sets local React state and returns { status: "success", message: "Background changed to …" }/demos/frontend-tools; verify the page loads within 3sdata-testid="background-container") is visible, full-screen, flex-centeredvar(--copilot-kit-background-color) (the theme default) — inspect the container's inline style.backgroundCopilotChat panel renders centered (max width 4xl, rounded-2xl corners) inside the background containerchange_backgroundchange_background — Successful Invocationchange_background tooldata-testid="background-container" element's inline style.background mutates from var(--copilot-kit-background-color) to a CSS gradient string containing linear-gradient (or radial-gradient)"Background changed to <value>" success message (confirming the agent consumed the handler's return payload, not just triggered the tool blindly)change_background call's argument (demonstrates the agent received the handler's return string into context)style.background becomes a solid color value (e.g. #00008b, darkblue, or rgb(...)) — no gradient keywordchange_background with a valid CSS fallback (e.g. yellow, #FFE135) and the container updates, or (b) declines politely without calling the tool — either is acceptable, but the UI must not crashchange_backgrounduseFrontendTool warningschange_background invocation completes within 15 seconds of prompt[data-testid="background-container"] inline style.background updates in real time as the tool is invokedmessage field (round-trip verified)