← Receivers

blocks:declare

blocks family

mcp

Declare this workspace's own named block compositions — each one an ordered list of existing registry blocks with bound props. Replaces the whole manifest

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_things
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/blocks:declare \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "blocks": [ { "key": "AcmeHero", "label": "Acme hero", "blocks": [ { "component": "Hero", "props": { "variant": "centered", "heading": "Move with confidence" } } ] } ] }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • blocks object[] required The whole manifest, max 50. An empty array clears it.
  • group string optional OPTIONAL extra gate — a workspace the caller must control. It is NEVER the destination: the manifest is always written to the attested caller's own row.

Response

What comes back from the call.

  • ok boolean
  • workspace string The row that was written — the ATTESTED caller, never `group`.
  • count number Tenant blocks now declared.
  • error string
  • errors string[] Every reason the manifest was refused, each naming the offending key or component. Present ⟺ `error` is `invalid_manifest`; nothing was written.

Traffic

Every call to blocks:declare, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names blocks:declare, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 1
  • one.ie/web/src/lib/resolvers/blocks.ts:28

Answered by

blocks:declare one.ie/web/src/lib/resolvers/blocks.ts:328 Dispatched through POST /api/ask/blocks:declare, after the envelope validates the payload.

blocks family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name a page will use. Letters and digits, 2-64 chars, starting with a letter. MUST NOT be a registry or alias name — `Hero` means Hero in every workspace."
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "component": {
                  "type": "string",
                  "description": "A registry block name (or an alias, which is stored resolved to its canonical). Anything else refuses the whole write."
                },
                "props": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {},
                  "description": "The props bound to this member. Write to the names `blocks:schema` reports for the variant that renders."
                }
              },
              "required": [
                "component",
                "props"
              ]
            },
            "description": "1-8 registry blocks, in render order."
          }
        },
        "required": [
          "key",
          "blocks"
        ]
      },
      "description": "The whole manifest, max 50. An empty array clears it."
    },
    "group": {
      "description": "OPTIONAL extra gate — a workspace the caller must control. It is NEVER the destination: the manifest is always written to the attested caller's own row.",
      "type": "string"
    }
  },
  "required": [
    "blocks"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "description": "The row that was written — the ATTESTED caller, never `group`.",
      "type": "string"
    },
    "count": {
      "description": "Tenant blocks now declared.",
      "type": "number"
    },
    "error": {
      "type": "string"
    },
    "errors": {
      "description": "Every reason the manifest was refused, each naming the offending key or component. Present ⟺ `error` is `invalid_manifest`; nothing was written.",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "ok"
  ]
}