# a2a-agent-card

> A2A Agent Card validator and generator (A2A 1.0, detects and flags v0.3 cards): supportedInterfaces, protocolBinding/protocolVersion, capabilities, media-type modes, skills, provider, security schemes/requirements, JWS signature structure. Validate by URL (fetches /.well-known/agent-card.json) or inline JSON; or mode=generate from name, description, endpoint and skills.

- URL: https://forge-tools.dentreprise.workers.dev/api/a2a-agent-card (GET or POST)
- Price: 0.002 USDC on Base (2000 atomic USDC)
- MCP tool: a2a_agent_card
- Docs: https://agent-hub.dentreprise.workers.dev/tools/a2a-agent-card/

## Parameters

- `url` (string): Agent origin or card URL
- `card` (object): Inline Agent Card JSON (POST)
- `mode` (string): validate (default) or generate
- `name` (string): generate: agent name
- `description` (string): generate: description
- `endpoint` (string): generate: A2A endpoint https URL
- `skills` (string): generate: JSON array or comma-separated skill names

## Unpaid example

```bash
curl -sS -D - "https://forge-tools.dentreprise.workers.dev/api/a2a-agent-card?url=https%3A%2F%2Fexample.com"
```

## Example 402 challenge

```json
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://forge-tools.dentreprise.workers.dev/api/a2a-agent-card",
    "description": "A2A Agent Card validator and generator (A2A 1.0, detects and flags v0.3 cards): supportedInterfaces, protocolBinding/protocolVersion, capabilities, media-type modes, skills, provider, security schemes/requirements, JWS signature structure. Validate by URL (fetches /.well-known/agent-card.json) or inline JSON; or mode=generate from name, description, endpoint and skills.",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "2000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x7B8bf45ac6AcbA6D4CFB626b57D3f5fF3C9C89F7",
      "maxTimeoutSeconds": 120,
      "extra": {
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}
```

## Example response

```json
{
  "mode": "validate",
  "spec_version_detected": "1.0",
  "valid": true,
  "errors": 0,
  "warnings": 1,
  "issues": []
}
```

## Free demo / sample

This tool accepts `?demo=1` on the wave-1 worker (labelled sample, HTTP 200, not live data). The first 3 successful real calls per IP per UTC day are also free.

```bash
curl -sS "https://forge-tools.dentreprise.workers.dev/api/a2a-agent-card?url=https%3A%2F%2Fexample.com&demo=1"
```

```json
{
  "demo": true,
  "demo_label": "DEMO / SAMPLE — not live data. This is a labelled example response and was not charged.",
  "charged": false,
  "tool": "/api/a2a-agent-card",
  "docs": "https://agent-hub.dentreprise.workers.dev/tools/a2a-agent-card/",
  "how_to_get_live_data": "Call the same URL without demo=1. The first 3 successful real calls per IP per UTC day are free; after that attach an x402 v2 PAYMENT-SIGNATURE (USDC on Base).",
  "sample": {
    "mode": "validate",
    "spec_version_detected": "1.0",
    "valid": true,
    "errors": 0,
    "warnings": 1,
    "issues": []
  }
}
```

## Clients

- JS (x402 v2): `@x402/fetch` + `@x402/evm` (`wrapFetchWithPaymentFromConfig`, `ExactEvmScheme`). The older package `x402-fetch` is deprecated v1.
- Python: PyPI package `x402` (`x402HttpxClient` or `x402_requests`, `register_exact_evm_client`, `EthAccountSigner`).
- MCP: stdio `node src/server.mjs` in [forge-agent-mcp](https://github.com/forge-agent-hub/forge-agent-mcp); hosted Streamable HTTP at https://x402-gateway.forge-x402.workers.dev/mcp (original gateway tools).
- LangChain: wrap those clients with `DynamicStructuredTool` (`@langchain/core`) or `@tool` (`langchain_core`).
- Copy-paste snippets: https://agent-hub.dentreprise.workers.dev/tools/a2a-agent-card/ and https://agent-hub.dentreprise.workers.dev/quickstart/
