Google Cloud Professional Services is a repository of example solutions and tools for building systems with Google Cloud products. Teams can use them as references or adapt them for workloads involving services such as GKE, BigQuery, Dataflow, and machine learning APIs. The catalogue entries are skills related to this repository.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add GoogleCloudPlatform/professional-services --skill cx-python-tools-callbacksgit clone --depth 1 https://github.com/GoogleCloudPlatform/professional-servicesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/googlecloudplatform/professional-services/cx-python-tools-callbacks)<a href="https://agentmods.dev/skills/googlecloudplatform/professional-services/cx-python-tools-callbacks"><img src="https://agentmods.dev/badge/skills/googlecloudplatform/professional-services/cx-python-tools-callbacks/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/googlecloudplatform/professional-services/cx-python-tools-callbacks"><img src="https://agentmods.dev/badge/skills/googlecloudplatform/professional-services/cx-python-tools-callbacks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.02169 |
| Opus 5.5 | $0.00024 | $0.00868 |
| Sonnet 5.5 | $0.00012 | $0.00434 |
| Haiku 4.5 | $0.00006 | $0.00217 |
Grade A, and why
cx-python-tools-callbacks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 25d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CX Agent Studio Python Tools & Callbacks: Comprehensive Guide and Best Practices
Overview
CX Agent Studio supports extending agent functionality through sandboxed Python 3 script executions. These scripts operate in two primary contexts:
- Python Function Tools: Invoked by the model mid-conversation to perform computations, fetch APIs, or query data sources.
- Pre-agent Callbacks (
beforeAgentCallbacks): Executed prior to prompt processing to perform event detection, message parsing, or prepare the conversation state.
This skill provides the strict templates, wrapper error patterns, state access paths, and registration files required to implement custom sandboxed logic without errors.
Key capabilities covered:
- Tool Configuration Mapping: Associating a JSON tool descriptor with a python file.
- Standard Non-Invasive Wrapper Pattern: Catching and surfacing exceptions safely in sandboxed runtimes.
- State Manipulation: Interacting with
context.stateandcallback_context.state. - Inter-Tool Execution: Calling other defined tools via the global
toolsinstance. - Pre-agent Callback Architecture: Hooking into the conversation flow to inspect user messages.
Critical Rules (Always Apply)
[!IMPORTANT] Sandboxed execution environments can swallow python exceptions, returning generic errors to the agent console. Always follow the wrapper pattern to preserve tracebacks.
- The Try/Except Wrapper Pattern is Mandatory: Never implement core tool logic directly in the entry-point function. Use a
_wrappedfunction sibling and returntool_exception(exc)inside a catch block. - Meaningful Entry-Point Docstrings: CX Agent Studio feeds the entry-point function's docstring directly to the LLM as the tool's specification. It MUST clearly describe the tool's purpose and the semantic meaning of its arguments. Never use meaningless generic placeholders.
- Do Not Alter Original Logic for Exception Handling: The wrapping structure must be a non-invasive drop-in so that reviewers can easily inspect the logic.
- State Namespace Access: Inside sandboxed tools, access state via
context.state.get(). Inside pre-execution callbacks, access state viacallback_context.state[]. - Global Tools Handler: Inter-tool calling is fully supported. Call other tools by referencing the global
toolsobject:tools.my_other_tool_name(payload).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 25d ago First seen · 220 lines · 59 tokens per session scan A 9fb3d9abc24f
cx-python-tools-callbacks is a skill published in the GitHub repository GoogleCloudPlatform/professional-services (3,090 stars, last pushed 6d ago), licensed Apache-2.0. It adds 59 tokens to every session and 2,169 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-05.
cx-python-tools-callbacks compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cx-python-tools-callbacksGoogleCloudPlatform/professional-services | Skill | 3.1k | 6d ago | Apache-2.0 | A | 59 | Gemini CLI |
| matlabK-Dense-AI/scientific-agent-skills | Skill | 59k | 7d ago | MIT | A | 44 | Claude Code |
| pennylaneK-Dense-AI/scientific-agent-skills | Skill | 59k | 7d ago | MIT | A | 74 | Claude Code |
| holoscan-install-wheelNVIDIA/skills | Skill | 4.2k | 3d ago | Apache-2.0 | A | 34 | Claude Code, Codex |
| future-self-liteTHU-MAIC/OpenMAIC | Skill | 45k | 2d ago | MIT | A | 20 | Claude Code, Codex |
| rocm-kernelshuggingface/kernels | Skill | 796 | yesterday | Apache-2.0 | A | 93 | Claude Code |
| splitting-oversized-modulesPostHog/posthog | Skill | 41k | today | none | A | 197 | Claude Code, Codex |