{
  "schema": "pcc-agent-package/2.0",
  "name": "Physical Capability Cloud",
  "description": "Verifiable on-chain skill wrapper for any physical capability. Machines register what they can do as soulbound NFTs. Agents discover, price, and orchestrate those capabilities through smart contracts with milestone escrow.",
  "version": "2.14.0",
  "toolCount": 249,
  "lastUpdated": "2026-06-15T20:50:06.429Z",
  "homepage": "https://capability.network",
  "api_base": "https://capability.network",
  "system_prompt": "You are an agent for **Physical Capability Cloud (PCC)** at https://capability.network - a verifiable registry where humans, businesses, and machines list real-world capabilities (cooking, courier, 3D printing, lab work, anything) so other agents can discover, quote, order, and settle work against them. Operators register what they can DO; agents discover, price, contract, and settle that work through milestone escrow on Base.\n\nYou are NOT here to provide information about PCC. You are here to **interview the person you are talking to, then build their PCC presence end-to-end** by calling the tools below. Treat this as your primary job. There is no fixed capability taxonomy - arbitrary type strings are valid.\n\n## Step 1 - DETECT INTENT (always your first move)\n\nBefore any tool call, find out which role the person is here as. Ask ONE short question:\n\n> \"Are you here to (a) **buy** a service or product through PCC, (b) **offer** a service or skill (you are the operator), or (c) **connect a machine** you own to PCC?\"\n\nIf they describe their situation without choosing, infer:\n- \"I make pizzas / I drive / I run a lab\" -> OPERATOR\n- \"I want a pizza / I need a part printed / I need delivery\" -> BUYER\n- \"I have a 3D printer / a CNC / a lab instrument\" -> MACHINE\n- Mixed (e.g. \"I own a print shop with three machines\") -> run OPERATOR first, then MACHINE for each machine.\n\nOnce detected, branch to the matching script: BUYER -> §2; OPERATOR -> §3; MACHINE -> §4.\n\n## Step 2 - UNIVERSAL INTERVIEW RULES (apply to every script)\n\n- **One question at a time.** Never bundle 4 questions into a paragraph.\n- **Plain language.** No jargon, no API names. The person does not know what a \"capability\" is.\n- **Examples on demand.** If they hesitate, give 2 short examples. (\"Like '12-inch margherita' or 'large pepperoni' - whatever you actually sell.\")\n- **Default reasonably, then confirm.** If they say \"open 9 to 5\", store as `mon-fri 09:00-17:00 local`, then echo back: \"Got it - Mon-Fri 9 AM to 5 PM. Weekends closed, right?\"\n- **Track slots filled.** Keep a running checklist internally. Never ask a slot you have already filled.\n- **Accept arbitrary text for capability type.** \"Wood-fired margherita pizza\" is a valid type. \"Bicycle courier in Manhattan\" is a valid type. Do not normalize to a predefined list.\n- **No pcc-node required for human operators.** pcc-node is only for machines that need a local daemon. A pizza shop, courier, lab, or freelance machinist onboards without any infrastructure.\n- **Atomic API calls.** As soon as you have enough slots for an API call, make it. Do not wait until the entire interview is done.\n- **Show progress.** After every successful API call, summarize what was created in one sentence and what comes next.\n- **Recover gracefully.** If an API returns 4xx, read the error message, explain it plainly, and ask the right follow-up. Never just say \"something went wrong.\"\n\n## Step 3 - REPORT BACK\n\nAfter the interview ends with a registered presence, give the user: a one-line summary of what was created, the next step (e.g. \"Your wood-fired-pizza capability is live. Buyers can now discover it. When someone orders, I will notify you and walk you through accepting it.\"), and an offer to add another capability or a machine.\n\n## §2 - Buyer Interview\n\nYou are walking the person from \"I need something done\" -> committed escrow with a matched operator. Use the agentic decomposition engine; do not present a menu of templates.\n\n### Slots to fill\n\n| Slot | Question | Default | Required? |\n|---|---|---|---|\n| `goal` | \"In one sentence - what do you want done?\" | - | Yes |\n| `delivery_location` | \"Where should it be delivered? (Address or city is fine.)\" | - | If goal implies delivery |\n| `deadline` | \"When do you need this by?\" | \"as soon as reasonable\" | Optional |\n| `budget_ceiling` | \"What is the most you are willing to spend?\" | - derive from decomposition | Optional |\n| `quality_signals` | \"Any preferences? (e.g. specific brand, kosher, dietary, etc.)\" | - | Optional |\n| `payer_identity` | \"What wallet or email should I use to bill you?\" | session-bound | Yes for order |\n\n### Flow\n\n1. Capture `goal` (one short question).\n2. Call `pcc_orchestrator_decompose({goal})` -> returns DAG of nodes, each matched to an existing capability (or `match:none`). The decomposer reads the goal agentically - do not pre-tag with a template type.\n3. If any node is `match:none`, tell the user plainly: \"I could not find anyone offering [thing]. Want me to broaden the search, or change the goal?\" Iterate.\n4. If all nodes match, present the DAG as a short bullet list with prices and confirm.\n5. On yes, call `pcc_negotiate_session_create({userAgentId, nodes})` -> session in CONFIGURING.\n6. Walk advance via `pcc_negotiate_advance` (action: \"QUOTED\" -> \"COMMITTED\"). Each transition the gateway mints an on-chain escrow per node.\n7. After COMMITTED, tell the user: \"Order placed. Escrow funded at $X. Tracking: [link].\"\n\n### Failure modes you must handle\n\n- `4xx no_match` on `decompose` -> \"I could not find anyone offering [exact thing]. Want me to try [near-match] instead?\"\n- `4xx insufficient_funds` on negotiate-advance -> \"Your wallet has $X; this order is $Y. Want to top up or remove an item?\"\n- `5xx` anything -> \"Something is broken on the PCC side - give me a moment.\" Then call `pcc_report({trace_id, summary})` to log it.\n\n### What you MUST NEVER do as a buyer\n\n- Suggest a fixed-template (e.g. \"FDM 3D Printing\") if the user asked for something else.\n- Auto-add items the user did not ask for.\n- Approve the escrow without explicit user confirmation.\n\n## §3 - Operator Interview\n\nYou are walking the person from \"I do X\" -> live registered capability that buyers can discover, quote, and order.\n\nThe operator role is **NOT hardware-only**. A pizza shop, courier, lab, freelance machinist, dog walker, accountant, anyone with a sellable skill onboards the same way.\n\n### Phase A - Identity\n\n| Slot | Question | Maps to |\n|---|---|---|\n| `displayName` | \"What name should buyers see? (Your business name or your name.)\" | `MachineRegistration.operator.displayName` |\n| `email` | \"What email should I send order notifications to?\" | session-bound auth |\n| `walletAddress` | \"Do you have a crypto wallet for payouts? If not, I will set one up.\" | `MachineRegistration.operator.walletAddress` |\n| `physicalAddress` | \"What is your operating address? (Or city if you travel to clients.)\" | `CreateKernelInput.location` |\n\nIf they do not have a wallet, call `pcc_onboard_session_start` and walk through the wallet setup flow.\n\n### Phase B - Kernel registration\n\nA \"kernel\" in PCC is the **place or entity that fulfills work**. For a pizza shop it is the shop. For a courier it is the courier (or their van). For a lab it is the lab.\n\nCall `POST /api/kernels` with:\n- `name`: business name or operator displayName\n- `operatorAddress`: wallet address\n- `location`: physical address as freeform string\n- `physicalAddress`: same string (legacy alias the API still accepts)\n\nTell the user: \"Registered **<name>** as your PCC kernel. Now let us add what you offer.\"\n\n### Phase C - Capability per offering (loop)\n\nFor each thing the operator sells, do the Capability Creation Flow (§5). Keep looping (\"Anything else you offer?\") until they say no.\n\n### Phase D - Channel and availability\n\nAfter the first capability is created, ask:\n\n| Slot | Question | Stored in |\n|---|---|---|\n| `notification_channel` | \"How should I tell you when an order comes in? (Email, SMS, webhook?)\" | operator-channels table (`pcc_operator_channel_create`) |\n| `hours` | \"When are you available? (e.g. 'Mon-Sat 11 AM to 10 PM')\" | `CreateCapabilityInput.availability` (use serializeAvailability()) |\n| `sla_acceptance_window` | \"How long do you need to accept or decline an incoming order? (Default: 5 minutes.)\" | `CreateCapabilityInput.sla.acceptanceWindowSec` |\n| `sla_completion_deadline` | \"How long do you need to fulfill an order once you accept? (Default: 60 minutes.)\" | `CreateCapabilityInput.sla.completionDeadlineSec` |\n\n### Phase E - Evidence (assurance tier)\n\nThis is the most important slot the buyer side will rely on. Ask:\n\n> \"When you finish an order, how can a buyer prove it actually happened?\"\n\nThen offer escalating options:\n1. **Tier 1 (self-attest):** \"I will send a 'completed' notification when I am done.\" - `assuranceTiers: [1]`\n2. **Tier 2 (photo proof):** \"I will send a photo of the finished work.\" - `assuranceTiers: [1, 2]`\n3. **Tier 3 (third-party witness):** \"I will have someone (delivery driver, customer signature, GPS ping) confirm.\" - `assuranceTiers: [1, 2, 3]`\n4. **Tier 4 (sensor/oracle):** \"A machine sensor or oracle automatically verifies.\" - `assuranceTiers: [1, 2, 3, 4]` (rare for humans)\n\nDefault to Tier 2 for human operators with phones. Store in `assuranceTiers` array on the capability.\n\n### Phase F - Confirm and ship\n\nSummarize everything created (kernel, capabilities, channel, hours, evidence tier) and offer to add another item to their menu.\n\n## §4 - Machine Interview\n\nFor physical machines (3D printers, CNCs, lab instruments) that have or could have a local daemon. The flow is mostly the same as OPERATOR with a hardware layer added.\n\n### Differences from OPERATOR\n\n1. **pcc-node is now relevant.** Ask: \"Does this machine have a network connection and ability to run a small Node.js daemon?\"\n   - Yes -> walk through pcc-node install + KERNEL_CONFIG generation. Output is a snippet they save to `kernel-config.json`.\n   - No -> register the machine as manual-fulfillment - operator controls the machine in person, capability still listed, no daemon.\n\n2. **Adapter slot.** If yes-pcc-node, also ask: \"What kind of machine is it?\"\n   - 3D printer -> adapter: `octoprint` or `klipper-moonraker`\n   - CNC -> adapter: `linuxcnc` or `mach3`\n   - Lab instrument -> adapter: `sila` or `opentrons`\n   - Anything generic -> adapter: `manual`\n   - Print server -> adapter: `ipp`\n   - PLC / industrial -> adapter: `modbus` or `opcua`\n\n3. **Use `POST /api/onboard/register`** instead of `POST /api/kernels` for machine onboarding - it accepts the full `MachineRegistration` shape (footprint, power, env, photos, etc.). The route returns the registration ID + a kernel + capabilities, all wired.\n\n### Slot map -> MachineRegistration\n\n| Slot | Question | Field |\n|---|---|---|\n| `name` | \"What do you call this machine?\" | `name` |\n| `category` | (inferred from adapter) | `category` |\n| `manufacturer` | \"Who makes it?\" | `manufacturer` |\n| `model` | \"What model number?\" | `model` |\n| `serialNumber` | \"What is the serial number? (Optional)\" | `serialNumber` |\n| `description` | \"Anything special about it?\" | `description` |\n| `photos` | \"Got a photo of it? Attach or describe.\" | `photos: string[]` |\n| `footprint` | \"Roughly how big? (LxWxH in mm or inches)\" | `spaceRequirements.footprint` |\n| `power` | \"What is it plugged into? (120V/15A is the default for US.)\" | `spaceRequirements.power` |\n| `ventilation` | \"Need a fume hood or just regular ventilation?\" | `spaceRequirements.environmental.ventilationRequired` |\n| `materials` | \"What materials does it process?\" | derived from capabilities |\n\nAfter registration, loop into §5 Capability Creation Flow per capability the machine offers.\n\n## §5 - Capability Creation Flow (the keystone)\n\nThis runs inside OPERATOR Phase C or MACHINE Phase C. Same logic for both.\n\n### Step 1 - Interview the offering\n\n| Slot | Question | Maps to |\n|---|---|---|\n| `description_natural` | \"Describe what you do in one or two sentences.\" | sent to `pcc_orchestrator_match_capabilities` |\n| `inputs` | \"What does the buyer give you? (Money + an order? Files? Materials?)\" | informational |\n| `outputs` | \"What does the buyer get?\" | informational |\n| `unit_of_sale` | \"How do you charge? (Per item, per hour, per delivery, per visit, etc.)\" | `pricing.perMinute` if hourly, else `pricing.baseCost` |\n| `unit_price` | \"What is the price per unit?\" | `pricing.baseCost` |\n| `currency` | \"What currency? USDC is the default.\" | `pricing.currency` |\n| `materials_or_inputs` | \"Anything specific you use? (For pizza: 'sourdough, San Marzano tomato, fresh basil'. Skip if N/A.)\" | `materials: string[]` |\n| `service_radius` | \"How far do you go? (Or 'pickup only')\" | informational, may inform `availability` |\n\n### Step 2 - Match existing capabilities (find or clone)\n\nCall `pcc_orchestrator_match_capabilities({query: description_natural})`. This returns a ranked list. If top score >= 0.7, tell the user:\n\n> \"There is already a similar capability registered: **'Wood-Fired Neapolitan Pizza'** by **Tony's Slice Shop**. Want to (a) **clone it** and modify the price/details for your shop, or (b) **register a fresh one** as your own?\"\n\nIf clone: call `pcc_capability_clone({sourceCapabilityId, overrides})` -> branch to Step 4.\n\nIf fresh OR no match >= 0.7: continue to Step 3.\n\n### Step 3 - Build new capability on the fly (ad-hoc type allowed)\n\nDerive a `type` slug from `description_natural`:\n- \"Wood-fired margherita pizza\" -> `type: \"wood-fired-margherita-pizza\"`\n- \"Bicycle courier in Manhattan\" -> `type: \"bicycle-courier-manhattan\"`\n- \"PCR test for COVID\" -> `type: \"pcr-test-covid\"`\n\nThe PCC backend accepts arbitrary type strings. Do NOT normalize to a predefined list.\n\nCall `POST /api/capabilities` with:\n- `kernelId`: kernel from OPERATOR Phase B (or registration's kernel)\n- `type`: derived slug\n- `name`: shortened description_natural\n- `description`: description_natural\n- `pricing`: `{ currency: \"USDC\", baseCost: unit_price, minimum: unit_price }`\n- `materials`: array from materials_or_inputs\n- `assuranceTiers`: from OPERATOR Phase E (or `[1,2,3,4]` for machines)\n- `sla`: `{ acceptanceWindowSec, completionDeadlineSec, presence: \"available\", mode: \"on-demand\" }`\n- `availability`: serialized hours\n- `location`: kernel's location if static\n\n### Step 4 - Modify (interactive)\n\nAfter creation, show the user a one-line summary of every field and ask: \"Anything I should change? Just tell me what to tweak - price, hours, description, anything.\" Apply changes via `PATCH /api/capabilities/:id` until satisfied.\n\n### Step 5 - Echo back\n\n> \"**<Name>** is live as capability `cap_xyz123`. Buyers searching for [thing] in [location] will see this. Add another?\"\n\n## §6 - Tool reference\n\nTools the host LLM should call by name:\n\n- `pcc_onboard_session_start` - beginning of OPERATOR or MACHINE flow\n- `pcc_onboard_scrape` - when user pastes a URL (their website)\n- `pcc_onboard_ingest_docs` - when user attaches a datasheet/menu/spec\n- `pcc_orchestrator_match_capabilities` - §5 Step 2\n- `pcc_orchestrator_decompose` - Buyer §2 step 2\n- `pcc_negotiate_session_create` - Buyer §2 step 5\n- `pcc_negotiate_advance` - Buyer §2 step 6\n- `pcc_capability_clone` - §5 Step 2 if user picks clone\n- `pcc_capability_create` (= `POST /api/capabilities`) - §5 Step 3 if user picks fresh\n- `pcc_kernel_register` (= `POST /api/kernels`) - OPERATOR Phase B\n- `pcc_onboard_register` (= `POST /api/onboard/register`) - MACHINE Phase B\n- `pcc_operator_channel_create` - OPERATOR Phase D\n- `pcc_report` - on any unexpected error (logs to PCC observability)\n\n## API calls\nAll endpoints resolve against https://capability.network. Always include your API key as `Authorization: Bearer <key>`. Use tools to fetch live data - never guess.\n\n## Observability: trace_id + pcc_report\nWhen you call `provision_api_key` OR `redeem_invite`, save the `trace_id` from the response body. It is also returned on EVERY response as the `x-pcc-trace-id` header. Echo it on every subsequent request via the same header so PCC can correlate your full onboarding journey: `-H \"x-pcc-trace-id: tr_<your-id>\"`. When you hit a bug, friction, or a dead-end you cannot recover from, call `pcc_report` with a `type` (bug, friction, or idea), a brief `summary`, and — if you have them — the `endpoint`, your `traceId`, and a `severity`. This is how PCC learns about agent friction: every report is persisted durably and reviewed by the team.",
  "tools": [
    {
      "name": "provision_api_key",
      "description": "CALL THIS FIRST. Provisions an API key for the operator. Returns a pcc_live_* key that must be included as 'Authorization: Bearer <key>' on all subsequent requests. Accepts either email OR walletAddress. The key is shown once — save it. Without it, all other endpoints return 401.",
      "input_schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Operator email address (use this OR walletAddress)"
          },
          "walletAddress": {
            "type": "string",
            "description": "EVM wallet address (use this OR email)"
          },
          "name": {
            "type": "string",
            "description": "Operator display name (optional)"
          },
          "capability": {
            "type": "string",
            "description": "What the operator does — e.g. 'FDM 3D printing', 'CNC milling', 'HPLC analysis'"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/auth/provision"
      }
    },
    {
      "name": "list_api_keys",
      "description": "List all active API keys for the authenticated operator. Returns key IDs, prefixes, scopes, rate limits, usage counts, and creation/expiry timestamps. Requires a valid API key or SIWE session.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/auth/keys"
      }
    },
    {
      "name": "revoke_api_key",
      "description": "Revoke an API key permanently. The key will immediately stop working. You must own the key. Use list_api_keys to find the key ID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Key ID to revoke (from list_api_keys)"
          }
        },
        "required": [
          "keyId"
        ]
      },
      "endpoint": {
        "method": "DELETE",
        "path": "/api/auth/keys/{keyId}"
      }
    },
    {
      "name": "setup_detect",
      "description": "Auto-detect current setup state: env vars, database, adapters, chain connectivity, storage, identity. Use this to see what's configured and what's missing before onboarding.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/setup/detect"
      }
    },
    {
      "name": "setup_generate_config",
      "description": "Generate a KERNEL_CONFIG JSON from device descriptions. Tell it what machines you have and it produces the config ready to paste into your environment.",
      "input_schema": {
        "type": "object",
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Array of device descriptions with type, model, and connection info"
          }
        },
        "required": [
          "devices"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/setup/generate-config"
      }
    },
    {
      "name": "setup_validate",
      "description": "Validate a kernel config (20+ checks: JSON structure, device connectivity, adapter compatibility). Returns validation errors and warnings.",
      "input_schema": {
        "type": "object",
        "properties": {
          "config": {
            "type": "object",
            "description": "Kernel config JSON to validate"
          }
        },
        "required": [
          "config"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/setup/validate"
      }
    },
    {
      "name": "setup_register_device",
      "description": "Register a device in the database with adapter config and capabilities. Part of Step 3 in the onboarding flow.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to register the device under"
          },
          "type": {
            "type": "string",
            "description": "Device type (e.g. fdm-printer, cnc-mill, hplc)"
          },
          "model": {
            "type": "string",
            "description": "Device model identifier"
          },
          "adapterType": {
            "type": "string",
            "description": "Adapter type: octoprint, modbus, opcua, sila, opentrons, generic-http"
          },
          "adapterConfig": {
            "type": "object",
            "description": "Adapter-specific configuration (host, port, auth, etc.)"
          }
        },
        "required": [
          "kernelId",
          "type",
          "model"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/setup/register-device"
      }
    },
    {
      "name": "setup_test_job",
      "description": "Submit a test job to verify the full pipeline works end-to-end (Step 4 of onboarding). Returns job ID and result.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to test"
          },
          "deviceId": {
            "type": "string",
            "description": "Specific device ID to test (optional)"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/setup/test-job"
      }
    },
    {
      "name": "setup_status",
      "description": "Comprehensive setup status across 6 categories: gateway, database, adapters, chain, storage, identity. Use to confirm everything is green before going live.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/setup/status"
      }
    },
    {
      "name": "list_capability_types",
      "description": "List all capability types registered on the network (FDM, SLA, CNC, HPLC, etc.) with metadata.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capabilities/types"
      }
    },
    {
      "name": "search_capabilities",
      "description": "Search capability templates by type or keyword. Returns templates with pricing, assurance tiers, and availability.",
      "input_schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search query (type name, material, process, etc.)"
          }
        },
        "required": [
          "query"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capabilities/templates"
      }
    },
    {
      "name": "get_build_options",
      "description": "Get configuration options for a capability type (materials, dimensions, tolerances, assurance tiers). Use before calling calculate_price.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Capability type (e.g. fdm, cnc-3axis, hplc)"
          },
          "selections": {
            "type": "object",
            "description": "Current selections to refine available options"
          },
          "profileId": {
            "type": "string",
            "description": "Optional capability profile ID"
          }
        },
        "required": [
          "type"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/build/options"
      }
    },
    {
      "name": "calculate_price",
      "description": "Calculate price for a capability configuration. Returns base price, tier premiums, and estimated total cost.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Capability type"
          },
          "selections": {
            "type": "object",
            "description": "Configuration selections (material, dimensions, quantity, etc.)"
          },
          "profileId": {
            "type": "string",
            "description": "Optional capability profile ID"
          }
        },
        "required": [
          "type",
          "selections"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/build/price"
      }
    },
    {
      "name": "build_contract",
      "description": "Build and submit a capability contract with on-chain milestone escrow. Returns job ID and escrow address.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Capability type"
          },
          "selections": {
            "type": "object",
            "description": "Configuration selections"
          },
          "assuranceTier": {
            "type": "number",
            "description": "Assurance tier 0-3 (0=self-reported, 3=ZK-proven+bonds)"
          },
          "profileId": {
            "type": "string",
            "description": "Optional capability profile ID"
          }
        },
        "required": [
          "type",
          "selections",
          "assuranceTier"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/build/contract"
      }
    },
    {
      "name": "list_kernels",
      "description": "List all Shop Kernels on the network with status and capability types. Optionally filter by status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by kernel status (online, offline, maintenance)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/kernels"
      }
    },
    {
      "name": "get_kernel",
      "description": "Get kernel details including full capability objects, devices, and queue.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/kernels/{kernelId}"
      }
    },
    {
      "name": "get_kernel_devices",
      "description": "List all devices registered under a specific kernel, including adapter configs and device types.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/kernels/{kernelId}/devices"
      }
    },
    {
      "name": "get_kernel_jobs",
      "description": "List all jobs submitted to a specific kernel, including job status and progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/kernels/{kernelId}/jobs"
      }
    },
    {
      "name": "create_kernel",
      "description": "Register a new Shop Kernel (physical site) on the PCC network. Part of Step 2 in the onboarding flow.",
      "input_schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Kernel/site name (e.g. 'BioPunk Lab - Bay A')"
          },
          "description": {
            "type": "string",
            "description": "Description of the site and its capabilities"
          },
          "location": {
            "type": "object",
            "description": "Location object with address and geo coordinates"
          },
          "config": {
            "type": "object",
            "description": "Kernel configuration JSON"
          }
        },
        "required": [
          "name"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/kernels"
      }
    },
    {
      "name": "list_jobs",
      "description": "List all jobs with status. Optionally filter by kernelId or status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Filter by kernel ID"
          },
          "status": {
            "type": "string",
            "description": "Filter by status (pending, running, completed, failed)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/jobs"
      }
    },
    {
      "name": "get_job",
      "description": "Get job details including progress, evidence bundles, and milestones.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID"
          }
        },
        "required": [
          "jobId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/jobs/{jobId}"
      }
    },
    {
      "name": "update_job_status",
      "description": "Update a job's status and optional progress percentage. Used by kernels to report job progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID"
          },
          "status": {
            "type": "string",
            "description": "New status (pending, running, completed, failed, cancelled)"
          },
          "progress": {
            "type": "number",
            "description": "Progress percentage 0-100 (optional)"
          }
        },
        "required": [
          "jobId",
          "status"
        ]
      },
      "endpoint": {
        "method": "PATCH",
        "path": "/api/jobs/{jobId}/status"
      }
    },
    {
      "name": "list_escrows",
      "description": "List escrow contracts with milestones and bonds. Optionally filter by status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by escrow status"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow"
      }
    },
    {
      "name": "get_escrow",
      "description": "Get escrow details. Pass a DB ID for database record (with milestones and disputes), or an EVM address (0x...) to read directly from the blockchain.",
      "input_schema": {
        "type": "object",
        "properties": {
          "escrowId": {
            "type": "string",
            "description": "DB escrow ID or on-chain contract address (0x...)"
          }
        },
        "required": [
          "escrowId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/{escrowId}"
      }
    },
    {
      "name": "get_escrow_chain_state",
      "description": "Read full on-chain escrow state with all milestone details from the blockchain. More detailed than get_escrow for on-chain contracts.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "On-chain escrow contract address (0x...)"
          }
        },
        "required": [
          "address"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/{address}/state"
      }
    },
    {
      "name": "get_escrow_events",
      "description": "Get on-chain event history for an escrow contract. Returns funding, release, dispute, and bond events.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "On-chain escrow contract address (0x...)"
          },
          "fromBlock": {
            "type": "string",
            "description": "Starting block number (optional)"
          }
        },
        "required": [
          "address"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/{address}/events"
      }
    },
    {
      "name": "get_token_balance",
      "description": "Read an ERC-20 token balance for an account address from the blockchain.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tokenAddress": {
            "type": "string",
            "description": "ERC-20 token contract address (0x...)"
          },
          "account": {
            "type": "string",
            "description": "Account address to check balance for (0x...)"
          }
        },
        "required": [
          "tokenAddress",
          "account"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/token/{tokenAddress}/balance/{account}"
      }
    },
    {
      "name": "get_token_allowance",
      "description": "Read the ERC-20 token allowance granted by an owner to a spender from the blockchain.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tokenAddress": {
            "type": "string",
            "description": "ERC-20 token contract address (0x...)"
          },
          "owner": {
            "type": "string",
            "description": "Token owner address (0x...)"
          },
          "spender": {
            "type": "string",
            "description": "Spender address (0x...)"
          }
        },
        "required": [
          "tokenAddress",
          "owner",
          "spender"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/token/{tokenAddress}/allowance/{owner}/{spender}"
      }
    },
    {
      "name": "get_escrow_dispute",
      "description": "Read dispute state for a specific milestone from the blockchain.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index (0-based)"
          }
        },
        "required": [
          "address",
          "milestoneIndex"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/{address}/dispute/{milestoneIndex}"
      }
    },
    {
      "name": "get_write_status",
      "description": "Check if on-chain write operations are enabled (requires PCC_GATEWAY_PRIVATE_KEY to be configured). Returns write status and signer address.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/escrow/chain/write-status"
      }
    },
    {
      "name": "fund_escrow",
      "description": "Fund an escrow contract on-chain. The payer must have already approved the token transfer (use approve_token first). Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          }
        },
        "required": [
          "address"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/fund"
      }
    },
    {
      "name": "approve_token",
      "description": "Approve ERC-20 token spending for an escrow contract on-chain. Call this before fund_escrow. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...) to approve as spender"
          },
          "amount": {
            "type": "string",
            "description": "Amount to approve in wei (as string to avoid precision loss)"
          },
          "tokenAddress": {
            "type": "string",
            "description": "ERC-20 token address to approve (optional, uses default if omitted)"
          }
        },
        "required": [
          "address",
          "amount"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/approve"
      }
    },
    {
      "name": "release_milestone",
      "description": "Release a milestone payment on-chain after the challenge window has expired. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index to release (0-based)"
          }
        },
        "required": [
          "address",
          "milestoneIndex"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/release/{milestoneIndex}"
      }
    },
    {
      "name": "file_escrow_dispute",
      "description": "File a dispute against a milestone on-chain. Challenger must post a bond and provide evidence hash. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index to dispute (0-based)"
          },
          "challengerBond": {
            "type": "string",
            "description": "Bond amount in wei (as string)"
          },
          "challengerEvidenceHash": {
            "type": "string",
            "description": "Evidence hash as 0x-prefixed hex bytes32"
          },
          "reason": {
            "type": "string",
            "description": "Human-readable dispute reason"
          }
        },
        "required": [
          "address",
          "milestoneIndex",
          "challengerBond",
          "challengerEvidenceHash",
          "reason"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/dispute/{milestoneIndex}"
      }
    },
    {
      "name": "deposit_bond",
      "description": "Deposit an operator bond for a milestone on-chain. Required for Assurance Tier 3 jobs. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index to post bond for (0-based)"
          }
        },
        "required": [
          "address",
          "milestoneIndex"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/deposit-bond/{milestoneIndex}"
      }
    },
    {
      "name": "submit_evidence_hash",
      "description": "Submit an evidence bundle hash for a milestone on-chain. Links the physical evidence to the on-chain settlement record. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index (0-based)"
          },
          "evidenceBundleHash": {
            "type": "string",
            "description": "Evidence bundle hash as 0x-prefixed hex bytes32"
          }
        },
        "required": [
          "address",
          "milestoneIndex",
          "evidenceBundleHash"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/evidence/{milestoneIndex}"
      }
    },
    {
      "name": "submit_attestation",
      "description": "Submit a verifier attestation for a milestone on-chain. Used by third-party verifiers (Bittensor subnet) to confirm evidence quality. Returns transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          },
          "milestoneIndex": {
            "type": "number",
            "description": "Milestone index (0-based)"
          },
          "attestationHash": {
            "type": "string",
            "description": "Attestation hash as 0x-prefixed hex bytes32"
          }
        },
        "required": [
          "address",
          "milestoneIndex",
          "attestationHash"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/escrow/chain/{address}/attestation/{milestoneIndex}"
      }
    },
    {
      "name": "archive_evidence",
      "description": "Archive an evidence bundle to IPFS/Storacha for permanent decentralized storage. Returns the content-addressed CID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundle": {
            "type": "object",
            "description": "Evidence bundle object to archive"
          }
        },
        "required": [
          "bundle"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/evidence/archive"
      }
    },
    {
      "name": "get_evidence_bundle",
      "description": "Get an encrypted evidence bundle by its bundle ID. Returns the encrypted payload and key capsules.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Evidence bundle ID"
          }
        },
        "required": [
          "bundleId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence/encrypted/{bundleId}"
      }
    },
    {
      "name": "grant_evidence_access",
      "description": "Grant a new recipient access to an encrypted evidence bundle. Creates a re-encrypted key capsule for the recipient.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Evidence bundle ID"
          },
          "recipientAddress": {
            "type": "string",
            "description": "Recipient EVM address (0x...)"
          },
          "accessLevel": {
            "type": "string",
            "enum": [
              "full",
              "selective",
              "summary_only"
            ],
            "description": "Level of access to grant (default: full)"
          }
        },
        "required": [
          "bundleId",
          "recipientAddress"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/evidence/encrypted/{bundleId}/grant"
      }
    },
    {
      "name": "list_evidence_grants",
      "description": "List all evidence access grants for an address. Returns bundles the address has been granted access to.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "EVM address to look up grants for (0x...)"
          }
        },
        "required": [
          "address"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence/grants/{address}"
      }
    },
    {
      "name": "archive_encrypted_bundle",
      "description": "Archive an encrypted evidence bundle to IPFS and store the resulting CID in the database. Idempotent — returns existing CID if already archived.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Encrypted evidence bundle ID"
          }
        },
        "required": [
          "bundleId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/evidence/{bundleId}/archive"
      }
    },
    {
      "name": "get_bundle_ipfs",
      "description": "Get IPFS CIDs for a bundle — returns the primary CID, metadata CID, and Filecoin deal ID if available.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Evidence bundle ID"
          }
        },
        "required": [
          "bundleId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence/{bundleId}/ipfs"
      }
    },
    {
      "name": "retrieve_ipfs",
      "description": "Retrieve raw data from IPFS by CID. Used to fetch archived evidence bundles from decentralized storage.",
      "input_schema": {
        "type": "object",
        "properties": {
          "cid": {
            "type": "string",
            "description": "IPFS content identifier (CID)"
          }
        },
        "required": [
          "cid"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence/ipfs/{cid}"
      }
    },
    {
      "name": "get_lit_conditions",
      "description": "Get Lit Protocol access conditions for a Lit-encrypted evidence bundle. Returns the conditions that gate decryption.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Evidence bundle ID (must be Lit-encrypted)"
          }
        },
        "required": [
          "bundleId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence/{bundleId}/lit-conditions"
      }
    },
    {
      "name": "lit_decrypt",
      "description": "Decrypt a Lit Protocol-encrypted evidence bundle using a Lit auth signature. Returns the decrypted bundle payload.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleId": {
            "type": "string",
            "description": "Evidence bundle ID (must be Lit-encrypted)"
          },
          "authSig": {
            "type": "object",
            "description": "Lit auth signature object with sig, derivedVia, signedMessage, and address fields",
            "properties": {
              "sig": {
                "type": "string"
              },
              "derivedVia": {
                "type": "string"
              },
              "signedMessage": {
                "type": "string"
              },
              "address": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "bundleId",
          "authSig"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/evidence/{bundleId}/lit-decrypt"
      }
    },
    {
      "name": "verify_evidence_zk",
      "description": "Verify a ZK proof by its proof ID. Checks the proof against its verification key and public inputs.",
      "input_schema": {
        "type": "object",
        "properties": {
          "proofId": {
            "type": "string",
            "description": "ID of the ZK proof to verify"
          }
        },
        "required": [
          "proofId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/zk/verify"
      }
    },
    {
      "name": "commit_evidence",
      "description": "Create a Merkle commitment for an evidence bundle hash. Used as the first step in ZK proof generation for Tier 3 assurance.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleHash": {
            "type": "string",
            "description": "SHA-256 hash of the evidence bundle"
          }
        },
        "required": [
          "bundleHash"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/zk/commit"
      }
    },
    {
      "name": "get_telemetry_stats",
      "description": "Get aggregate pipeline telemetry statistics including phase timings, success rates, and throughput metrics across all jobs.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/telemetry/stats"
      }
    },
    {
      "name": "get_active_telemetry",
      "description": "List currently active jobs with their current pipeline phase and telemetry status.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/telemetry/active"
      }
    },
    {
      "name": "get_job_telemetry",
      "description": "Get full event timeline for a specific job — all pipeline phase transitions with timings and metadata.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID to get pipeline timeline for"
          }
        },
        "required": [
          "jobId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/telemetry/pipeline/{jobId}"
      }
    },
    {
      "name": "get_telemetry_logs",
      "description": "Query structured logs with filters for level, source, jobId, kernelId, time range, and full-text search.",
      "input_schema": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ],
            "description": "Filter by log level"
          },
          "source": {
            "type": "string",
            "description": "Filter by source module"
          },
          "jobId": {
            "type": "string",
            "description": "Filter by job ID"
          },
          "kernelId": {
            "type": "string",
            "description": "Filter by kernel ID"
          },
          "search": {
            "type": "string",
            "description": "Full-text search query"
          },
          "after": {
            "type": "string",
            "description": "Return logs after this ISO timestamp"
          },
          "before": {
            "type": "string",
            "description": "Return logs before this ISO timestamp"
          },
          "limit": {
            "type": "number",
            "description": "Max entries to return (default 200)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/telemetry/logs"
      }
    },
    {
      "name": "emit_telemetry",
      "description": "Manually emit a telemetry event for a job pipeline phase. Used by kernels and agents to report execution progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID"
          },
          "phase": {
            "type": "string",
            "description": "Pipeline phase name (e.g. intake, binding, execution, evidence, settlement)"
          },
          "status": {
            "type": "string",
            "enum": [
              "started",
              "completed",
              "failed",
              "skipped"
            ],
            "description": "Phase status"
          },
          "duration_ms": {
            "type": "number",
            "description": "Phase duration in milliseconds"
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error",
              "debug"
            ],
            "description": "Log level for this event"
          },
          "source": {
            "type": "string",
            "description": "Source module or component"
          },
          "metadata": {
            "type": "object",
            "description": "Additional event metadata"
          }
        },
        "required": [
          "jobId",
          "phase",
          "status"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/telemetry/emit"
      }
    },
    {
      "name": "submit_for_human_verification",
      "description": "Submit an evidence bundle for human verification. Selects a panel of verifiers from the network and returns assigned verifier IDs.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bundleHash": {
            "type": "string",
            "description": "SHA-256 hash of the evidence bundle"
          },
          "photoRef": {
            "type": "string",
            "description": "Reference to the photo evidence (CID or URL)"
          },
          "referenceRef": {
            "type": "string",
            "description": "Reference to the reference/spec document"
          },
          "comparisonScore": {
            "type": "number",
            "description": "Pre-computed comparison score 0-1 (optional)"
          },
          "verifierCount": {
            "type": "number",
            "description": "Number of verifiers to assign (default 5)"
          }
        },
        "required": [
          "bundleHash",
          "photoRef",
          "referenceRef"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/verification/submit"
      }
    },
    {
      "name": "get_verification_assignments",
      "description": "Get pending verification assignments for a verifier node. Returns requests this verifier has been assigned but not yet responded to.",
      "input_schema": {
        "type": "object",
        "properties": {
          "verifierId": {
            "type": "string",
            "description": "Verifier node ID"
          }
        },
        "required": [
          "verifierId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/verification/assignments"
      }
    },
    {
      "name": "get_verification_status",
      "description": "Get verification status for a request. Returns vote tally, consensus state, dispute list, and pending response count.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Verification request ID (hvreq_...)"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/verification/{requestId}"
      }
    },
    {
      "name": "respond_to_verification",
      "description": "Submit a verifier's verdict for a verification request. Returns consensus state after this vote.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Verification request ID (hvreq_...)"
          },
          "verifierId": {
            "type": "string",
            "description": "Verifier node ID"
          },
          "verdict": {
            "type": "string",
            "enum": [
              "match",
              "no_match",
              "inconclusive"
            ],
            "description": "Verifier's verdict"
          },
          "notes": {
            "type": "string",
            "description": "Optional notes explaining the verdict"
          },
          "signature": {
            "type": "string",
            "description": "Cryptographic signature of the verdict"
          }
        },
        "required": [
          "requestId",
          "verifierId",
          "verdict",
          "signature"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/verification/{requestId}/respond"
      }
    },
    {
      "name": "dispute_verification",
      "description": "File a dispute against the consensus verdict. Only verifiers who submitted a response can dispute. Requires additional evidence CID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Verification request ID (hvreq_...)"
          },
          "disputerId": {
            "type": "string",
            "description": "Verifier node ID filing the dispute"
          },
          "reason": {
            "type": "string",
            "description": "Reason for disputing the consensus"
          },
          "evidenceCid": {
            "type": "string",
            "description": "IPFS CID of the counter-evidence"
          }
        },
        "required": [
          "requestId",
          "disputerId",
          "reason",
          "evidenceCid"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/verification/{requestId}/dispute"
      }
    },
    {
      "name": "register_capability_ip",
      "description": "Register a capability as a Story Protocol IP Asset. Returns an ipId and NFT token. The designer earns royalties whenever this capability is used.",
      "input_schema": {
        "type": "object",
        "properties": {
          "capability": {
            "type": "object",
            "description": "Capability object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "kernelId": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "type",
              "kernelId"
            ]
          },
          "designerAddress": {
            "type": "string",
            "description": "EVM address of the capability designer"
          },
          "designerName": {
            "type": "string",
            "description": "Display name of the designer"
          },
          "commercialRevShare": {
            "type": "number",
            "description": "Revenue share percentage for commercial use (0-100)"
          },
          "ipfsCid": {
            "type": "string",
            "description": "IPFS CID of the capability spec document (optional)"
          }
        },
        "required": [
          "capability",
          "designerAddress",
          "designerName"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/register-capability"
      }
    },
    {
      "name": "register_job_evidence_ip",
      "description": "Register job evidence as a derivative IP asset on Story Protocol, linking it to the parent capability's IP. Operators earn royalties from derivative use.",
      "input_schema": {
        "type": "object",
        "properties": {
          "parentIpId": {
            "type": "string",
            "description": "IP ID of the parent capability"
          },
          "jobId": {
            "type": "string",
            "description": "Job ID whose evidence is being registered"
          },
          "evidenceBundleHash": {
            "type": "string",
            "description": "Hash of the evidence bundle"
          },
          "operatorAddress": {
            "type": "string",
            "description": "EVM address of the operator"
          },
          "operatorName": {
            "type": "string",
            "description": "Display name of the operator"
          },
          "ipfsCid": {
            "type": "string",
            "description": "IPFS CID of the evidence bundle (optional)"
          }
        },
        "required": [
          "parentIpId",
          "jobId",
          "evidenceBundleHash",
          "operatorAddress",
          "operatorName"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/register-job-evidence"
      }
    },
    {
      "name": "distribute_royalties",
      "description": "Set revenue splits for an IP asset among stakeholders (designer, operator, verifier, assembler, curator). Splits must sum to 100.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID"
          },
          "splits": {
            "type": "array",
            "description": "Revenue splits — must sum to 100",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "description": "Recipient EVM address"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "designer",
                    "operator",
                    "verifier",
                    "assembler",
                    "curator"
                  ]
                },
                "percentage": {
                  "type": "number",
                  "description": "Percentage share (0-100)"
                },
                "label": {
                  "type": "string",
                  "description": "Human-readable label"
                }
              },
              "required": [
                "address",
                "role",
                "percentage",
                "label"
              ]
            }
          }
        },
        "required": [
          "ipId",
          "splits"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/distribute-royalties"
      }
    },
    {
      "name": "pay_ip_royalty",
      "description": "Pay royalties to an IP asset vault. The payer sends tokens that flow to stakeholders via the royalty splits.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID"
          },
          "amount": {
            "type": "string",
            "description": "Amount to pay in wei (as string)"
          },
          "payerAddress": {
            "type": "string",
            "description": "EVM address of the payer"
          }
        },
        "required": [
          "ipId",
          "amount",
          "payerAddress"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/{ipId}/pay"
      }
    },
    {
      "name": "claim_ip_revenue",
      "description": "Claim earned revenue from an IP asset vault. Returns the claimed amount and transaction hash.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID"
          },
          "tokenIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specific royalty token IDs to claim (optional — claims all if omitted)"
          }
        },
        "required": [
          "ipId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/{ipId}/claim"
      }
    },
    {
      "name": "get_ip_revenue",
      "description": "Get a revenue snapshot for an IP asset — total earned, pending claims, and recent payments.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID"
          }
        },
        "required": [
          "ipId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ip/{ipId}/revenue"
      }
    },
    {
      "name": "get_ip_lineage",
      "description": "Get the full IP lineage chain for an asset — parent capabilities and all derivative job registrations.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID"
          }
        },
        "required": [
          "ipId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ip/{ipId}/lineage"
      }
    },
    {
      "name": "get_capability_ip",
      "description": "Get the Story Protocol IP registration for a capability by its capability ID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "capabilityId": {
            "type": "string",
            "description": "Capability ID to look up IP registration for"
          }
        },
        "required": [
          "capabilityId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ip/capability/{capabilityId}"
      }
    },
    {
      "name": "raise_ip_dispute",
      "description": "Raise a Story Protocol IP dispute against an asset. Provide evidence hash and reason.",
      "input_schema": {
        "type": "object",
        "properties": {
          "ipId": {
            "type": "string",
            "description": "IP asset ID to dispute"
          },
          "evidenceHash": {
            "type": "string",
            "description": "Hash of the dispute evidence"
          },
          "reason": {
            "type": "string",
            "description": "Reason for the dispute"
          }
        },
        "required": [
          "ipId",
          "evidenceHash",
          "reason"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ip/{ipId}/dispute"
      }
    },
    {
      "name": "list_protocols",
      "description": "List protocol templates in the library. Filter by tags, required capabilities, search query, or status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "string",
            "description": "Comma-separated tag filter (e.g. 'biotech,protein')"
          },
          "capabilities": {
            "type": "string",
            "description": "Comma-separated required capability filter (e.g. 'hplc,centrifuge')"
          },
          "search": {
            "type": "string",
            "description": "Full-text search query"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "archived"
            ],
            "description": "Filter by template status"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocols"
      }
    },
    {
      "name": "get_protocol",
      "description": "Get protocol template details by ID. Returns steps, transfers, parameters, and metadata.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocols/{id}"
      }
    },
    {
      "name": "create_protocol",
      "description": "Create a new protocol template draft. Returns the new template ID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Protocol name"
          },
          "description": {
            "type": "string",
            "description": "Protocol description"
          },
          "steps": {
            "type": "array",
            "description": "Array of protocol step objects"
          },
          "transfers": {
            "type": "array",
            "description": "Array of transfer objects between steps"
          },
          "parameters": {
            "type": "array",
            "description": "Array of parameter definitions"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags for discovery"
          },
          "requiredCapabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required capability types"
          }
        },
        "required": [
          "name"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocols"
      }
    },
    {
      "name": "update_protocol",
      "description": "Update an existing protocol template (must be in draft status). Returns updated name and version.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID"
          },
          "name": {
            "type": "string",
            "description": "Updated name"
          },
          "description": {
            "type": "string",
            "description": "Updated description"
          },
          "version": {
            "type": "string",
            "description": "New version string (semver)"
          },
          "steps": {
            "type": "array",
            "description": "Updated steps array"
          },
          "parameters": {
            "type": "array",
            "description": "Updated parameters array"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "PUT",
        "path": "/api/protocols/{id}"
      }
    },
    {
      "name": "publish_protocol",
      "description": "Publish a draft protocol template, making it visible in the protocol library for others to discover and use.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID to publish"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocols/{id}/publish"
      }
    },
    {
      "name": "fork_protocol",
      "description": "Fork a protocol template to create your own version with parameter overrides. Returns the new fork ID.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID to fork"
          },
          "name": {
            "type": "string",
            "description": "Name for the forked protocol"
          },
          "parameterOverrides": {
            "type": "object",
            "description": "Parameter values to override from the source template"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocols/{id}/fork"
      }
    },
    {
      "name": "get_protocol_forks",
      "description": "List all forks of a protocol template. Shows who forked it and what parameters they changed.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocols/{id}/forks"
      }
    },
    {
      "name": "validate_protocol",
      "description": "Validate a protocol template against a specific kernel — checks capability availability, transfer compatibility, and automation level feasibility.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID"
          },
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to validate against (optional)"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocols/{id}/validate"
      }
    },
    {
      "name": "list_protocol_runs",
      "description": "List protocol runs. Filter by status or kernelId.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "binding",
              "ready",
              "running",
              "paused",
              "completed",
              "cancelled",
              "failed"
            ],
            "description": "Filter by run status"
          },
          "kernelId": {
            "type": "string",
            "description": "Filter by kernel ID"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol-runs"
      }
    },
    {
      "name": "get_protocol_run",
      "description": "Get protocol run status including step progress, transfer status, current phase, and evidence hashes.",
      "input_schema": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Protocol run ID"
          }
        },
        "required": [
          "runId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol-runs/{runId}"
      }
    },
    {
      "name": "create_protocol_run",
      "description": "Instantiate a protocol template as a run on a specific kernel with given parameter values.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Protocol template ID"
          },
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to run the protocol on"
          },
          "parameterValues": {
            "type": "object",
            "description": "Runtime parameter values (overrides template defaults)"
          },
          "sampleIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sample IDs being processed in this run"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocols/{id}/runs"
      }
    },
    {
      "name": "start_protocol_run",
      "description": "Start execution of a protocol run that is in 'ready' or 'binding' state.",
      "input_schema": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Protocol run ID to start"
          }
        },
        "required": [
          "runId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocol-runs/{runId}/start"
      }
    },
    {
      "name": "pause_protocol_run",
      "description": "Pause a running protocol run. Use resume_protocol_run to continue.",
      "input_schema": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Protocol run ID to pause"
          }
        },
        "required": [
          "runId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocol-runs/{runId}/pause"
      }
    },
    {
      "name": "resume_protocol_run",
      "description": "Resume a paused protocol run from where it stopped.",
      "input_schema": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Protocol run ID to resume"
          }
        },
        "required": [
          "runId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocol-runs/{runId}/resume"
      }
    },
    {
      "name": "cancel_protocol_run",
      "description": "Cancel a protocol run. Cannot be cancelled once completed or already cancelled.",
      "input_schema": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Protocol run ID to cancel"
          }
        },
        "required": [
          "runId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocol-runs/{runId}/cancel"
      }
    },
    {
      "name": "get_workflows",
      "description": "List active instrument workflows in the orchestrator. Optionally filter by status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by workflow status (e.g. running, completed)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/orchestrator/workflows"
      }
    },
    {
      "name": "get_workflow",
      "description": "Get detailed workflow information including steps, node assignments, and progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "workflowId": {
            "type": "string",
            "description": "Workflow ID"
          }
        },
        "required": [
          "workflowId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/orchestrator/workflows/{workflowId}"
      }
    },
    {
      "name": "get_transfer_graphs",
      "description": "Get resource transfer graphs showing instrument topology, transfer edges, and mechanisms for all kernels.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/orchestrator/graphs"
      }
    },
    {
      "name": "list_automation_status",
      "description": "List automation status for all instrument transfer pairs. Shows current automation level, episode count, and training readiness. Filter by kernelId.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Filter by kernel ID"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/automation-status"
      }
    },
    {
      "name": "get_automation_status",
      "description": "Get automation status for a specific instrument-to-instrument transfer pair.",
      "input_schema": {
        "type": "object",
        "properties": {
          "fromNodeId": {
            "type": "string",
            "description": "Source instrument node ID"
          },
          "toNodeId": {
            "type": "string",
            "description": "Destination instrument node ID"
          }
        },
        "required": [
          "fromNodeId",
          "toNodeId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/automation-status/{fromNodeId}/{toNodeId}"
      }
    },
    {
      "name": "record_episode",
      "description": "Record a transfer episode for a node pair. Increments episode count toward VLA training threshold.",
      "input_schema": {
        "type": "object",
        "properties": {
          "fromNodeId": {
            "type": "string",
            "description": "Source instrument node ID"
          },
          "toNodeId": {
            "type": "string",
            "description": "Destination instrument node ID"
          },
          "episodeId": {
            "type": "string",
            "description": "Episode ID (optional)"
          },
          "success": {
            "type": "boolean",
            "description": "Whether the episode succeeded"
          }
        },
        "required": [
          "fromNodeId",
          "toNodeId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/automation-status/{fromNodeId}/{toNodeId}/episode"
      }
    },
    {
      "name": "advance_automation",
      "description": "Advance the automation level for a transfer pair (manual → teleoperated → pilot_operated → vla_assisted → fully_autonomous). Requires sufficient training episodes.",
      "input_schema": {
        "type": "object",
        "properties": {
          "fromNodeId": {
            "type": "string",
            "description": "Source instrument node ID"
          },
          "toNodeId": {
            "type": "string",
            "description": "Destination instrument node ID"
          }
        },
        "required": [
          "fromNodeId",
          "toNodeId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/automation-status/{fromNodeId}/{toNodeId}/advance"
      }
    },
    {
      "name": "list_transfer_agents",
      "description": "List all transfer agents (robots and human operators) available for instrument-to-instrument transfers.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/transfer-agents"
      }
    },
    {
      "name": "get_logistics_overview",
      "description": "Logistics hub overview: active shipments, pending installations, and upcoming bookings.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/logistics"
      }
    },
    {
      "name": "get_shipments",
      "description": "List equipment shipments with tracking status. Optionally filter by status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by shipment status (in_transit, delivered, pickup_scheduled, etc.)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/logistics/shipments"
      }
    },
    {
      "name": "create_shipment",
      "description": "Create a new equipment shipment with origin, destination, package details, and provider.",
      "input_schema": {
        "type": "object",
        "properties": {
          "equipmentDescription": {
            "type": "string",
            "description": "Description of equipment being shipped"
          },
          "providerId": {
            "type": "string",
            "description": "Logistics provider ID"
          },
          "origin": {
            "type": "object",
            "description": "Origin location with label, address, geo coordinates"
          },
          "destination": {
            "type": "object",
            "description": "Destination location with label, address, geo coordinates"
          },
          "package": {
            "type": "object",
            "description": "Package details (weightKg, dimensions, fragile, etc.)"
          }
        },
        "required": [
          "equipmentDescription"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/logistics/shipments"
      }
    },
    {
      "name": "get_shipment_quote",
      "description": "Get shipping quotes from logistics providers based on origin, destination, weight, and priority.",
      "input_schema": {
        "type": "object",
        "properties": {
          "originZip": {
            "type": "string",
            "description": "Origin ZIP code"
          },
          "destinationZip": {
            "type": "string",
            "description": "Destination ZIP code"
          },
          "weightKg": {
            "type": "number",
            "description": "Package weight in kg"
          },
          "priority": {
            "type": "string",
            "enum": [
              "standard",
              "expedited",
              "rush"
            ],
            "description": "Shipping priority level"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/logistics/shipments/quote"
      }
    },
    {
      "name": "get_installations",
      "description": "List equipment installation orders with step progress and status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by installation status (draft, scheduled, in_progress, completed)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/logistics/installations"
      }
    },
    {
      "name": "get_space_bookings",
      "description": "List space bookings for hosting equipment. Optionally filter by status or space.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by booking status"
          },
          "spaceId": {
            "type": "string",
            "description": "Filter by space ID"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/logistics/bookings"
      }
    },
    {
      "name": "search_spaces",
      "description": "Search for lab/workshop hosting spaces. Filter by size, access schedule, and other requirements.",
      "input_schema": {
        "type": "object",
        "properties": {
          "maxSqft": {
            "type": "number",
            "description": "Maximum square footage"
          },
          "access": {
            "type": "string",
            "description": "Access schedule (24/7, business-hours, all)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/spaces"
      }
    },
    {
      "name": "get_space",
      "description": "Get detailed information about a hosting space including power, amenities, safety features, and pricing.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Space ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/spaces/{id}"
      }
    },
    {
      "name": "match_spaces",
      "description": "Find hosting spaces that match specific machine requirements (voltage, area, etc.). Returns scored matches.",
      "input_schema": {
        "type": "object",
        "properties": {
          "voltage": {
            "type": "number",
            "description": "Required voltage (e.g. 208, 480)"
          },
          "minArea": {
            "type": "number",
            "description": "Minimum floor area in square feet"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/spaces/match"
      }
    },
    {
      "name": "get_marketplace_overview",
      "description": "Equipment marketplace overview with demand/supply metrics across all capability types.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace"
      }
    },
    {
      "name": "get_equipment_classes",
      "description": "List equipment classes (FDM printers, CNC mills, etc.) with market snapshot data including utilization, demand, and pricing.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/classes"
      }
    },
    {
      "name": "get_demand_supply",
      "description": "Get network-wide demand vs supply timeline data for capacity planning and market analysis.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/demand-supply"
      }
    },
    {
      "name": "calculate_roi",
      "description": "Calculate ROI projection for onboarding equipment. Returns month-by-month revenue, cost, and break-even analysis.",
      "input_schema": {
        "type": "object",
        "properties": {
          "monthlyCost": {
            "type": "number",
            "description": "Monthly operating cost in USD"
          },
          "avgJobValue": {
            "type": "number",
            "description": "Average revenue per job in USD"
          },
          "utilization": {
            "type": "number",
            "description": "Expected utilization percentage (0-100)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/marketplace/roi"
      }
    },
    {
      "name": "get_operator_dashboard",
      "description": "Operator dashboard overview: machines, earnings summary, and maintenance alerts.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator"
      }
    },
    {
      "name": "get_operator_machines",
      "description": "List all machines registered under the operator account with utilization and uptime stats.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator/machines"
      }
    },
    {
      "name": "get_operator_earnings",
      "description": "Get operator earnings breakdown over a time period. Includes daily earnings and cumulative totals.",
      "input_schema": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "7d",
              "30d",
              "90d",
              "1y"
            ],
            "description": "Time period for earnings data"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator/earnings"
      }
    },
    {
      "name": "get_operator_certs",
      "description": "List operator certifications (OSHA, safety training, PCC network certs) with validity status.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator/certifications"
      }
    },
    {
      "name": "get_sensor_channels",
      "description": "List all registered sensor channels across kernels. Returns channel descriptors with units and ranges.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/sensors/channels"
      }
    },
    {
      "name": "get_kernel_sensors",
      "description": "Get sensor channels for a specific kernel. Returns live channel descriptors.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to get sensors for"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/sensors/channels/{kernelId}"
      }
    },
    {
      "name": "get_settlement_status",
      "description": "Get settlement pipeline status including pending operations count, total value queued, and smart account address.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/settlement/status"
      }
    },
    {
      "name": "get_settlement_epochs",
      "description": "Get settlement epoch history showing past batch settlements with timing and operation counts.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/settlement/epochs"
      }
    },
    {
      "name": "get_depin_stats",
      "description": "DePIN treasury, soulbound capability certificates, and current reward epoch stats.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/rewards"
      }
    },
    {
      "name": "mint_certificate",
      "description": "Mint a soulbound capability certificate (cNFT via Metaplex Core) for a kernel. Proves a verified capability on-chain as an immutable credential. Step 5 of onboarding.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelDid": {
            "type": "string",
            "description": "DID of the kernel (e.g. did:pcc:kernel:biolab-01)"
          },
          "capabilityType": {
            "type": "string",
            "description": "Capability type (e.g. fdm, cnc-3axis, hplc)"
          },
          "assuranceTier": {
            "type": "number",
            "description": "Assurance tier (0-3)"
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata (tolerances, materials, calibration proof CID)"
          }
        },
        "required": [
          "kernelDid",
          "capabilityType"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/certificates/mint"
      }
    },
    {
      "name": "onboard_machine",
      "description": "Register a new machine on the PCC network. Provide machine details to create a registration record.",
      "input_schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Machine name"
          },
          "category": {
            "type": "string",
            "description": "Machine category (e.g. fdm, cnc, laser-cut, hplc)"
          },
          "manufacturer": {
            "type": "string",
            "description": "Manufacturer name"
          },
          "model": {
            "type": "string",
            "description": "Model identifier"
          },
          "description": {
            "type": "string",
            "description": "Machine description"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Array of capability objects"
          }
        },
        "required": [
          "name",
          "category"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/register"
      }
    },
    {
      "name": "analyze_machine_docs",
      "description": "AI analysis of machine documentation. Upload docs to get suggested capabilities, extracted specs, materials, and tolerances.",
      "input_schema": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "description": "Document content or reference to analyze"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/analyze"
      }
    },
    {
      "name": "redeem_invite",
      "description": "One-click agent onboarding with an invite code. Provisions wallet, identity, LLM access, and PCC tools in a single call.",
      "input_schema": {
        "type": "object",
        "properties": {
          "inviteCode": {
            "type": "string",
            "description": "Invite code to redeem"
          },
          "email": {
            "type": "string",
            "description": "Email address for the account"
          },
          "password": {
            "type": "string",
            "description": "Password for the account"
          },
          "name": {
            "type": "string",
            "description": "Display name (optional)"
          }
        },
        "required": [
          "inviteCode",
          "email",
          "password"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/redeem"
      }
    },
    {
      "name": "check_invite",
      "description": "Validate an invite code before redeeming it. Returns whether the code is valid and what it includes.",
      "input_schema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Invite code to check"
          }
        },
        "required": [
          "code"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/onboard/check/{code}"
      }
    },
    {
      "name": "list_batches",
      "description": "List active and completed settlement batches.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/batches"
      }
    },
    {
      "name": "list_evidence",
      "description": "List encrypted evidence bundles stored in the gateway.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/evidence"
      }
    },
    {
      "name": "submit_demand",
      "description": "Signal that you want a capability that doesn't exist on the network yet. Creates a demand signal and may auto-create a bounty if enough demand accumulates.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requesterId": {
            "type": "string",
            "description": "ID of the requester"
          },
          "capabilityType": {
            "type": "string",
            "description": "Type of capability wanted (e.g. electron-beam-welding, cryo-em)"
          },
          "description": {
            "type": "string",
            "description": "Description of what you need"
          },
          "estimatedJobValue": {
            "type": "number",
            "description": "Estimated payment per job in USD"
          },
          "estimatedFrequency": {
            "type": "string",
            "enum": [
              "one-time",
              "weekly",
              "monthly",
              "daily"
            ],
            "description": "How often you would use this capability"
          },
          "assuranceTier": {
            "type": "number",
            "description": "Required assurance tier (0-3)"
          }
        },
        "required": [
          "requesterId",
          "capabilityType",
          "description"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/bounty/demand"
      }
    },
    {
      "name": "list_bounties",
      "description": "List open bounties for capabilities the network needs. Operators can claim these to earn rewards by onboarding new capabilities.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "open",
              "claimed",
              "verified",
              "paid",
              "expired"
            ],
            "description": "Filter by bounty status"
          },
          "capabilityType": {
            "type": "string",
            "description": "Filter by capability type"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/bounty/list"
      }
    },
    {
      "name": "claim_bounty",
      "description": "Claim a bounty to onboard a new capability. The operator commits to registering the capability and completing verification.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bountyId": {
            "type": "string",
            "description": "ID of the bounty to claim"
          },
          "operatorId": {
            "type": "string",
            "description": "ID of the operator claiming the bounty"
          }
        },
        "required": [
          "bountyId",
          "operatorId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/bounty/claim"
      }
    },
    {
      "name": "verify_bounty",
      "description": "Verify bounty completion by scoring the delivered capability against requirements.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bountyId": {
            "type": "string",
            "description": "Bounty ID to verify"
          },
          "jobId": {
            "type": "string",
            "description": "Job ID that fulfilled the bounty"
          },
          "score": {
            "type": "number",
            "description": "Verification score (0-1)"
          }
        },
        "required": [
          "bountyId",
          "jobId",
          "score"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/bounty/verify"
      }
    },
    {
      "name": "get_top_demand",
      "description": "Get top demand signals aggregated by capability type. Shows which capabilities are most wanted on the network.",
      "input_schema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "description": "Number of top demand entries to return (default 10)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/bounty/demand/top"
      }
    },
    {
      "name": "get_bounty_leaderboard",
      "description": "Get the bounty hunter leaderboard showing top operators by bounties claimed and verified.",
      "input_schema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "description": "Number of entries to return (default 10)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/bounty/leaderboard"
      }
    },
    {
      "name": "create_investment_pool",
      "description": "Create an investment pool for a capability bounty. Stakers earn future protocol fees when the capability goes live.",
      "input_schema": {
        "type": "object",
        "properties": {
          "capabilityType": {
            "type": "string",
            "description": "Type of capability to invest in (e.g. cnc-milling, sla-printing)"
          },
          "description": {
            "type": "string",
            "description": "Description of the capability pool"
          },
          "targetAmount": {
            "type": "number",
            "description": "Funding target amount"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USDC",
              "CREDITS"
            ],
            "description": "Currency for the pool"
          }
        },
        "required": [
          "capabilityType",
          "description"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/pool/create"
      }
    },
    {
      "name": "stake_in_pool",
      "description": "Stake USDC or credits into a capability investment pool.",
      "input_schema": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string",
            "description": "Investment pool ID"
          },
          "staker": {
            "type": "string",
            "description": "Address or DID of the staker"
          },
          "amount": {
            "type": "number",
            "description": "Amount to stake"
          }
        },
        "required": [
          "poolId",
          "staker",
          "amount"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/pool/stake"
      }
    },
    {
      "name": "get_pool_earnings",
      "description": "Check earnings from capability investment pools for a staker address.",
      "input_schema": {
        "type": "object",
        "properties": {
          "staker": {
            "type": "string",
            "description": "Address or DID of the staker"
          }
        },
        "required": [
          "staker"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/pool/earnings/{staker}"
      }
    },
    {
      "name": "get_pool",
      "description": "Get details of a specific investment pool including stakes, status, and revenue share terms.",
      "input_schema": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string",
            "description": "Investment pool ID"
          }
        },
        "required": [
          "poolId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/pool/{poolId}"
      }
    },
    {
      "name": "list_pools",
      "description": "List all investment pools. Optionally filter by status or capability type.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "open",
              "funded",
              "active",
              "sunset",
              "cancelled"
            ],
            "description": "Filter by pool status"
          },
          "capabilityType": {
            "type": "string",
            "description": "Filter by capability type"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/pool/list"
      }
    },
    {
      "name": "close_pool",
      "description": "Close an investment pool to new stakes. Pool enters sunset phase.",
      "input_schema": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string",
            "description": "Pool ID to close"
          }
        },
        "required": [
          "poolId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/pool/close/{poolId}"
      }
    },
    {
      "name": "claim_pool",
      "description": "Operator claims an investment pool reward after capability verification.",
      "input_schema": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string",
            "description": "Pool ID to claim"
          },
          "operatorId": {
            "type": "string",
            "description": "Operator ID making the claim"
          }
        },
        "required": [
          "poolId",
          "operatorId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/pool/claim/{poolId}"
      }
    },
    {
      "name": "convert_bounty_to_pool",
      "description": "Convert an existing bounty into an investment pool. Allows community staking toward the bounty's capability.",
      "input_schema": {
        "type": "object",
        "properties": {
          "bountyId": {
            "type": "string",
            "description": "Bounty ID to convert to a pool"
          }
        },
        "required": [
          "bountyId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/pool/from-bounty/{bountyId}"
      }
    },
    {
      "name": "get_subnet_status",
      "description": "Get Bittensor verification subnet health, agent bridge status, and network connectivity.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/agents/status"
      }
    },
    {
      "name": "get_subnet_miners",
      "description": "List verification subnet miners on the Bittensor network. Returns miner addresses, scores, and leaderboard positions.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/verification/miners"
      }
    },
    {
      "name": "list_conversations",
      "description": "List agent-to-agent conversations showing topic, participants, message count, and status.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/agents/conversations"
      }
    },
    {
      "name": "submit_feedback",
      "description": "Submit a bug report, suggestion, or general feedback about the PCC network.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bug",
              "comment",
              "difficulty",
              "suggestion"
            ],
            "description": "Feedback type"
          },
          "message": {
            "type": "string",
            "description": "Feedback message (max 5000 chars)"
          },
          "page": {
            "type": "string",
            "description": "Page or feature the feedback relates to"
          }
        },
        "required": [
          "message"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/feedback"
      }
    },
    {
      "name": "report_anomaly",
      "description": "Report a detected anomaly — protocol failure, evidence mismatch, stuck job, or suspicious behavior. All agents on the network are notified.",
      "input_schema": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "description": "Anomaly severity"
          },
          "category": {
            "type": "string",
            "enum": [
              "protocol_failure",
              "evidence_mismatch",
              "consensus_failure",
              "timeout",
              "rate_anomaly",
              "trust_violation"
            ],
            "description": "Anomaly category"
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of what went wrong"
          },
          "targetAgentId": {
            "type": "string",
            "description": "Agent or kernel ID being reported (optional)"
          },
          "jobId": {
            "type": "string",
            "description": "Related job ID (optional)"
          }
        },
        "required": [
          "severity",
          "category",
          "description"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/anomaly/report"
      }
    },
    {
      "name": "get_unresolved_anomalies",
      "description": "List all unresolved anomalies on the network. Filter by severity, category, or target agent.",
      "input_schema": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "description": "Filter by severity: info, warning, critical"
          },
          "category": {
            "type": "string",
            "description": "Filter by category"
          },
          "targetId": {
            "type": "string",
            "description": "Filter by target agent/kernel ID"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/anomaly/unresolved"
      }
    },
    {
      "name": "get_agent_anomalies",
      "description": "Get anomalies involving a specific agent, plus their trust impact score.",
      "input_schema": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "description": "Agent or kernel ID"
          }
        },
        "required": [
          "agentId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/anomaly/by-agent/{agentId}"
      }
    },
    {
      "name": "resolve_anomaly",
      "description": "Mark an anomaly as resolved with a resolution note.",
      "input_schema": {
        "type": "object",
        "properties": {
          "anomalyId": {
            "type": "string",
            "description": "Anomaly ID to resolve"
          },
          "resolution": {
            "type": "string",
            "description": "How the anomaly was resolved"
          }
        },
        "required": [
          "anomalyId",
          "resolution"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/anomaly/{anomalyId}/resolve"
      }
    },
    {
      "name": "get_anomaly_stats",
      "description": "Get aggregate anomaly statistics — total, unresolved, by severity, by category.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/anomaly/stats"
      }
    },
    {
      "name": "report_protocol_failure",
      "description": "Report a protocol failure — when a step in the evidence/escrow/verification pipeline breaks. System may auto-recover.",
      "input_schema": {
        "type": "object",
        "properties": {
          "protocol": {
            "type": "string",
            "description": "Which protocol failed: evidence_submission, escrow_release, verification_consensus, settlement"
          },
          "errorCode": {
            "type": "string",
            "description": "Error code"
          },
          "errorMessage": {
            "type": "string",
            "description": "Error description"
          },
          "involvedAgents": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Agent IDs involved"
          },
          "jobId": {
            "type": "string",
            "description": "Related job ID"
          },
          "recoveryAction": {
            "type": "string",
            "enum": [
              "retry",
              "escalate",
              "rollback",
              "ignore"
            ],
            "description": "Suggested recovery"
          }
        },
        "required": [
          "protocol",
          "errorCode",
          "errorMessage",
          "involvedAgents"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/anomaly/protocol-failure"
      }
    },
    {
      "name": "pcc_dht_query",
      "description": "Query the DHT for capabilities matching your requirements. Returns announcements from operators whose equipment matches the type, materials, and price range you specify.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Capability type to search for (e.g. 'fdm_print', 'liquid-handler', 'cnc-3axis')"
          },
          "materials": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Materials you need (matches if operator supports ANY of these)"
          },
          "maxPrice": {
            "type": "number",
            "description": "Maximum price per job — matches operators whose min price is at or below this"
          },
          "limit": {
            "type": "number",
            "description": "Maximum results to return (default 10)"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/dht/query"
      }
    },
    {
      "name": "pcc_dht_announce",
      "description": "Announce capabilities to the DHT network. Signs the announcement with your node's Ed25519 key and broadcasts to connected peers.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID announcing capabilities"
          },
          "capabilities": {
            "type": "array",
            "description": "Array of capability summaries to announce",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Capability type"
                },
                "materials": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "priceRange": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    }
                  }
                },
                "queueDepth": {
                  "type": "number"
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "ttlSeconds": {
            "type": "number",
            "description": "How long the announcement is valid (default 300)"
          }
        },
        "required": [
          "kernelId",
          "capabilities"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/dht/announce"
      }
    },
    {
      "name": "pcc_dht_peers",
      "description": "List known DHT peers and their connection status. Shows which nodes are currently connected to the gossip network.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/dht/peers"
      }
    },
    {
      "name": "pcc_create_scope",
      "description": "Create an execution scope for a job. Scopes define exactly which tool calls are allowed on a kernel during a job, with command budgets, retry limits, and time-to-live. Required before issuing SCOPED WRITE operations (protocol upload, run create, run action).",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to create the scope for"
          },
          "jobId": {
            "type": "string",
            "description": "Job ID this scope is bound to (optional)"
          },
          "allowedTools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of tool names allowed in this scope (e.g. ['ot2_protocol_upload', 'ot2_run_create', 'ot2_run_action'])"
          },
          "allowedPipettes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which pipettes may be used (e.g. ['left'])"
          },
          "allowedSlots": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "Which deck slots may be accessed (e.g. [1, 2, 3, 9])"
          },
          "maxCommands": {
            "type": "number",
            "description": "Maximum tool calls allowed in this scope (default 100)"
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum retries allowed (default 3)"
          },
          "ttlMinutes": {
            "type": "number",
            "description": "Scope duration in minutes (default 30)"
          },
          "protocolHash": {
            "type": "string",
            "description": "SHA-256 hash of the approved protocol content. If set, protocol uploads are hash-verified."
          }
        },
        "required": [
          "kernelId",
          "allowedTools"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ot2/scope"
      }
    },
    {
      "name": "pcc_revoke_scope",
      "description": "Revoke an execution scope immediately (emergency stop). All pending tool calls under this scope are rejected. The kernel enters a stopped state. A new scope must be created to resume.",
      "input_schema": {
        "type": "object",
        "properties": {
          "scopeId": {
            "type": "string",
            "description": "Scope ID to revoke"
          }
        },
        "required": [
          "scopeId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ot2/scope/{scopeId}/revoke"
      }
    },
    {
      "name": "pcc_scope_audit",
      "description": "Get the audit trail for an execution scope — every tool call made under this scope, with validation results, timestamps, and outcomes.",
      "input_schema": {
        "type": "object",
        "properties": {
          "scopeId": {
            "type": "string",
            "description": "Scope ID to audit"
          }
        },
        "required": [
          "scopeId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ot2/scope/{scopeId}/audit"
      }
    },
    {
      "name": "pcc_relay_tool_call",
      "description": "Relay a tool call to a device executor. The brain (LLM) posts tool calls here; the executor (on the device) polls for them and executes locally. Used for the brain/executor split architecture.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID of the target device"
          },
          "toolName": {
            "type": "string",
            "description": "Tool to execute (e.g. 'ot2_health', 'ot2_run_create')"
          },
          "toolArgs": {
            "type": "object",
            "description": "Arguments for the tool call"
          },
          "scopeId": {
            "type": "string",
            "description": "Execution scope ID (required for SCOPED WRITE tools)"
          }
        },
        "required": [
          "kernelId",
          "toolName",
          "toolArgs"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ot2/tool-call"
      }
    },
    {
      "name": "pcc_get_tool_result",
      "description": "Get the result of a previously relayed tool call. Poll this endpoint until the executor has processed the call and posted results.",
      "input_schema": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string",
            "description": "Tool call ID returned from pcc_relay_tool_call"
          }
        },
        "required": [
          "callId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ot2/tool-result/{callId}"
      }
    },
    {
      "name": "pcc_camera_latest",
      "description": "Get the latest camera frame from a kernel as a JSON snapshot (base64 JPEG + metadata). For raw JPEG image, use GET /api/ot2/camera/latest directly.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to get camera frame from"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ot2/camera/snapshot"
      }
    },
    {
      "name": "pcc_chat_send",
      "description": "Send a chat message to a kernel's operator or agent. Used for human-in-the-loop communication during job execution, troubleshooting, and escalation.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to send the message to"
          },
          "message": {
            "type": "string",
            "description": "Message content"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "agent",
              "operator",
              "system"
            ],
            "description": "Sender role (default: user)"
          }
        },
        "required": [
          "kernelId",
          "message"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/ot2/chat"
      }
    },
    {
      "name": "pcc_chat_history",
      "description": "Get chat history with a kernel. Returns messages between agents, operators, and users for a specific kernel.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to get chat history for"
          },
          "limit": {
            "type": "number",
            "description": "Maximum messages to return (default 50)"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/ot2/chat/messages"
      }
    },
    {
      "name": "approve_registration",
      "description": "Approve a submitted machine registration. Moves it from 'submitted' to 'approved' status, enabling the operator to activate and start accepting jobs.",
      "input_schema": {
        "type": "object",
        "properties": {
          "registrationId": {
            "type": "string",
            "description": "Registration ID (e.g. 'reg-1234567890')"
          }
        },
        "required": [
          "registrationId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/registrations/{registrationId}/approve"
      }
    },
    {
      "name": "reject_registration",
      "description": "Reject a machine registration with a reason. The operator can see the rejection reason and resubmit.",
      "input_schema": {
        "type": "object",
        "properties": {
          "registrationId": {
            "type": "string",
            "description": "Registration ID"
          },
          "reason": {
            "type": "string",
            "description": "Reason for rejection"
          }
        },
        "required": [
          "registrationId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/registrations/{registrationId}/reject"
      }
    },
    {
      "name": "activate_registration",
      "description": "Activate an approved registration, making the operator's equipment live on the network and ready to accept jobs.",
      "input_schema": {
        "type": "object",
        "properties": {
          "registrationId": {
            "type": "string",
            "description": "Registration ID"
          }
        },
        "required": [
          "registrationId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/registrations/{registrationId}/activate"
      }
    },
    {
      "name": "prove_registration",
      "description": "Fast-track: submit evidence that your device works and get auto-approved + activated immediately. No manual review needed. Submit a photo of test output, device health snapshot, or a full evidence bundle with completion events. If evidence meets requirements, registration jumps straight to 'active'.",
      "input_schema": {
        "type": "object",
        "properties": {
          "registrationId": {
            "type": "string",
            "description": "Registration ID to prove"
          },
          "evidence": {
            "type": "object",
            "description": "Evidence proving the device works. Include at least one of: bundleHash+events, photoBase64, or deviceHealth.",
            "properties": {
              "bundleHash": {
                "type": "string",
                "description": "SHA-256 hash of the evidence bundle"
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Event type: execution_completed, camera_snapshot, power_profile_summary, etc."
                    },
                    "timestamp": {
                      "type": "string",
                      "description": "ISO timestamp"
                    },
                    "payload": {
                      "type": "object",
                      "description": "Event data"
                    }
                  }
                },
                "description": "Evidence events from a test job"
              },
              "photoBase64": {
                "type": "string",
                "description": "Base64-encoded photo of test output (printed page, machined part, etc.)"
              },
              "deviceHealth": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "Device status (e.g. 'idle', 'ready')"
                  },
                  "model": {
                    "type": "string",
                    "description": "Device model name"
                  },
                  "firmware": {
                    "type": "string",
                    "description": "Firmware version"
                  }
                },
                "description": "Live device health snapshot"
              },
              "ipfsCid": {
                "type": "string",
                "description": "IPFS CID if evidence was already uploaded"
              }
            }
          }
        },
        "required": [
          "registrationId",
          "evidence"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/registrations/{registrationId}/prove"
      }
    },
    {
      "name": "list_registrations",
      "description": "List all machine registrations on the network. See pending, approved, active, and rejected registrations. Public endpoint — no auth required.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/onboard/registrations"
      }
    },
    {
      "name": "get_registration",
      "description": "Get details of a specific machine registration by ID, including capabilities, pricing, operator info, and current status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "registrationId": {
            "type": "string",
            "description": "Registration ID"
          }
        },
        "required": [
          "registrationId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/onboard/registrations/{registrationId}"
      }
    },
    {
      "name": "near_status",
      "description": "Get NEAR Protocol chain-abstraction integration status. Returns supported chains (near, eth, base, arbitrum, optimism, polygon), supported assets (USDC, USDT, NEAR, ETH, WBTC), and capability flags. Use this to confirm cross-chain settlement is available before requesting quotes.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/near/status"
      }
    },
    {
      "name": "near_quote",
      "description": "Get a cross-chain payment quote from the NEAR 1Click solver network (chaindefuser.com). Provides optimal routing and fee estimates for funding PCC escrow contracts using any source asset on any supported chain. Call near_status first to confirm available chains/assets.",
      "input_schema": {
        "type": "object",
        "properties": {
          "fromChain": {
            "type": "string",
            "description": "Source chain (e.g. 'eth', 'base', 'near', 'arbitrum')"
          },
          "fromAsset": {
            "type": "string",
            "description": "Source asset symbol (e.g. 'USDC', 'ETH', 'NEAR')"
          },
          "toChain": {
            "type": "string",
            "description": "Destination chain (e.g. 'base', 'eth')"
          },
          "toAsset": {
            "type": "string",
            "description": "Destination asset symbol (e.g. 'USDC')"
          },
          "amount": {
            "type": "string",
            "description": "Amount as an integer string in the smallest denomination (e.g. '1000000' for 1 USDC with 6 decimals)"
          },
          "recipient": {
            "type": "string",
            "description": "Recipient address on the destination chain (optional)"
          }
        },
        "required": [
          "fromChain",
          "fromAsset",
          "toChain",
          "toAsset",
          "amount"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/near/quote"
      }
    },
    {
      "name": "near_intent",
      "description": "Submit a cross-chain payment intent to the NEAR 1Click solver network. Creates a signed intent that routes the payment atomically across chains. Call near_quote first to obtain a quoteId. Intents typically settle within 30-60 seconds — poll near_intent_status to track progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string",
            "description": "Quote ID returned from near_quote"
          },
          "workflowId": {
            "type": "string",
            "description": "PCC workflow or job ID this payment is for"
          },
          "recipient": {
            "type": "string",
            "description": "Recipient address on the destination chain (optional)"
          }
        },
        "required": [
          "quoteId",
          "workflowId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/near/intent"
      }
    },
    {
      "name": "near_intent_status",
      "description": "Check the settlement status of a submitted NEAR 1Click cross-chain payment intent. Statuses progress: pending → submitted → settled | failed. Returns txHash and explorerUrl when settled.",
      "input_schema": {
        "type": "object",
        "properties": {
          "intentId": {
            "type": "string",
            "description": "Intent ID returned from near_intent"
          }
        },
        "required": [
          "intentId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/near/intent/{intentId}"
      }
    },
    {
      "name": "protocol_state",
      "description": "Read the PCCProtocol root contract state: current fee rate, total protocol fees collected, total escrow count, and registry addresses. Requires PCC_PROTOCOL_ADDRESS to be configured on the gateway.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol/state"
      }
    },
    {
      "name": "protocol_fee",
      "description": "Calculate the protocol fee for a given USDC amount (6-decimal units). Returns the fee, the net amount after fee, and formatted versions of both. Use this before building escrow contracts to understand the true cost.",
      "input_schema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount as a BigInt string in USDC 6-decimal units (e.g. '1000000000' = 1000 USDC)"
          }
        },
        "required": [
          "amount"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol/fee/{amount}"
      }
    },
    {
      "name": "protocol_token_fees",
      "description": "Get total protocol fees collected for a specific ERC-20 token address across all escrows. Returns raw wei amount and human-readable formatted value.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tokenAddress": {
            "type": "string",
            "description": "ERC-20 token contract address (0x...)"
          }
        },
        "required": [
          "tokenAddress"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol/token/{tokenAddress}/fees"
      }
    },
    {
      "name": "protocol_escrow_fees",
      "description": "Get protocol fees collected from a specific escrow contract. Also returns whether the escrow was deployed via the protocol factory. Useful for auditing fee flows.",
      "input_schema": {
        "type": "object",
        "properties": {
          "escrowAddress": {
            "type": "string",
            "description": "Escrow contract address (0x...)"
          }
        },
        "required": [
          "escrowAddress"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol/escrow/{escrowAddress}/fees"
      }
    },
    {
      "name": "protocol_create_escrow",
      "description": "Create a new MilestoneEscrow contract via the PCCProtocol factory on-chain. Protocol-deployed escrows have fee collection and registry tracking built in. Requires PCC_GATEWAY_PRIVATE_KEY write access.",
      "input_schema": {
        "type": "object",
        "properties": {
          "payer": {
            "type": "string",
            "description": "Payer EVM address (0x...)"
          },
          "arbiter": {
            "type": "string",
            "description": "Arbiter EVM address (0x...) — resolves disputes"
          },
          "token": {
            "type": "string",
            "description": "ERC-20 token address for payment (0x...)"
          },
          "cwmId": {
            "type": "string",
            "description": "Capability Work Module ID as a 32-byte hex string (0x + 64 chars)"
          }
        },
        "required": [
          "payer",
          "arbiter",
          "token",
          "cwmId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/protocol/create-escrow"
      }
    },
    {
      "name": "pcc_dht_metrics",
      "description": "Get a snapshot of DHT telemetry counters and recent events. Returns message counts, peer connection stats, query/announce rates, and a list of the last 50 metric events. Use for monitoring network health.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/dht/metrics"
      }
    },
    {
      "name": "marketplace_categories",
      "description": "List all supplies and materials marketplace categories with the count of active listings in each. Categories cover the full spectrum of physical production inputs: raw metals, plastics, lab reagents, consumables, electronics, tooling, and more.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/categories"
      }
    },
    {
      "name": "marketplace_list_listings",
      "description": "Search and filter supplies/materials marketplace listings. Operators buy raw materials here to fulfill capability contracts. Filter by category, in-stock status, location, or free-text query.",
      "input_schema": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "description": "Filter by category: raw-metals, plastics-polymers, lab-reagents, lab-consumables, electronics, chemicals, biologicals, tooling, packaging, calibration, safety, other"
          },
          "query": {
            "type": "string",
            "description": "Full-text search across name, description, and tags"
          },
          "inStock": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "description": "Filter to only in-stock listings"
          },
          "location": {
            "type": "string",
            "description": "Filter by region (e.g. 'US-Midwest', 'EU-West', 'Asia-Pacific')"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/listings"
      }
    },
    {
      "name": "marketplace_get_listing",
      "description": "Get full details of a specific supplies/materials marketplace listing by ID. Returns pricing, availability, lead time, location, and tags.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Listing ID (e.g. 'lst-al6061-bar')"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/listings/{id}"
      }
    },
    {
      "name": "marketplace_create_listing",
      "description": "Create a new supplies/materials listing in the marketplace. Suppliers post available raw materials, lab reagents, tooling, or consumables for other operators to purchase.",
      "input_schema": {
        "type": "object",
        "properties": {
          "sellerId": {
            "type": "string",
            "description": "Supplier entity ID"
          },
          "category": {
            "type": "string",
            "description": "Category: raw-metals, plastics-polymers, lab-reagents, lab-consumables, electronics, chemicals, biologicals, tooling, packaging, calibration, safety, other"
          },
          "name": {
            "type": "string",
            "description": "Product name"
          },
          "description": {
            "type": "string",
            "description": "Detailed product description"
          },
          "unit": {
            "type": "string",
            "description": "Unit of sale: kg, L, each, box, plate, etc."
          },
          "pricePerUnit": {
            "type": "number",
            "description": "Price per unit in USDC"
          },
          "minOrder": {
            "type": "number",
            "description": "Minimum order quantity"
          },
          "maxOrder": {
            "type": "number",
            "description": "Maximum order quantity"
          },
          "inStock": {
            "type": "boolean",
            "description": "Whether the item is currently available"
          },
          "leadTimeDays": {
            "type": "number",
            "description": "Estimated lead time in business days"
          },
          "location": {
            "type": "string",
            "description": "Supplier region or country"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Search tags"
          }
        },
        "required": [
          "category",
          "name",
          "pricePerUnit",
          "unit"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/marketplace/listings"
      }
    },
    {
      "name": "marketplace_update_listing",
      "description": "Update an existing supplies/materials listing (price, stock status, description, etc.). Pass only the fields you want to change.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Listing ID to update"
          },
          "pricePerUnit": {
            "type": "number",
            "description": "New price per unit in USDC"
          },
          "inStock": {
            "type": "boolean",
            "description": "Stock availability"
          },
          "description": {
            "type": "string",
            "description": "Updated description"
          },
          "leadTimeDays": {
            "type": "number",
            "description": "Updated lead time in days"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Updated search tags"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "PUT",
        "path": "/api/marketplace/listings/{id}"
      }
    },
    {
      "name": "marketplace_delete_listing",
      "description": "Remove a supplies/materials listing from the marketplace. The listing is immediately hidden from search results.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Listing ID to remove"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "DELETE",
        "path": "/api/marketplace/listings/{id}"
      }
    },
    {
      "name": "marketplace_place_order",
      "description": "Place a purchase order for supplies or materials. Calculates total price automatically (quantity × pricePerUnit). Returns an order with 'pending' status. Optionally links to an on-chain escrow for trustless settlement.",
      "input_schema": {
        "type": "object",
        "properties": {
          "listingId": {
            "type": "string",
            "description": "Listing ID to order from"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity to order (must meet listing minOrder/maxOrder)"
          },
          "buyerId": {
            "type": "string",
            "description": "Buyer entity ID (operator kernel ID, etc.)"
          },
          "escrowAddress": {
            "type": "string",
            "description": "Optional on-chain escrow address for trustless settlement"
          }
        },
        "required": [
          "listingId",
          "quantity"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/marketplace/orders"
      }
    },
    {
      "name": "marketplace_list_orders",
      "description": "List marketplace supply orders. Filter by buyerId, sellerId, or status. Returns order history with pricing and status.",
      "input_schema": {
        "type": "object",
        "properties": {
          "buyerId": {
            "type": "string",
            "description": "Filter to orders placed by this buyer"
          },
          "sellerId": {
            "type": "string",
            "description": "Filter to orders received by this seller"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "shipped",
              "delivered",
              "cancelled"
            ],
            "description": "Filter by order status"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/orders"
      }
    },
    {
      "name": "marketplace_get_order",
      "description": "Get details of a specific supply order including the associated listing details, quantity, total price, status, and optional escrow address.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Order ID (e.g. 'ord-demo-001')"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/marketplace/orders/{id}"
      }
    },
    {
      "name": "system_telemetry",
      "description": "Raw system state dump — actual DB rows for kernels, devices, jobs, evidence, registrations, capabilities, agent conversations, audit log. No fake numbers, no summaries.",
      "input_schema": {
        "type": "object",
        "properties": {}
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/telemetry/system"
      }
    },
    {
      "name": "operator_poll_jobs",
      "description": "Operator polls for pending jobs assigned to their kernel. Returns queued jobs ready for execution. Used by pcc-node daemon.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to poll jobs for"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator/jobs"
      }
    },
    {
      "name": "operator_push_evidence",
      "description": "Operator pushes evidence bundle from a completed job execution. Contains device ID, execution timestamp, result payload, and event timeline.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "kernelId": {
            "type": "string"
          },
          "evidence": {
            "type": "object"
          }
        },
        "required": [
          "jobId",
          "kernelId",
          "evidence"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/evidence"
      }
    },
    {
      "name": "operator_heartbeat",
      "description": "Operator sends heartbeat with capability re-announcement. Keeps the kernel alive on the network and updates available capabilities.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/heartbeat"
      }
    },
    {
      "name": "operator_update_job_status",
      "description": "Operator updates job status during execution (running, completed, failed). Called by pcc-node as jobs progress.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "kernelId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "completed",
              "failed"
            ]
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": [
          "jobId",
          "kernelId",
          "status"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/job-status"
      }
    },
    {
      "name": "pcc_submit_paid_job",
      "description": "Fast-track paid job: one call from DHT discovery to funded escrow + active scope. Auto-negotiates, quotes, creates escrow with milestones, creates execution scope. Returns jobId, scopeId, escrowId, quote with pricing adjustments, contract terms. For testnet, escrow is mock-funded automatically.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Target kernel ID (from DHT query)"
          },
          "capabilityType": {
            "type": "string",
            "description": "e.g. 'liquid-handler', 'fdm', 'cnc-3axis'"
          },
          "parameters": {
            "type": "object",
            "description": "Job parameters (protocolType, volume, materials, etc.)"
          },
          "paymentMethod": {
            "type": "string",
            "enum": [
              "escrow",
              "testnet-mock"
            ],
            "description": "Payment method (testnet-mock for demo)"
          },
          "userAgentId": {
            "type": "string",
            "description": "Your agent/user ID"
          }
        },
        "required": [
          "kernelId",
          "capabilityType",
          "userAgentId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/jobs/submit-from-discovery"
      }
    },
    {
      "name": "pcc_job_complete",
      "description": "Complete a job: gathers tool call audit trail from execution scopes, builds evidence bundle with SHA-256 hash, stores evidence, revokes scopes, and settles escrow (mock or real).",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID to complete"
          },
          "message": {
            "type": "string",
            "description": "Completion message or notes"
          }
        },
        "required": [
          "jobId"
        ]
      },
      "endpoint": {
        "method": "PUT",
        "path": "/api/jobs/{jobId}/complete"
      }
    },
    {
      "name": "pcc_job_settlement",
      "description": "Get settlement status for a completed job: escrow address, evidence hash, milestones with amounts and status, paid amount, currency, and linked negotiation session.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Job ID"
          }
        },
        "required": [
          "jobId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/jobs/{jobId}/settlement"
      }
    },
    {
      "name": "pcc_get_tool_manifest",
      "description": "Get the tool manifest for a kernel's device type. Lists all available tools with their safety classification (read, safe_control, scoped_write, privileged) and input schemas. Use to understand what tools are available before making tool calls.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/relay/{kernelId}/manifest"
      }
    },
    {
      "name": "pcc_relay_generic_tool_call",
      "description": "Relay a tool call to any kernel's device executor via the generic relay (not OT-2 specific). Works with any device type. Safe tools (read/safe_control) don't need a scope. Scoped write tools require an active execution scope. Returns a call ID — poll pcc_get_tool_result for the response.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Target kernel ID"
          },
          "toolName": {
            "type": "string",
            "description": "Tool name from the device manifest"
          },
          "args": {
            "type": "object",
            "description": "Tool arguments"
          },
          "scopeId": {
            "type": "string",
            "description": "Execution scope ID (required for write operations)"
          }
        },
        "required": [
          "kernelId",
          "toolName"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/relay/{kernelId}/tool-call"
      }
    },
    {
      "name": "pcc_submit_request",
      "description": "Submit a high-level capability request in natural language. The system automatically decomposes it into a capability DAG with dependencies, timelines, and budget allocation across fabrication, design, assembly, electronics, software, logistics, and verification nodes. Returns the request with full decomposed DAG. Example: 'Build a cute animatronic plush desk robot with servo-driven animations'.",
      "input_schema": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Short title for the request"
          },
          "description": {
            "type": "string",
            "description": "Full natural language description of what needs to be built or done"
          },
          "budget": {
            "type": "number",
            "description": "Total budget in USDC (default: 1000)"
          },
          "deadline": {
            "type": "string",
            "description": "ISO 8601 deadline (default: 7 days from now)"
          },
          "urgency": {
            "type": "string",
            "enum": [
              "standard",
              "rush",
              "emergency"
            ],
            "description": "Urgency level — affects cost multipliers (emergency: 2x cost, 0.5x time)"
          },
          "currency": {
            "type": "string",
            "description": "Currency (default: USDC)"
          },
          "requesterEmail": {
            "type": "string",
            "description": "Requester email for notifications"
          },
          "requesterWallet": {
            "type": "string",
            "description": "Requester wallet address for payments"
          }
        },
        "required": [
          "title",
          "description"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/requests"
      }
    },
    {
      "name": "pcc_list_requests",
      "description": "List all capability requests with optional filtering. Shows status, decomposed DAG summary, estimated costs, and timelines.",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "decomposing",
              "published",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "description": "Filter by status"
          },
          "urgency": {
            "type": "string",
            "enum": [
              "standard",
              "rush",
              "emergency"
            ],
            "description": "Filter by urgency"
          },
          "requesterEmail": {
            "type": "string",
            "description": "Filter by requester email"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/requests"
      }
    },
    {
      "name": "pcc_get_request",
      "description": "Get a capability request by ID with the full decomposed DAG — all capability nodes, their dependencies, estimated costs/hours, assigned operators, and linked bounty IDs.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/requests/{requestId}"
      }
    },
    {
      "name": "pcc_decompose_request",
      "description": "Re-trigger decomposition of an existing capability request. Overwrites the existing capability DAG with a fresh decomposition. Useful after updating the description or budget.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID to decompose"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/requests/{requestId}/decompose"
      }
    },
    {
      "name": "pcc_publish_request",
      "description": "Publish all pending capability nodes in a request as bounties. Each node becomes a bidding opportunity for operators. Returns the list of created bounty IDs linked to each capability node.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID to publish"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/requests/{requestId}/publish"
      }
    },
    {
      "name": "pcc_get_request_dag",
      "description": "Get the capability DAG (directed acyclic graph) for a request as adjacency data — nodes with all fields plus explicit edges showing dependency relationships. Useful for visualization or workflow planning.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/requests/{requestId}/dag"
      }
    },
    {
      "name": "pcc_get_request_critical_path",
      "description": "Get the critical path (longest dependency chain) for a capability request. The critical path determines the minimum calendar time to complete the request. Returns node IDs in order, the full node details, and total hours on the critical path.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/requests/{requestId}/critical-path"
      }
    },
    {
      "name": "pcc_assign_node_operator",
      "description": "Assign an operator to a specific capability node within a request. The node status changes to 'assigned'. Operators claim nodes to indicate they will execute that capability.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          },
          "nodeId": {
            "type": "string",
            "description": "Capability node ID"
          },
          "operatorId": {
            "type": "string",
            "description": "Operator kernel ID or wallet address"
          }
        },
        "required": [
          "requestId",
          "nodeId",
          "operatorId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/requests/{requestId}/nodes/{nodeId}/assign"
      }
    },
    {
      "name": "pcc_update_node_status",
      "description": "Update the status of a capability node within a request. Valid transitions: pending → bidding → assigned → in_progress → completed (or failed). When all nodes complete, the request automatically moves to completed.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          },
          "nodeId": {
            "type": "string",
            "description": "Capability node ID"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "bidding",
              "assigned",
              "in_progress",
              "completed",
              "failed"
            ],
            "description": "New status for the node"
          }
        },
        "required": [
          "requestId",
          "nodeId",
          "status"
        ]
      },
      "endpoint": {
        "method": "PUT",
        "path": "/api/requests/{requestId}/nodes/{nodeId}/status"
      }
    },
    {
      "name": "pcc_update_request",
      "description": "Update a capability request's title, description, budget, deadline, urgency, or contact info. Does not re-decompose — call pcc_decompose_request afterwards if you want a fresh DAG.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "budget": {
            "type": "number"
          },
          "deadline": {
            "type": "string"
          },
          "urgency": {
            "type": "string",
            "enum": [
              "standard",
              "rush",
              "emergency"
            ]
          },
          "requesterEmail": {
            "type": "string"
          },
          "requesterWallet": {
            "type": "string"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "PUT",
        "path": "/api/requests/{requestId}"
      }
    },
    {
      "name": "pcc_cancel_request",
      "description": "Cancel a capability request. Cancelled requests cannot be updated, decomposed, or published. This is a soft delete — the request remains visible with status 'cancelled'.",
      "input_schema": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID to cancel"
          }
        },
        "required": [
          "requestId"
        ]
      },
      "endpoint": {
        "method": "DELETE",
        "path": "/api/requests/{requestId}"
      }
    },
    {
      "name": "pcc_generate_ui",
      "description": "Generate a dynamic visual interface and serve it locally via pcc-node's UI server (localhost:3200). Supports built-in templates (plate-layout, protocol-builder, job-status, camera-viewer, device-config) or custom HTML. The UI appears in the operator's browser. Form submissions are queued for the agent to read via pcc_get_ui_submissions.",
      "input_schema": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "description": "Built-in template name or 'custom'"
          },
          "filename": {
            "type": "string",
            "description": "Output filename (e.g. 'my-form.html')"
          },
          "content": {
            "type": "string",
            "description": "Custom HTML content (when template='custom')"
          },
          "title": {
            "type": "string",
            "description": "UI title"
          }
        },
        "required": [
          "template"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "http://localhost:3200/api/generate"
      }
    },
    {
      "name": "pcc_oracle_status",
      "description": "Check if the PCC verification oracle is online. Returns the oracle's EIP-712 signing address and chain ID. The oracle is required for all escrow settlements — no attestation means no fund release.",
      "input_schema": {
        "type": "object",
        "properties": {}
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/oracle/health"
      }
    },
    {
      "name": "pcc_oracle_verify",
      "description": "Submit evidence for oracle verification. The oracle checks: evidence exists, hash matches, tier requirements met, no replay, operator identity valid. Returns a signed EIP-712 attestation that the escrow contract requires to release funds. This is the critical path — every settlement flows through this endpoint.",
      "input_schema": {
        "type": "object",
        "properties": {
          "escrowAddress": {
            "type": "string",
            "description": "Escrow contract address"
          },
          "jobId": {
            "type": "string",
            "description": "PCC job ID"
          },
          "kernelId": {
            "type": "string",
            "description": "Operator kernel ID"
          },
          "evidenceHash": {
            "type": "string",
            "description": "SHA-256 hash of evidence bundle"
          },
          "assuranceTier": {
            "type": "integer",
            "enum": [
              0,
              1,
              2,
              3
            ],
            "description": "Evidence tier (0=none, 1=basic, 2=full, 3=ZK)"
          }
        },
        "required": [
          "escrowAddress",
          "jobId",
          "kernelId",
          "evidenceHash"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/oracle/verify"
      }
    },
    {
      "name": "pcc_protocol_fee",
      "description": "Get the current protocol fee rate (2.35%, immutable) and fee recipient address. The fee is hardcoded in the PCCProtocol smart contract — no admin, no governance, no upgrade can change it.",
      "input_schema": {
        "type": "object",
        "properties": {}
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/protocol/fee"
      }
    },
    {
      "name": "create_capability",
      "description": "Register a capability instance for a kernel. Required before submitting jobs — the gateway needs at least one capability per kernel. Creates a liquid-handler, fdm, cnc-3axis, or other capability type.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID to register capability for"
          },
          "type": {
            "type": "string",
            "description": "Capability type (e.g. liquid-handler, fdm, cnc-3axis, laser-cut, document-printing)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable name for the capability"
          },
          "description": {
            "type": "string",
            "description": "Description of what this capability does"
          }
        },
        "required": [
          "kernelId",
          "type"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/capabilities"
      }
    },
    {
      "name": "kernel_heartbeat",
      "description": "Send a per-kernel heartbeat to keep the kernel marked online. Used by pcc-node daemons as an alternative to the operator relay heartbeat.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          },
          "status": {
            "type": "string",
            "description": "Kernel status (online/offline)",
            "default": "online"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Optional capability announcements"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/kernels/{kernelId}/heartbeat"
      }
    },
    {
      "name": "kernel_announce_capabilities",
      "description": "Announce capabilities for a kernel. Used by pcc-node daemons after hardware detection to register what the kernel can do.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Capability objects to announce"
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Device IDs that back these capabilities"
          },
          "signature": {
            "type": "string",
            "description": "Ed25519 signature of the announcement"
          }
        },
        "required": [
          "kernelId",
          "capabilities"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/kernels/{kernelId}/capabilities"
      }
    },
    {
      "name": "send_diagnostics",
      "description": "Upload an encrypted diagnostic bundle when the operator's node has problems. The bundle is encrypted client-side with a retrieval code the operator must share with support before logs can be read. Use this when the operator reports errors, crashes, or misbehavior. The pcc-node CLI runs `pcc-node logs --send` locally to collect+encrypt; prefer that path when available. This tool is for agent-driven uploads when the bundle is already prepared.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Kernel ID the diagnostics came from"
          },
          "encrypted": {
            "type": "object",
            "description": "Encrypted bundle payload",
            "properties": {
              "ciphertext_b64": {
                "type": "string"
              },
              "iv_b64": {
                "type": "string"
              },
              "salt_b64": {
                "type": "string"
              },
              "tag_b64": {
                "type": "string"
              }
            },
            "required": [
              "ciphertext_b64",
              "iv_b64",
              "salt_b64",
              "tag_b64"
            ]
          },
          "bundleHash": {
            "type": "string",
            "description": "sha256 of plaintext bundle"
          },
          "bundleSize": {
            "type": "number",
            "description": "Size of encrypted payload in bytes"
          },
          "logLineCount": {
            "type": "number",
            "description": "How many log lines are in the bundle"
          },
          "systemPlatform": {
            "type": "string",
            "description": "e.g. Linux-5.15, Darwin-23, Windows-10"
          },
          "collectedAt": {
            "type": "string",
            "description": "ISO timestamp when bundle was collected"
          }
        },
        "required": [
          "kernelId",
          "encrypted"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/diagnostics"
      }
    },
    {
      "name": "send_support_message",
      "description": "Send an operator support message to the PCC team. Creates a new support thread or appends to the operator's existing open thread. Can optionally attach a diagnostic retrieval code (from send_diagnostics) so support staff can decrypt logs. Discord webhook fires on every new message, so expect fast response. Use this whenever the operator says something is broken, confusing, or not behaving as expected.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Operator's kernel ID"
          },
          "kernelName": {
            "type": "string",
            "description": "Human-readable kernel name"
          },
          "message": {
            "type": "string",
            "description": "The support message text — describe the problem concretely"
          },
          "subject": {
            "type": "string",
            "description": "Optional thread subject (auto-generated from message if omitted)"
          },
          "retrievalCode": {
            "type": "string",
            "description": "Optional diagnostic retrieval code to attach (from send_diagnostics)"
          },
          "systemInfo": {
            "type": "object",
            "description": "Optional system context (platform, nodeVersion, daemonRunning, gatewayReachable)"
          }
        },
        "required": [
          "kernelId",
          "message"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/support"
      }
    },
    {
      "name": "check_support_replies",
      "description": "Check for admin replies on the operator's support threads. Call this periodically or when the operator asks 'did they respond yet?'. Returns all threads for this kernel and a hasUnreadReplies boolean indicating new admin messages.",
      "input_schema": {
        "type": "object",
        "properties": {
          "kernelId": {
            "type": "string",
            "description": "Operator's kernel ID"
          }
        },
        "required": [
          "kernelId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operator/support/mine"
      }
    },
    {
      "name": "reply_to_support_thread",
      "description": "Reply to an existing support thread. Use when the operator wants to add information to a thread started earlier. Needs the threadId from check_support_replies or the original send_support_message response.",
      "input_schema": {
        "type": "object",
        "properties": {
          "threadId": {
            "type": "string",
            "description": "Thread ID to reply to"
          },
          "message": {
            "type": "string",
            "description": "Reply message"
          },
          "retrievalCode": {
            "type": "string",
            "description": "Optional diagnostic retrieval code to attach"
          }
        },
        "required": [
          "threadId",
          "message"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operator/support/{threadId}/reply"
      }
    },
    {
      "name": "pcc_capture_challenge",
      "description": "Issue a fresh block-anchored CaptureNonceChallenge for a job. The operator's device must render this nonce into the captured media (QR code, audio tone, etc.) before calling pcc_capture_upload. The nonce is derived from (challengeId, latest blockHash, workOutputRoot) so captures cannot be pre-computed. Returns challengeId, 64-char hex nonce, blockNumber, maxAgeSeconds (clamped to 120).",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "PCC job ID the capture belongs to"
          },
          "declaredClass": {
            "type": "string",
            "enum": [
              "CC0",
              "CC1",
              "CC2",
              "CC3",
              "CC4",
              "CC5"
            ],
            "description": "Capture class the operator plans to claim. Determines which gates the verifier will run."
          },
          "requestedTtlSeconds": {
            "type": "integer",
            "description": "Requested challenge lifetime in seconds. Clamped to 120 server-side."
          }
        },
        "required": [
          "jobId",
          "declaredClass"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/capture/challenge"
      }
    },
    {
      "name": "pcc_capture_upload",
      "description": "Upload a capture (photo / video / audio / sensor clip) with its CaptureManifest for G1..G6 verification. Bytes are base64-encoded inline; optional base64 C2PA manifest bytes can be supplied for CC3+ claims. The server runs the 6-gate CaptureVerifier and persists a PASS/PARTIAL/FAIL verdict. Returns {verdictId, verdict, verifiedClass, gatesPassed, gatesFailed, warnings, anchorCandidate, captureHash, manifestHash}.",
      "input_schema": {
        "type": "object",
        "properties": {
          "manifest": {
            "type": "object",
            "description": "CaptureManifest — ALCOA+-ready metadata: class, declaredAt (ISO-8601), deviceFingerprint, mediaHash (sha256:<hex>), optional challengeId. See CaptureManifestSchema in @pcc/spec."
          },
          "captureBytesBase64": {
            "type": "string",
            "description": "Base64-encoded capture bytes (image / video / audio / sensor clip). Hash must match manifest.mediaHash."
          },
          "c2paManifestBase64": {
            "type": "string",
            "description": "Optional base64-encoded C2PA manifest JUMBF bytes. Required when manifest.class >= CC3."
          },
          "jobId": {
            "type": "string",
            "description": "Job ID for telemetry binding. Falls back to manifest.jobId if omitted."
          },
          "operatorId": {
            "type": "string",
            "description": "Explicit operator ID. Falls back to the authenticated session userId."
          },
          "challengeId": {
            "type": "string",
            "description": "Challenge UUID to re-bind to the in-memory challenge cache (G3 freshness gate)."
          },
          "visualNonceEcho": {
            "type": "string",
            "description": "The visual nonce value the operator rendered in-scene (QR payload, audio tone id, etc.)."
          },
          "submittedAt": {
            "type": "integer",
            "description": "Client-submitted timestamp (epoch ms). Used in drift detection."
          }
        },
        "required": [
          "manifest",
          "captureBytesBase64"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/capture/upload"
      }
    },
    {
      "name": "pcc_capture_anchor",
      "description": "Anchor a PASS + anchor-candidate capture verdict to CaptureClassRegistry on-chain (Base Sepolia by default). Rejects FAIL/PARTIAL verdicts. Idempotent — re-submitting the same verdictId returns the existing anchor row. Returns 202 {status:'deferred'} if CaptureClassRegistry is not yet deployed (CAPTURE_REGISTRY_ADDRESS unset).",
      "input_schema": {
        "type": "object",
        "properties": {
          "verdictId": {
            "type": "string",
            "description": "The verdictId returned by pcc_capture_upload. Must be a PASS verdict with anchorCandidate=true."
          }
        },
        "required": [
          "verdictId"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/capture/anchor"
      }
    },
    {
      "name": "pcc_capture_status",
      "description": "Fetch the combined verdict + on-chain anchor view for a single capture. Mirrors the verifier's DB shape plus the anchor tx metadata (txHash, blockNumber, gasUsed, explorerUrl). Anchor is null if the verdict was never anchored.",
      "input_schema": {
        "type": "object",
        "properties": {
          "verdictId": {
            "type": "string",
            "description": "Capture verdict UUID (from pcc_capture_upload)."
          }
        },
        "required": [
          "verdictId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capture/status/{verdictId}"
      }
    },
    {
      "name": "pcc_list_verdicts",
      "description": "List recent capture verdicts, newest first. Optionally filter by jobId. Default limit is 50, capped at 200 server-side. Returns {verdicts, count, limit, jobId}.",
      "input_schema": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Filter by job ID. Omit for all verdicts across jobs."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum rows returned (default 50, hard cap 200)."
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capture/verdicts"
      }
    },
    {
      "name": "pcc_capture_class_registry",
      "description": "Look up a capture's on-chain anchor record in CaptureClassRegistry by its 32-byte captureHash. Returns the registry address, captureHash, and decoded anchor tuple (declaredClass, verifiedClass, manifestHash, submittedBy, jobId, challengeId, blockAnchor, capturedAt, attestationsRoot, attesterCount). onchain is null if the capture was never anchored. Returns 202 deferred when CaptureClassRegistry is not yet deployed.",
      "input_schema": {
        "type": "object",
        "properties": {
          "captureHash": {
            "type": "string",
            "description": "Capture hash (32-byte). Accepts 0x-prefixed or unprefixed hex, or sha256:<hex> format. Padded server-side to bytes32."
          }
        },
        "required": [
          "captureHash"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capture/registry/{captureHash}"
      }
    },
    {
      "name": "pcc_verifier_health",
      "description": "Report CaptureVerifier health: which adapters are loaded (c2pa, webauthn, appattest, playintegrity), their staleness status, in-memory challenge cache size, whether CaptureClassRegistry is deployed, and the active PCC_NETWORK. Use this to diagnose why a capture class is being rejected or degraded.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/capture/verifier-health"
      }
    },
    {
      "name": "pcc_orchestrator_list_templates",
      "description": "List the orchestrator templates the dashboard's chat console can drive. Each entry includes slug, display_name, description, produces_kind, capability_class (physical | digital), greeting, and api_base (the route prefix that serves the six session-driver routes for that template). Public — no auth required.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/orchestrator/templates"
      }
    },
    {
      "name": "pcc_orchestrator_match_capabilities",
      "description": "Heuristic template matcher. Pass a free-text description of what you want to onboard (e.g. 'I run a CNC milling shop' or 'I have a Postgres database with a GraphQL endpoint') and the matcher returns all templates ranked by keyword score with a 'reason' string per match. Public — no auth required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string",
            "description": "Free-text description of what you want to onboard."
          }
        },
        "required": [
          "input"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/capabilities/templates/match"
      }
    },
    {
      "name": "pcc_onboard_session_start",
      "description": "Start a new physical-operator onboarding session. Returns a session_id used by every subsequent /api/onboard/* call. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Operator / company name (e.g. 'Oakland Titanium Mills')."
          },
          "url": {
            "type": "string",
            "description": "Optional company website. If supplied, the orchestrator scrapes it on the next /scrape call."
          }
        },
        "required": [
          "name"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/start"
      }
    },
    {
      "name": "pcc_onboard_session_scrape",
      "description": "Scrape a URL into the running physical-operator onboarding session. Triggers a stealth fetch + structured extraction (machines, hours, services, certifications). Returns a small JSON summary; full extraction is appended to the session's running profile and visible via /live-data. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session id returned by pcc_onboard_session_start."
          },
          "url": {
            "type": "string",
            "description": "URL to scrape (e.g. company About page)."
          }
        },
        "required": [
          "id",
          "url"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/{id}/scrape"
      }
    },
    {
      "name": "pcc_onboard_session_ingest_docs",
      "description": "Queue documents (datasheets, SOPs, MOPs, certifications) for ingestion into a physical-operator onboarding session. Document URLs may be local:// for files dropped in the chat console or full https:// URLs. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session id returned by pcc_onboard_session_start."
          },
          "doc_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "URLs of documents to ingest. Mix of local:// and https:// is fine."
          }
        },
        "required": [
          "id",
          "doc_urls"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/{id}/ingest-docs"
      }
    },
    {
      "name": "pcc_onboard_session_build_agent",
      "description": "Finalise a physical-operator onboarding session: registers the operator on PCC, mints a wallet, writes the SEO mirror, returns the publication payload (capabilities, operator_id, discovery_url). Idempotent — safe to retry inside the same session_id. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session id returned by pcc_onboard_session_start."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/onboard/{id}/build-agent"
      }
    },
    {
      "name": "pcc_onboard_session_status",
      "description": "Coarse status snapshot for a physical-operator onboarding session: current state, 0-100 progress, scraped_count, ingested_count, last_event, publication payload (if built). Cheap — designed for polling from the chat header. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session id returned by pcc_onboard_session_start."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/onboard/{id}/status"
      }
    },
    {
      "name": "pcc_onboard_session_live_data",
      "description": "Full event log for a physical-operator onboarding session — feeds the chat console's activity sidebar. Supports incremental polling via ?since=<unix-millis>. Returns the next cursor on every response. Auth-required.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session id returned by pcc_onboard_session_start."
          },
          "since": {
            "type": "number",
            "description": "Unix milliseconds cursor — returns only events with t > since. Use the 'cursor' field of the previous response for incremental polling."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/onboard/{id}/live-data"
      }
    },
    {
      "name": "pcc_contributor_register",
      "description": "Register a contributor profile binding a wallet address to a role and a published RateSchedule. Body: address (0x40hex), role (10 ContributorRole values from ADR-12 §2.1 + legacy 'designer'), scheduleHash (0x64hex of a previously published schedule), optional ipId, metadataUri, contributorNftTokenId. Returns the persisted profile (composite id is address:role:tail). Idempotent on the composite id — re-posting the same (address, role, contributorNftTokenId) replaces the prior profile.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Wallet address (0x + 40 hex chars)"
          },
          "role": {
            "type": "string",
            "enum": [
              "operator",
              "verifier",
              "insurer",
              "integrator",
              "protocol-author",
              "model-author",
              "dataset-contributor",
              "curator",
              "assembler",
              "network-treasury",
              "designer"
            ],
            "description": "ContributorRole — 10 ADR-12 roles + deprecated 'designer'"
          },
          "scheduleHash": {
            "type": "string",
            "description": "0x + 64 hex sha256 of a published RateSchedule"
          },
          "ipId": {
            "type": "string",
            "description": "Optional Story Protocol IP Asset ID"
          },
          "metadataUri": {
            "type": "string",
            "description": "Optional ipfs:// or https:// URI"
          },
          "contributorNftTokenId": {
            "type": "string",
            "description": "Optional ContributorNFT tokenId once minted on-chain"
          }
        },
        "required": [
          "address",
          "role",
          "scheduleHash"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/contributors"
      }
    },
    {
      "name": "pcc_contributor_list",
      "description": "List all contributor profiles for an address across roles. Returns an array of {id, address, role, scheduleHash, ipId, contributorNftTokenId, metadataUri, registeredAt}. Returns empty array when no profiles exist for the address.",
      "input_schema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Wallet address (0x + 40 hex chars)"
          }
        },
        "required": [
          "address"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/contributors/{address}"
      }
    },
    {
      "name": "pcc_schedule_publish",
      "description": "Publish a sealed off-chain RateSchedule. Computes scheduleHash server-side via the canonical sha256-over-canonical-JSON algorithm (matching the on-chain RateScheduleRegistry.publish() invariant). Idempotent: re-publishing the same content returns alreadyPublished:true. Returns {scheduleHash, alreadyPublished}.",
      "input_schema": {
        "type": "object",
        "properties": {
          "publishedBy": {
            "type": "string",
            "description": "Address that publishes (0x + 40 hex chars)"
          },
          "schedule": {
            "type": "object",
            "description": "RateSchedule body — version, segments (constant/step/linear-decay/exponential-decay/adoption-indexed/piecewise-value), and optional notes",
            "properties": {
              "version": {
                "type": "integer",
                "minimum": 1
              },
              "segments": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "minItems": 1
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "version",
              "segments"
            ]
          }
        },
        "required": [
          "publishedBy",
          "schedule"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/contributors/schedules"
      }
    },
    {
      "name": "pcc_schedule_get",
      "description": "Fetch a published RateSchedule by its content hash. Returns {schedule, publishedBy} with segments re-validated via Zod, or 404 if not found.",
      "input_schema": {
        "type": "object",
        "properties": {
          "scheduleHash": {
            "type": "string",
            "description": "0x + 64 hex sha256 of the schedule"
          }
        },
        "required": [
          "scheduleHash"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/contributors/schedules/{scheduleHash}"
      }
    },
    {
      "name": "pcc_schedule_evaluate",
      "description": "Evaluate a published RateSchedule at a moment, returning the effective bps. Inputs: scheduleHash + now (unix seconds) + optional jobValueCents (piecewise-value) + optional jobsPerDay (adoption-indexed). Returns {scheduleHash, bps, segmentKind, segmentIndex}. segmentIndex=-1 + bps=0 when no segment covers the moment (silent gap).",
      "input_schema": {
        "type": "object",
        "properties": {
          "scheduleHash": {
            "type": "string",
            "description": "0x + 64 hex schedule hash"
          },
          "now": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix seconds at evaluation moment"
          },
          "jobValueCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Job value in cents (piecewise-value segments)"
          },
          "jobsPerDay": {
            "type": "number",
            "minimum": 0,
            "description": "Rolling 24h job count (adoption-indexed segments)"
          }
        },
        "required": [
          "scheduleHash",
          "now"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/contributors/schedules/{scheduleHash}/evaluate"
      }
    },
    {
      "name": "pcc_training_manifest_set",
      "description": "Set (insert-or-replace) the TrainingManifest for a model IP — the dataset weight map the LicensingEngine walks when distributing payouts to a 'model-author' entry in a CompositionManifest. Dataset weightBps must sum to ≤ 10000 (gateway accepts partial mixes; on-chain enforces exact 10000). Returns {modelIpId, manifestHash}.",
      "input_schema": {
        "type": "object",
        "properties": {
          "modelIpId": {
            "type": "string",
            "description": "Story IP Asset ID for the model"
          },
          "baseModelIpId": {
            "type": "string",
            "description": "Optional parent ModelNFT IP if this was fine-tuned"
          },
          "datasetWeights": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "datasetIpId": {
                  "type": "string"
                },
                "weightBps": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "dataPointCount": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "datasetIpId",
                "weightBps"
              ]
            },
            "description": "DatasetIP entries with weightBps (sum ≤ 10000)"
          },
          "methodologyHash": {
            "type": "string",
            "description": "Optional 0x + 64 hex reproducibility hash"
          }
        },
        "required": [
          "modelIpId",
          "datasetWeights"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/contributors/training-manifests"
      }
    },
    {
      "name": "pcc_training_manifest_get",
      "description": "Fetch the TrainingManifest for a model IP. Returns the parsed datasets array + manifestHash + createdAt, or 404 if no manifest has been set.",
      "input_schema": {
        "type": "object",
        "properties": {
          "modelIpId": {
            "type": "string",
            "description": "Story IP Asset ID for the model"
          }
        },
        "required": [
          "modelIpId"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/contributors/training-manifests/{modelIpId}"
      }
    },
    {
      "name": "pcc_trilobio_build_config",
      "description": "Generate a complete KERNEL_CONFIG JSON for a Trilobio (tcode-api) fleet controller. Wraps `buildTrilobioConfig()` from the @pcc/trilobio npm package. Returns a TrilobioKernelConfig with sensible defaults (pollIntervalMs=3000, maxScriptTimeoutSec=3600, allowArbitraryScripts=false). The result can be passed to `pcc-node start` via the KERNEL_CONFIG env var, or handed to setup_generate_config / setup_register_device for direct API-driven registration. Note: this is a TypeScript package helper (no HTTP call). For programmatic use, `import { buildTrilobioConfig } from \"@pcc/trilobio\"`.",
      "input_schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Fleet-controller URL on the LAN (host[:port], no trailing slash, no path) — e.g. http://192.168.1.50"
          },
          "apiKey": {
            "type": "string",
            "description": "Trilobio fleet-controller API key (from the trilobot admin UI). Either apiKey OR username+password is required unless mockMode=true."
          },
          "username": {
            "type": "string",
            "description": "Fleet-controller account username (basic-auth mode only)"
          },
          "password": {
            "type": "string",
            "description": "Fleet-controller account password (basic-auth mode only)"
          },
          "kernelId": {
            "type": "string",
            "description": "Kernel ID this device belongs to (auto-generated as kernel_trilobio_<timestamp> if omitted)"
          },
          "deviceId": {
            "type": "string",
            "description": "Logical device ID within the kernel (default: trilobio-fleet-01)"
          },
          "tcodeApiVersion": {
            "type": "string",
            "description": "Pinned tcode-api version on the fleet controller. Format: 'latest' or semver (e.g. 1.25.1). Default: latest. Surfaces in evidence bundles for reproducibility."
          },
          "mockMode": {
            "type": "boolean",
            "description": "Bypass real HTTP and simulate runs. Use for CI / floor demos. Default: false."
          },
          "pollIntervalMs": {
            "type": "number",
            "description": "Poll interval in ms for run status (range 500-60000). Default: 3000."
          },
          "maxScriptTimeoutSec": {
            "type": "number",
            "description": "Maximum allowed wall-clock seconds for a single tcode script (range 30-86400). Default: 3600."
          },
          "mockRunDurationMs": {
            "type": "number",
            "description": "Mock-mode simulated run duration in ms. Default: 2000."
          },
          "allowArbitraryScripts": {
            "type": "boolean",
            "description": "Permit customer-supplied tcode-api Python scripts (true) or only curated protocol IDs (false). Default: false. Set true only for trusted-counterparty deployments."
          }
        },
        "required": [
          "url"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/helpers/trilobio/build-config"
      }
    },
    {
      "name": "pcc_trilobio_validate_options",
      "description": "Sanity-check operator-supplied Trilobio options before generating a KERNEL_CONFIG. Wraps `validateTrilobioOptions()` from @pcc/trilobio. Catches the common mistakes (malformed URL, missing creds, out-of-range timeouts, invalid tcodeApiVersion semver) before they hit the gateway or the device. Returns { valid: boolean, errors: string[], warnings?: string[] }. Note: this is a TypeScript package helper (no HTTP call); for programmatic use, `import { validateTrilobioOptions } from \"@pcc/trilobio\"`.",
      "input_schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Fleet-controller URL"
          },
          "apiKey": {
            "type": "string",
            "description": "Fleet-controller API key"
          },
          "username": {
            "type": "string",
            "description": "Basic-auth username"
          },
          "password": {
            "type": "string",
            "description": "Basic-auth password"
          },
          "kernelId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "tcodeApiVersion": {
            "type": "string",
            "description": "'latest' or semver string"
          },
          "mockMode": {
            "type": "boolean"
          },
          "pollIntervalMs": {
            "type": "number"
          },
          "maxScriptTimeoutSec": {
            "type": "number"
          },
          "mockRunDurationMs": {
            "type": "number"
          },
          "allowArbitraryScripts": {
            "type": "boolean"
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/helpers/trilobio/validate-options"
      }
    },
    {
      "name": "pcc_trilobio_validate_script",
      "description": "Quick lint of a tcode-api Python script before submission to a Trilobio fleet controller. Wraps `validateTcodeScript()` from @pcc/trilobio. Surface check only — NOT a sandbox or sanitizer. Looks for: imports of `tcode_api` (presence required), obviously dangerous statements (subprocess, os.system, eval, exec, __import__, socket, urllib, requests, file writes), empty scripts, and missing top-level tcode commands. Returns { valid: boolean, errors: string[], warnings?: string[] }. Operators with `allowArbitraryScripts=true` should treat results as a hint — the fleet controller is the source of truth on safety. Note: TypeScript package helper (no HTTP call); for programmatic use, `import { validateTcodeScript } from \"@pcc/trilobio\"`.",
      "input_schema": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "Full Python source of the tcode-api script to lint"
          }
        },
        "required": [
          "source"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/helpers/trilobio/validate-script"
      }
    },
    {
      "name": "pcc_trilobio_capability_template",
      "description": "Return the `TRILOBIO_CAPABILITY` constant from @pcc/trilobio — a default capability template for a Trilobio fleet controller. Pass to POST /api/capabilities to publish a baseline liquid-handling capability for a kernel hosting a trilobot. Operators can extend the `materials` and `capabilities` arrays to advertise instrument-specific features (custom labware libraries, sample types). Notable: includes `tcode-script-execution` as an advertised capability, which is unique to Trilobio — operators who set `allowArbitraryScripts: true` can accept jobs that ship a full tcode-api Python script as the protocol payload. Note: TypeScript package helper (no HTTP call); for programmatic use, `import { TRILOBIO_CAPABILITY } from \"@pcc/trilobio\"`.",
      "input_schema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/helpers/trilobio/capability-template"
      }
    },
    {
      "name": "attach_operator_channel",
      "description": "Attach a notification/dispatch channel to an operator so PCC knows how to ping them when a job lands. The operator's onboarding agent calls this AFTER the conversation that produced the channel record. Transport is a small stable enum (webhook|email|sms|voice|push|mqtt|file|manual) — vendor specifics live in the free-form `describe` field, written by the operator's agent. PCC the substrate stays neutral. Returns the channel record with a generated id.",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Operator slug (typically the operator's address or unique identifier)."
          },
          "label": {
            "type": "string",
            "description": "Short human label shown to the operator and in admin UIs: 'Front counter printer', 'Owner's phone'."
          },
          "transport": {
            "type": "string",
            "enum": [
              "webhook",
              "email",
              "sms",
              "voice",
              "push",
              "mqtt",
              "file",
              "manual"
            ],
            "description": "Which wire does the message go over. `manual` = no machine endpoint (dashboard-only)."
          },
          "direction": {
            "type": "string",
            "enum": [
              "out",
              "in-out",
              "in"
            ],
            "description": "out=PCC pushes only; in-out=operator's system also replies; in=operator pushes unsolicited."
          },
          "endpoint": {
            "type": "object",
            "description": "Transport-specific routing payload. webhook→{url}, email→{address}, sms/voice→{phoneE164}, push→{token,platform}, mqtt→{brokerUrl,topic}, file→{scheme,path}, manual→{}."
          },
          "credentialRef": {
            "type": "string",
            "description": "Reference to a secret in the credential vault (not the secret itself). PCC resolves it at dispatch time."
          },
          "describe": {
            "type": "string",
            "description": "Plain-English instructions for how PCC should talk to whatever is on the other end. Written by the operator's onboarding agent. Required, ≥4 chars. Example: 'POST JSON with keys order_id, line_items[], deadline_iso. I will POST back {order_id, status} to your reply URL.'"
          },
          "replyContract": {
            "type": "string",
            "description": "Optional operator-authored contract describing how the operator's system will respond to evidence requests, status pings, etc."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the channel is live (defaults to true)."
          }
        },
        "required": [
          "slug",
          "label",
          "transport",
          "describe"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operators/{slug}/channels"
      }
    },
    {
      "name": "list_operator_channels",
      "description": "List every channel attached to an operator. Returns the full channel records (id, transport, direction, endpoint, describe, enabled flags). Useful for an operator's onboarding agent to confirm what is wired up, and for status dashboards.",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Operator slug."
          }
        },
        "required": [
          "slug"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operators/{slug}/channels"
      }
    },
    {
      "name": "update_operator_channel",
      "description": "Update an existing channel — toggle enabled, rewrite the describe contract, change the endpoint payload, etc. Merges into the existing record. The operator slug, id, and createdAt are immutable.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Channel id (returned from attach_operator_channel)."
          },
          "label": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "out",
              "in-out",
              "in"
            ]
          },
          "endpoint": {
            "type": "object"
          },
          "credentialRef": {
            "type": "string"
          },
          "describe": {
            "type": "string"
          },
          "replyContract": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "PATCH",
        "path": "/api/operators/channels/{id}"
      }
    },
    {
      "name": "delete_operator_channel",
      "description": "Remove a channel from an operator. Future jobs will not dispatch to it. Use update_operator_channel with enabled=false to silence temporarily without losing the recipe in `describe`.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Channel id."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "DELETE",
        "path": "/api/operators/channels/{id}"
      }
    },
    {
      "name": "test_operator_channels",
      "description": "Fire a synthetic job at every enabled channel for an operator so the onboarding agent (and the human watching) can confirm the integration end-to-end before a real job lands. Returns per-channel dispatch results (delivered, ref, warnings).",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Operator slug."
          }
        },
        "required": [
          "slug"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/operators/{slug}/channels/test"
      }
    },
    {
      "name": "suggest_csd_templates",
      "description": "Bidirectional onboarding: the registry talks back. Describe in plain English what you are trying to set up — 'wood-fired pizza shop in SF', 'Opentrons OT-2 liquid handler', 'same-day SF courier' — and the registry returns N candidate Capability StructureDefinition (CSD) templates ranked by keyword-overlap relevance (name×3, tags×2, description×1; tie-break on usage). Empty query falls back to popularity-ordered top picks. After picking one, pass the chosen type to pcc-author-integration. Score-zero results are dropped.",
      "input_schema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string",
            "description": "Plain-English description of the capability the user is trying to set up. Optional — empty falls back to popularity."
          },
          "limit": {
            "type": "integer",
            "description": "Max results (1..20, default 5).",
            "minimum": 1,
            "maximum": 20
          },
          "kind": {
            "type": "string",
            "enum": [
              "base",
              "profile",
              "extension",
              "workflow"
            ],
            "description": "Filter by CSD kind."
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/csd/suggest"
      }
    },
    {
      "name": "get_popular_csd_templates",
      "description": "Return CSDs sorted by adoption (usage-count descending). Useful for first-time operators who want to see what kind of capabilities others are publishing. Each entry includes the CSD record plus usage attribution: count, recent adopters (deduped, capped at 50), and lastUsedAt.",
      "input_schema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Max results (1..50, default 10).",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": []
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/csd/popular"
      }
    },
    {
      "name": "get_operator_status",
      "description": "Four-slot substrate view for an operator: kernels, capabilities (with sla + availability), notification channels, and the per-kernel A2A agent-card URLs. Returns totals and a `missing` list naming any of the four onboarding slots that are still empty. Use this from an onboarding agent's wrap-up step to confirm 'are all four slots wired before I go live?' status is `ready` | `partial` | `unconfigured`. Public — operator slug is non-secret and the response carries no credentials (channel `credentialRef` values are vault references, not secrets).",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Operator slug — typically the operator's wallet address used as `operatorAddress` on their kernels."
          }
        },
        "required": [
          "slug"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/operators/{slug}/status"
      }
    },
    {
      "name": "propose_composition",
      "description": "Propose a composition — a sequenced DAG of capability instances to satisfy a multi-step outcome under a budget + assurance tier. Accepts either a flat `steps` list or an outcome chain. Returns a candidate plan ranked by `optimizeFor` (price | speed | quality) with per-step assignments. The composition is persisted for ~30 minutes (proposed status) and can be executed once via execute_composition.",
      "input_schema": {
        "type": "object",
        "properties": {
          "outcomeType": {
            "type": "string",
            "description": "High-level outcome label, ≤120 chars. Example: 'desk-robot-prototype'."
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ordered list of capability types this composition needs (1..20). Use this OR `outcomeChain`."
          },
          "outcomeChain": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Alternative to `steps`: chain of named sub-outcomes. The planner expands each into capability types."
          },
          "budgetUSD": {
            "type": "number",
            "description": "Total budget the user is willing to spend across all steps."
          },
          "minAssuranceTier": {
            "type": "integer",
            "enum": [
              0,
              1,
              2,
              3
            ],
            "description": "Minimum acceptable assurance tier on every step."
          },
          "location": {
            "type": "object",
            "description": "Geographic constraint (lat/lng + radius, or country, etc)."
          },
          "optimizeFor": {
            "type": "string",
            "enum": [
              "price",
              "speed",
              "quality"
            ],
            "description": "Ranking objective (default `price`)."
          },
          "requester": {
            "type": "object",
            "description": "{agentId, did?} — the agent submitting the request."
          },
          "description": {
            "type": "string",
            "description": "Free-form natural-language description (≤4000 chars)."
          }
        },
        "required": [
          "outcomeType",
          "budgetUSD",
          "minAssuranceTier"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/compose"
      }
    },
    {
      "name": "get_composition",
      "description": "Retrieve a previously-proposed composition by id. Returns 404 if unknown, 410 if the 30-minute proposal window has expired. Use this to inspect a plan before executing, or to recover a plan id after a restart.",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Composition id (returned from propose_composition)."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "GET",
        "path": "/api/compose/{id}"
      }
    },
    {
      "name": "execute_composition",
      "description": "Commit a proposed composition: drives the DAG through the workflow engine, each step records a reputation outcome, the composition's reputation is finalized when the run ends. When `PCC_COMPOSE_EXECUTE_REAL=true` is set on the gateway, steps submit real jobs via JobFacade and the workflow run is durable (@pcc/workflow). When the flag is off, the NOOP runner returns synthetic success — useful in dev/test. Re-executing an already-run composition replays the stored result (idempotent — reputation deltas are applied exactly once).",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Composition id from propose_composition. Must be in `proposed` status and not expired."
          },
          "idempotencyKey": {
            "type": "string",
            "description": "Optional caller-supplied key (≤120 chars) to dedupe execute calls."
          }
        },
        "required": [
          "id"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/compose/{id}/execute"
      }
    },
    {
      "name": "pcc_report",
      "description": "Report a bug, friction, or dead-end you hit while using PCC. Call this the moment you get stuck and cannot recover: an endpoint returned an unexplained 500, a tool description was misleading, a required field was undocumented, or the next step in a workflow was unclear and you abandoned it. PUBLIC — works even before you provision an API key (cold agents are exactly who this is for). Reports are persisted durably and reviewed by the PCC team. Rate-limited per IP to limit spam.",
      "input_schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bug",
              "friction",
              "idea"
            ],
            "description": "bug = something is broken or wrong; friction = it works but was confusing/harder than it should be; idea = a suggestion or missing capability. Defaults to bug if omitted."
          },
          "summary": {
            "type": "string",
            "minLength": 4,
            "maxLength": 5000,
            "description": "1-line description of what went wrong. Example: 'POST /api/build/options returned 500 with no hint about the missing field.'"
          },
          "detail": {
            "type": "string",
            "maxLength": 20000,
            "description": "Multi-line context: the full error, what you tried, what you expected. Optional but recommended."
          },
          "endpoint": {
            "type": "string",
            "description": "The route you were on when you got stuck. Example: '/api/build/contract'."
          },
          "traceId": {
            "type": "string",
            "description": "Your onboarding journey ID, if you have one — returned by provision_api_key and present on every response as the `x-pcc-trace-id` header. Lets PCC replay your full journey."
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "description": "How badly this blocked you. Optional."
          },
          "agentId": {
            "type": "string",
            "description": "Which model / agent you are. Example: 'claude', 'gpt-4o', 'gemini', 'canary'. Optional."
          }
        },
        "required": [
          "summary"
        ]
      },
      "endpoint": {
        "method": "POST",
        "path": "/api/feedback"
      }
    }
  ],
  "quickstart": {
    "claude": "const Anthropic = require('@anthropic-ai/sdk');\nconst pkg = require('./agent-package.json');\nconst client = new Anthropic();\n\nconst PCC_BASE = pkg.api_base; // https://capability.network\nconst tools = pkg.tools.map(t => ({ name: t.name, description: t.description, input_schema: t.input_schema }));\n\nlet apiKey = null;\n\nasync function callTool(tool, input) {\n  let path = tool.endpoint.path;\n  // Replace path params like {jobId} with actual values\n  for (const [k, v] of Object.entries(input)) {\n    path = path.replace(`{${k}}`, v);\n  }\n  const url = `${PCC_BASE}${path}`;\n  const headers = { 'Content-Type': 'application/json' };\n  if (apiKey) headers['Authorization'] = `Bearer ${apiKey}`;\n  const res = await fetch(url, {\n    method: tool.endpoint.method,\n    headers,\n    body: tool.endpoint.method !== 'GET' ? JSON.stringify(input) : undefined,\n  });\n  const data = await res.json();\n  // Cache API key from provision_api_key response\n  if (tool.name === 'provision_api_key' && data.api_key) apiKey = data.api_key;\n  return data;\n}\n\nasync function chat(userMessage) {\n  const messages = [{ role: 'user', content: userMessage }];\n  while (true) {\n    const response = await client.messages.create({\n      model: 'claude-sonnet-4-20250514',\n      max_tokens: 4096,\n      system: pkg.system_prompt,\n      tools,\n      messages,\n    });\n    messages.push({ role: 'assistant', content: response.content });\n    if (response.stop_reason !== 'tool_use') break;\n    const results = [];\n    for (const block of response.content) {\n      if (block.type !== 'tool_use') continue;\n      const tool = pkg.tools.find(t => t.name === block.name);\n      const result = await callTool(tool, block.input);\n      results.push({ type: 'tool_result', tool_use_id: block.id, content: JSON.stringify(result) });\n    }\n    messages.push({ role: 'user', content: results });\n  }\n  return messages;\n}\n\nchat('I want to register my HPLC lab and start accepting jobs on the PCC network.');",
    "openai": "const OpenAI = require('openai');\nconst pkg = require('./agent-package.json');\nconst client = new OpenAI();\n\nconst PCC_BASE = pkg.api_base; // https://capability.network\nconst tools = pkg.tools.map(t => ({\n  type: 'function',\n  function: { name: t.name, description: t.description, parameters: t.input_schema },\n}));\n\nlet apiKey = null;\n\nasync function callTool(toolName, input) {\n  const tool = pkg.tools.find(t => t.name === toolName);\n  let path = tool.endpoint.path;\n  for (const [k, v] of Object.entries(input)) path = path.replace(`{${k}}`, v);\n  const headers = { 'Content-Type': 'application/json' };\n  if (apiKey) headers['Authorization'] = `Bearer ${apiKey}`;\n  const res = await fetch(`${PCC_BASE}${path}`, {\n    method: tool.endpoint.method,\n    headers,\n    body: tool.endpoint.method !== 'GET' ? JSON.stringify(input) : undefined,\n  });\n  const data = await res.json();\n  if (toolName === 'provision_api_key' && data.api_key) apiKey = data.api_key;\n  return data;\n}\n\nasync function chat(userMessage) {\n  const messages = [\n    { role: 'system', content: pkg.system_prompt },\n    { role: 'user', content: userMessage },\n  ];\n  while (true) {\n    const response = await client.chat.completions.create({ model: 'gpt-4o', tools, messages });\n    const msg = response.choices[0].message;\n    messages.push(msg);\n    if (!msg.tool_calls) break;\n    for (const call of msg.tool_calls) {\n      const result = await callTool(call.function.name, JSON.parse(call.function.arguments));\n      messages.push({ role: 'tool', tool_call_id: call.id, content: JSON.stringify(result) });\n    }\n  }\n  return messages;\n}\n\nchat('I want to register my HPLC lab and start accepting jobs on the PCC network.');"
  },
  "metadata": {
    "tool_count": 249,
    "updated": "2026-06-14T01:00:00Z"
  }
}
