foodblock-mcp
v0.5.1Food data tools for any AI agent.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
foodblock_create Create FoodBlock
Create a new FoodBlock. A FoodBlock is the universal data primitive for the food system. It has three fields: type (what it is), state (its properties), refs (what it references). Base types: actor (person/org), place (location), substance (ingredient/product), transform (cooking/processing), transfer (sale/delivery), observe (review/certification). Use dot notation for subtypes: actor.producer, substance.product, observe.review, etc.
| Parameter | Type | Description |
|---|---|---|
type * | string | Block type. Base types: actor, place, substance, transform, transfer, observe. Use dot notation for subtypes, e.g. actor.producer, substance.product, transfer.order |
refs | object | References to other blocks by hash. Example: { seller: 'abc123...' } |
state | object | The block's properties as a JSON object. Example: { name: 'Sourdough', price: 4.50 } |
foodblock_update Update FoodBlock
Create a new version of an existing FoodBlock. FoodBlocks are append-only — this creates a new block that references the previous one via refs.updates. Note: state is a FULL REPLACEMENT, not a merge.
| Parameter | Type | Description |
|---|---|---|
previous_hash * | string | The hash of the block to update (64-character hex string) |
type * | string | The block type (must match the original) |
refs | object | Additional refs (updates ref is added automatically) |
state | object | The new state (full replacement, not a merge) |
foodblock_get Get FoodBlock
Fetch a specific FoodBlock by its SHA-256 hash.
| Parameter | Type | Description |
|---|---|---|
hash * | string | The 64-character hex hash of the block to retrieve |
foodblock_query Query FoodBlocks
Search for FoodBlocks by type, ref, or heads. Returns matching blocks.
| Parameter | Type | Description |
|---|---|---|
heads_only | boolean | If true, only return head blocks (latest version in each chain) |
limit | number | Maximum results to return (default 20) |
ref_role | string | Filter by ref role name. Use with ref_value. Example: 'seller' |
ref_value | string | Filter by ref value (a block hash). Use with ref_role. |
type | string | Filter by type (exact or prefix). Examples: 'actor', 'substance.product' |
foodblock_chain Trace Provenance Chain
Follow the update chain of a FoodBlock backwards through its versions. Shows the full version history: current → previous → original.
| Parameter | Type | Description |
|---|---|---|
hash * | string | The hash of the block to trace backwards from |
max_depth | number | Maximum chain depth to traverse (default 50) |
foodblock_tree Trace Provenance Tree
Build the full provenance tree for a FoodBlock by following ALL refs recursively. Shows the complete story: bread ← baking ← flour ← wheat ← farm.
| Parameter | Type | Description |
|---|---|---|
hash * | string | The hash of the block to build the provenance tree from |
max_depth | number | Maximum tree depth (default 10) |
foodblock_heads List Head Blocks
List all head blocks (latest version of each entity/item). Optionally filter by type.
| Parameter | Type | Description |
|---|---|---|
type | string | Optional type filter (e.g. 'substance.product') |
foodblock_info FoodBlock System Info
Get an overview of the FoodBlock system: server info, block count, and protocol summary. Call this first to understand what data is available.
foodblock_create_agent Create AI Agent
Register a new AI agent in the FoodBlock system. The agent gets its own identity, Ed25519 keypair, and can sign blocks. Every agent must have an operator — the human or business it acts for. IMPORTANT: Save the returned credentials — they cannot be recovered after server restart.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name for the agent, e.g. 'Bakery Assistant' |
operator_hash * | string | Hash of the actor this agent works for |
capabilities | array | Agent capabilities |
model | string | AI model, e.g. 'claude-sonnet' |
foodblock_load_agent Load Agent
Load a previously created agent using saved credentials. Required after MCP server restart to restore signing ability.
| Parameter | Type | Description |
|---|---|---|
agent_hash * | string | The agent's block hash (from foodblock_create_agent) |
private_key * | string | The agent's private key hex (from foodblock_create_agent credentials) |
public_key | string | The agent's public key hex (optional, for verification) |
foodblock_agent_draft Create Agent Draft
Create a draft FoodBlock on behalf of an agent. Draft blocks have state.draft=true. The human operator can approve or reject with foodblock_approve_draft.
| Parameter | Type | Description |
|---|---|---|
agent_hash * | string | Hash of the agent creating this draft |
type * | string | Block type, e.g. 'transfer.order' |
refs | object | Block refs |
state | object | Block state |
foodblock_approve_draft Approve Agent Draft
Approve a draft block created by an agent. Creates a confirmed version with draft removed.
| Parameter | Type | Description |
|---|---|---|
draft_hash * | string | Hash of the draft block to approve |
foodblock_list_agents List Agents
List all AI agents in the FoodBlock system.
foodblock_tombstone Tombstone FoodBlock
Mark a FoodBlock for content erasure (GDPR compliance). Creates an observe.tombstone block that references the target. The target block's state is replaced with {tombstoned: true}. The hash, type, and refs are preserved for chain integrity.
| Parameter | Type | Description |
|---|---|---|
requested_by * | string | Hash of the actor requesting erasure |
target_hash * | string | Hash of the block to tombstone (64-character hex string) |
reason | string | Reason for erasure (e.g. 'gdpr_erasure', 'user_request') |
foodblock_validate Validate FoodBlock
Validate a FoodBlock against its declared schema or a provided schema. Returns an array of error messages (empty means valid). Checks required fields, types, expected refs, and instance_id requirements.
| Parameter | Type | Description |
|---|---|---|
type * | string | Block type to validate |
refs | object | Block refs to validate |
state | object | Block state to validate |
foodblock_batch Batch Create FoodBlocks
Create multiple FoodBlocks in a single request. Blocks are sorted in dependency order automatically. Useful for syncing offline-created blocks or bulk imports. Returns counts of inserted, skipped (duplicates), and failed blocks.
| Parameter | Type | Description |
|---|---|---|
blocks * | array | Array of blocks to create, each with type, state, refs |
foodblock_fb Natural Language FoodBlock
The single natural language entry point to FoodBlock. Describe food in plain English and get structured FoodBlocks back. No need to know types, fields, or hashes. Examples: 'Sourdough bread, $4.50, organic, contains gluten', 'Amazing pizza at Luigi\'s, 5 stars', 'Green Acres Farm, 200 acres, organic wheat in Oregon', 'Walk-in cooler temperature 4 celsius', 'Ordered 50kg flour from Stone Mill'.
| Parameter | Type | Description |
|---|---|---|
text * | string | Any food-related natural language text |