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.1.0.tar.gz (39.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.1.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentcard_disco-0.1.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentcard_disco-0.1.0.tar.gz
Algorithm Hash digest
SHA256 566054502e453682c1cf1a8bea59c19965578bca8958f381b6246fe486ce6f02
MD5 58ea768d917807c2cf6e98075ecbbeb9
BLAKE2b-256 41d87e197cfb1d74d065e20415c4919f81b6c78d5c4226d5da0d3e7eb00c9c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcard_disco-0.1.0.tar.gz:

Publisher: publish.yml on chineey/agentcard-disco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: agentcard_disco-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentcard_disco-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 907ab12f8879d1c35c2891dbea8a9c2f36f047fdab61d62e7807d8cff222745c
MD5 202f9d6c5267a0d3ac3902f0ed30bccd
BLAKE2b-256 81c7cba53a6dd672c7cdbe0216bb0aa67f7fdc6ddface655687ba44024480e94

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcard_disco-0.1.0-py3-none-any.whl:

Publisher: publish.yml on chineey/agentcard-disco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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