StackA2A
customer-serviceOfficialpython

ServiceNow A2A Client

70

by 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.

6 starsUpdated 2026-02-01Apache-2.0
Quality Score70/100
Community
19
Freshness
83
Official
100
Skills
80
Protocol
30
🔒 Security
100

Getting Started

1Clone the repository
$ git clone https://github.com/ServiceNow/sn-a2a
2Navigate to the project
$ cd sn-a2a
3Install dependencies
$ pip install -r requirements.txt
4Run the agent
$ python main.py

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 a2aauthscope permission

Setup

  1. Copy the example environment file:

    cp .env.example .env
    
  2. Configure your credentials in .env:

    • A2A_CLIENT_BASE_URL: Your ServiceNow instance URL
    • A2A_CLIENT_AGENT_ID: The sys_id of your A2A agent
    • A2A_CLIENT_ID: OAuth client ID
    • A2A_CLIENT_SECRET: OAuth client secret
    • A2A_CLIENT_REFRESH_TOKEN: Long-lived refresh token
  3. Install dependencies:

    uv sync
    
  4. 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 .env files - they contain secrets!
  • The .gitignore file is configured to exclude .env files
  • Use .env.example as 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:

  1. Never commit .env files
  2. Use environment variables for all credentials
  3. Test with .env.example to ensure it has all required fields
  4. Update documentation if adding new environment variables

Capabilities

StreamingPush NotificationsMulti-TurnAuth: oauth2

Skills (2)

Incident Categorization

Categorize ITSM incidents using ServiceNow AI agents via A2A protocol.

itsmclassification

Service Management

Manage enterprise service workflows through ServiceNow AI agents.

enterpriseworkflow
servicenowitsmenterpriseoauthincident-management
View on GitHub