Skip to main content

Score and optimize A2A Agent Cards for discoverability

Project description

agentcard-disco

Score and optimise A2A Agent Cards for discoverability.

agentcard-disco analyses an Agent Card JSON file and gives it a discoverability score across four heuristic dimensions (plus optional AI-assisted analysis), surfacing exactly what to fix before publishing to an A2A registry.

┌─────────────────────────────────────────────────────────────┐
│  agentcard-disco          discoverability score             │
│                                                             │
│  🏆  DataPulse Analytics Agent                              │
│    Source: tests/fixtures/good_card.json                    │
│                                                             │
│    Score: 88.0 / 100   (88%)   Grade:  A                   │
└─────────────────────────────────────────────────────────────┘

Installation

pip install agentcard-disco

For AI-assisted scoring (--deep):

pip install "agentcard-disco[deep]"

Quick start

# Score a local card
agentcard-disco score ./agent-card.json

# Score from a URL
agentcard-disco score https://api.example.com/.well-known/agent-card.json

# + AI quality analysis (requires GEMINI_API_KEY in .env)
agentcard-disco score ./agent-card.json --deep

# Export report as JSON or Markdown
agentcard-disco score ./agent-card.json --format json --output report.json
agentcard-disco score ./agent-card.json --format markdown --output report.md

# CI gate — exit 1 if score is below 70%
agentcard-disco score ./agent-card.json --fail-under 70

# Get improvement suggestions only
agentcard-disco suggest ./agent-card.json --priority high

# Compare two cards side-by-side
agentcard-disco compare ./v1.json ./v2.json

Scoring dimensions

Dimension Points What it measures
Metadata Richness 0–30 Description length, tags, examples, provider info
Semantic Specificity 0–30 Filler-word ratio, skill distinctness, action-verb density
Search Alignment 0–20 Tag and keyword coverage vs A2A registry query vocabulary
Completeness 0–20 SemVer, capabilities, auth declaration, protocol version
AI Quality (--deep) 0–20 Categorical quality judgments via Gemini

Grade scale:

Grade Score
A 85–100%
B 70–84%
C 50–69%
D 30–49%
F 0–29%

AI scoring setup (--deep)

  1. Install the deep extra: pip install "agentcard-disco[deep]"
  2. Get a free Gemini API key at https://aistudio.google.com/app/apikey
  3. Add it to a .env file in your working directory:
GEMINI_API_KEY="AIza..."
  1. Run with --deep:
agentcard-disco score ./agent-card.json --deep

Python API

from agentcard_disco.parser import load
from agentcard_disco.scoring.engine import score

card = load("agent-card.json")        # also accepts http(s):// URLs
report = score(card)                  # Tier 1 only
report = score(card, deep=True)       # + AI analysis

print(report.grade.value)            # "A", "B", ...
print(report.percentage)             # 88.0
print(report.total_score)            # 88.0

for suggestion in report.all_suggestions:
    print(suggestion.priority, suggestion.field, suggestion.message)

Commands

score

agentcard-disco score SOURCE [OPTIONS]
Option Default Description
--deep off Enable Tier 2 AI analysis (+20 pts)
--format terminal terminal, json, or markdown
--output FILE stdout Write output to file
--fail-under SCORE Exit 1 if percentage < SCORE
--no-suggestions off Hide suggestions table
--no-detail off Hide per-dimension details

suggest

agentcard-disco suggest SOURCE [OPTIONS]
Option Default Description
--priority all Filter: all, high, medium, low
--format terminal terminal or json
--limit N 20 Max suggestions to show
--deep off Include AI suggestions

compare

agentcard-disco compare SOURCE SOURCE [SOURCE ...] [OPTIONS]
Option Default Description
--format terminal terminal or json

Development

git clone https://github.com/chinemeze/agentcard-disco
cd agentcard-disco
pip install -e ".[deep]"
pip install pytest pytest-cov mypy ruff

# Run tests
pytest tests/ -v

# Lint
ruff check src/

# Type check
mypy src/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentcard_disco-0.2.0.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentcard_disco-0.2.0-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file agentcard_disco-0.2.0.tar.gz.

File metadata

  • Download URL: agentcard_disco-0.2.0.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for agentcard_disco-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0a0f77ceb9127a52e4ad7aa2de5a23c91feafda6538120429c85e2ddec85a11e
MD5 0b0ad62b9f8f8c8e6fbfc14f22b842f1
BLAKE2b-256 3ad83df90d4acffbf01e289241d57d1586987d46f3a1bc6065d3f49a964476cf

See more details on using hashes here.

File details

Details for the file agentcard_disco-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentcard_disco-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aef11db9580ce94234b403f027b4db7c3aaa5bb4dbb18fd73f184866128221c9
MD5 21db51a370372a64e51f321890180ba2
BLAKE2b-256 1076f24e799e84d2b2f5dbd579d95447edee98f7c58f5c71ff5524927880c6ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page