ServiceNow A2A Client
70by ServiceNow
Official ServiceNow A2A client for invoking ServiceNow AI agents via the A2A protocol. Includes OAuth authentication, ITSM incident categorization, and enterprise service management workflows.
Getting Started
README
ServiceNow A2A CLI
A simple command-line interface to communicate with remotely with ServiceNoW AI agents using the A2A (Agent-to-Agent) protocol.
Features
- Direct A2A protocol communication with ServiceNow AI Agents running in a Glide instance.
- OAuth token refresh function for secure authentication
- Simple setup using UV package manager
Prerequisites
- Python 3.11 or higher
- UV package manager
- ServiceNow instance with A2A agent and OAuth configured
- OAuth credentials with
a2aauthscopepermission
Setup
-
Copy the example environment file:
cp .env.example .env -
Configure your credentials in
.env:A2A_CLIENT_BASE_URL: Your ServiceNow instance URLA2A_CLIENT_AGENT_ID: The sys_id of your A2A agentA2A_CLIENT_ID: OAuth client IDA2A_CLIENT_SECRET: OAuth client secretA2A_CLIENT_REFRESH_TOKEN: Long-lived refresh token
-
Install dependencies:
uv sync -
Run it:
- CLI loop:
uv run python main.py
Output with a prompt like Categorize ITSM Incident INC0019104 (AI Agent sysid 900cf9f09f4f1210579fa9e9d90a1c4a) looks roughly like this:
Using existing auth token from A2A_CLIENT_AUTH_TOKEN...
Connecting to Categorize ITSM Incident Agent...
Connected to agent: Categorize ITSM incident AI agent
Description: Categorize ITSM incident AI agent assigns appropriate category and subcategory to an incident.
Type your question (e.g., 'Categorize ITSM Incident INC0019104')
Type 'quit' or 'exit' to end the session
You: Categorize ITSM Incident INC0019104
Agent: **Recommended incident (INC0019104) categorization details:**
- Category: Software (Reason: The incident is about being unable to log in to the rewards/benefits portal, which is a software/application access issue.)
- Subcategory: Not determined (Reason: None of the available subcategories—Email or Operating System—directly match the portal login issue.)
Task has been completed
Security Notes
- Never commit
.envfiles - they contain secrets! - The
.gitignorefile is configured to exclude.envfiles - Use
.env.exampleas a template (contains no real credentials) - Refresh tokens are valid for 100 days; access tokens expire in 30 minutes
Future Testing with Push notifications
Use the A2A Inspector web-based tool instead, which supports push notifications via ngrok:
See TESTING_WITH_A2A_INSPECTOR.md for complete instructions.
Files in This Project
main.py- Simple CLI (blocked by push notification requirement).env.example- Template for environment variables (no secrets).env- Your actual credentials (git-ignored)TESTING_WITH_A2A_INSPECTOR.md- How to use the web-based inspector
Contributing
When contributing, remember:
- Never commit
.envfiles - Use environment variables for all credentials
- Test with
.env.exampleto ensure it has all required fields - Update documentation if adding new environment variables
Capabilities
Skills (2)
Incident Categorization
Categorize ITSM incidents using ServiceNow AI agents via A2A protocol.
Service Management
Manage enterprise service workflows through ServiceNow AI agents.