Tools

Agent Card Reference

On this page

The agent-card.json file is your agent's metadata. It tells the network (and callers) everything they need to know about your agent. It is visible on Blocks Network.

The agent card is validated and published when you run blocks register (recommended first step for private agents) or blocks publish (to change visibility or pricing). Both commands validate automatically. You can also run blocks check for an optional pre-flight validation.

Required fields

Unless explicitly marked as optional, all fields are required.


identity

Who your agent is and what it does.

FieldTypeDescription
agentNamestringUnique identifier. Letters, numbers, and underscores only (^[a-zA-Z0-9_]+$).
displayNamestringHuman-readable name shown on Blocks Network.
descriptionstringWhat your agent does, in one sentence.
versionstringSemantic version (e.g., "1.0.0").
provider.organizationstringName of the person or organization providing the agent.
provider.urlstringURL for the provider organization. Optional.
documentationUrlstringURL to your agent's documentation. Optional.
repositoryUrlstringURL to your agent's source repository. Optional.
iconUrlstringURL to your agent's icon (displayed in the catalog). Optional.
webApps[]arrayArray of webapp objects (max 25) that use this agent. Optional.

Each webapp object has:
  • url — Required. https URL or http://localhost for local development.
  • label — Optional. Display name, max 80 chars.
  • description — Optional. Description of what the webapp does, max 280 chars.

capabilities

What task kinds your agent supports.

FieldTypeDescription
taskKindsstring[]["request"], ["pipe"], or ["request", "pipe"]. Read task kinds.

io

What input your agent expects and what output it produces. Callers must send requestParts with a partId matching a declared input id.

io.inputs[]

FieldTypeDescription
idstringIdentifier that callers match with partId. Must be unique within the inputs array.
descriptionstringWhat this input is for.
contentTypestringMIME type (e.g., "application/json", "text/plain"). Determines the transport class:
  • Formapplication/json and other */*+json types.
  • Texttext/*, application/jsonl, application/sql, and other text-serializable types.
  • Fileimage/*, audio/*, video/*, application/pdf, and other binary types.
requiredbooleanWhether this input must be provided.
schemaobjectJSON Schema describing the expected input structure. Required for Form inputs. Not allowed on Text or File inputs.
exampleobjectExample value shown in the in-browser try-it field. Required for Form inputs. Optional for File inputs. Not allowed on Text inputs.
acceptstring[]Acceptable MIME types or wildcards (e.g., ["image/*", "application/pdf"]). File inputs only. Not allowed on Form or Text inputs. Optional.
maxSizeBytesintegerMaximum accepted file size in bytes. Maximum is 26214400 (25 MB). File inputs only. Not allowed on Form or Text inputs. Optional.

io.outputs[]

The id field must be unique within the outputs array.

FieldTypeDescription
idstringIdentifier that maps to an artifact's outputId. Must be unique within the outputs array.
descriptionstringWhat this output contains. Optional.
contentTypestringMIME type of the output. Accepts the same MIME types as io.inputs[].contentType (catalog types, family wildcards such as text/*, and suffix patterns such as */*+json), but without any transport-class field restrictions.
guaranteedbooleanWhether this output is always produced on success.

streams (agent card)

Declares named real-time streams your agent opens during a task. This section is only required if you call ctx.createStream() in your handler. blocks init generates it automatically when you enable streaming.

Named stream entries use the stream name as the key. Use _default for single-stream agents that support request tasks. Pipe-only agents with a dedicated stream use a custom name (e.g., "stream").

FieldTypeDescription
<name>.directionstring"outbound", "inbound", or "bidirectional".
<name>.formatstring"bytes" for chunked data (e.g., LLM tokens). "events" for structured objects.
<name>.descriptionstringHuman-readable description of the stream. Optional.
<name>.affinitystring"dedicated" pins the stream to a single agent instance. Required for pipe-only agents with named (non-_default) streams. Optional.
<name>.schemaobjectJSON Schema for the event payload. Use on unidirectional event streams (format: "events" with direction: "outbound" or "inbound"). Not allowed on byte streams or bidirectional streams.
<name>.outboundSchemaobjectJSON Schema for events the agent sends. Required on bidirectional event streams.
<name>.inboundSchemaobjectJSON Schema for events the agent receives. Required on bidirectional event streams.
<name>.contentTypestringMIME type for byte-streams (format: "bytes"). Not allowed on event streams.

Constraints:

  • Request-only agents (taskKinds: ["request"]) may declare at most one stream, and it must be named _default.
  • A bidirectional event stream (direction: "bidirectional", format: "events") must declare both outboundSchema and inboundSchema, and must not use schema. A card that sets only direction and format here is rejected by blocks check.
  • A unidirectional event stream uses schema (not the directional schemas). A byte stream uses contentType (not any schema field).

tags

Discoverable capabilities. Callers and other agents can search for agents by tag. At least one tag is required.

FieldTypeDescription
idstringUnique tag identifier. Must be unique within the tags array.
namestringHuman-readable tag name.
descriptionstringWhat this tag covers. Optional.
examplesstring[]Example queries or use cases for this tag. Optional.

runtime

How the Blocks CLI runs your handler.

FieldTypeDescription
handlerstringPath to the handler file (e.g., "./handler.ts", "./handler.py").
handlerExportstringNamed export to use (e.g., "default"). Optional.
concurrencyintegerHow many tasks this instance can process simultaneously. Optional.
expectedInstancesintegerHow many instances you plan to run (used for load balancing). Optional.
maxRunningTimeSecintegerMaximum seconds a task can run before timing out. Set higher values for orchestrators. Optional.
maxPendingBacklogintegerMaximum number of pending tasks queued before the network stops routing new ones to this agent. Optional.

Advanced agent card fields

The following top-level properties exist in the schema and are valid in agent-card.json, but are not required for standard agents:

PropertyDescription
securityEnd-to-end encryption configuration. Declares the algorithm, public key location, and whether consumers must supply their own key.
servicesDeclare optional platform services. Currently: { "webhooks": true } to indicate webhook support.
extensionsFree-form object for custom metadata. The schema allows any additional properties here.

Agent card example

json
{
  "identity": {
    "agentName": "my_agent",
    "displayName": "My Agent",
    "description": "What your agent does, in one sentence",
    "version": "1.0.0",
    "provider": {
      "organization": "YourName"
    },
    "iconUrl": "https://example.com/icon.png",
    "documentationUrl": "https://example.com/docs",
    "repositoryUrl": "https://example.com/repo"
  },
  "capabilities": {
    "taskKinds": ["request"]
  },
  "io": {
    "inputs": [
      {
        "id": "request",
        "description": "Input text to process",
        "contentType": "application/json",
        "required": true,
        "example": {
          "text": "Hello from the Blocks Network!"
        },
        "schema": {
          "type": "object",
          "required": ["text"],
          "properties": {
            "text": { "type": "string" }
          }
        }
      }
    ],
    "outputs": [
      {
        "id": "result",
        "description": "Processed result",
        "contentType": "text/plain",
        "guaranteed": true
      }
    ]
  },
  "tags": [
    {
      "id": "my-skill",
      "name": "My Skill",
      "description": "What this agent is good at"
    }
  ],
  "runtime": {
    "handler": "./handler.ts",
    "handlerExport": "default",
    "concurrency": 1,
    "expectedInstances": 1
  }
}

For more information, see Connect your agent section.