{"at":"2026-11-23T05:14:39.285Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:14:39.694Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:14:39.795Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:14:40.245Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"foodblock","version":"0.5.0"}}}}
{"at":"2026-11-23T05:14:40.245Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:14:40.245Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:14:40.250Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"refs":{"additionalProperties":{},"default":{},"description":"References to other blocks by hash. Example: { seller: 'abc123...' }","type":"object"},"state":{"additionalProperties":{},"default":{},"description":"The block's properties as a JSON object. Example: { name: 'Sourdough', price: 4.50 }","type":"object"},"type":{"description":"Block type. Base types: actor, place, substance, transform, transfer, observe. Use dot notation for subtypes, e.g. actor.producer, substance.product, transfer.order","type":"string"}},"required":["type"],"type":"object"},"name":"foodblock_create","title":"Create FoodBlock"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"previous_hash":{"description":"The hash of the block to update (64-character hex string)","type":"string"},"refs":{"additionalProperties":{},"default":{},"description":"Additional refs (updates ref is added automatically)","type":"object"},"state":{"additionalProperties":{},"default":{},"description":"The new state (full replacement, not a merge)","type":"object"},"type":{"description":"The block type (must match the original)","type":"string"}},"required":["previous_hash","type"],"type":"object"},"name":"foodblock_update","title":"Update FoodBlock"},{"description":"Fetch a specific FoodBlock by its SHA-256 hash.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"hash":{"description":"The 64-character hex hash of the block to retrieve","type":"string"}},"required":["hash"],"type":"object"},"name":"foodblock_get","title":"Get FoodBlock"},{"description":"Search for FoodBlocks by type, ref, or heads. Returns matching blocks.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"heads_only":{"default":false,"description":"If true, only return head blocks (latest version in each chain)","type":"boolean"},"limit":{"default":20,"description":"Maximum results to return (default 20)","type":"number"},"ref_role":{"description":"Filter by ref role name. Use with ref_value. Example: 'seller'","type":"string"},"ref_value":{"description":"Filter by ref value (a block hash). Use with ref_role.","type":"string"},"type":{"description":"Filter by type (exact or prefix). Examples: 'actor', 'substance.product'","type":"string"}},"type":"object"},"name":"foodblock_query","title":"Query FoodBlocks"},{"description":"Follow the update chain of a FoodBlock backwards through its versions. Shows the full version history: current → previous → original.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"hash":{"description":"The hash of the block to trace backwards from","type":"string"},"max_depth":{"default":50,"description":"Maximum chain depth to traverse (default 50)","type":"number"}},"required":["hash"],"type":"object"},"name":"foodblock_chain","title":"Trace Provenance Chain"},{"description":"Build the full provenance tree for a FoodBlock by following ALL refs recursively. Shows the complete story: bread ← baking ← flour ← wheat ← farm.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"hash":{"description":"The hash of the block to build the provenance tree from","type":"string"},"max_depth":{"default":10,"description":"Maximum tree depth (default 10)","type":"number"}},"required":["hash"],"type":"object"},"name":"foodblock_tree","title":"Trace Provenance Tree"},{"description":"List all head blocks (latest version of each entity/item). Optionally filter by type.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"type":{"description":"Optional type filter (e.g. 'substance.product')","type":"string"}},"type":"object"},"name":"foodblock_heads","title":"List Head Blocks"},{"description":"Get an overview of the FoodBlock system: server info, block count, and protocol summary. Call this first to understand what data is available.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"foodblock_info","title":"FoodBlock System Info"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"capabilities":{"description":"Agent capabilities","items":{"type":"string"},"type":"array"},"model":{"description":"AI model, e.g. 'claude-sonnet'","type":"string"},"name":{"description":"Name for the agent, e.g. 'Bakery Assistant'","type":"string"},"operator_hash":{"description":"Hash of the actor this agent works for","type":"string"}},"required":["name","operator_hash"],"type":"object"},"name":"foodblock_create_agent","title":"Create AI Agent"},{"description":"Load a previously created agent using saved credentials. Required after MCP server restart to restore signing ability.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"agent_hash":{"description":"The agent's block hash (from foodblock_create_agent)","type":"string"},"private_key":{"description":"The agent's private key hex (from foodblock_create_agent credentials)","type":"string"},"public_key":{"description":"The agent's public key hex (optional, for verification)","type":"string"}},"required":["agent_hash","private_key"],"type":"object"},"name":"foodblock_load_agent","title":"Load Agent"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"agent_hash":{"description":"Hash of the agent creating this draft","type":"string"},"refs":{"additionalProperties":{},"default":{},"description":"Block refs","type":"object"},"state":{"additionalProperties":{},"default":{},"description":"Block state","type":"object"},"type":{"description":"Block type, e.g. 'transfer.order'","type":"string"}},"required":["agent_hash","type"],"type":"object"},"name":"foodblock_agent_draft","title":"Create Agent Draft"},{"description":"Approve a draft block created by an agent. Creates a confirmed version with draft removed.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"draft_hash":{"description":"Hash of the draft block to approve","type":"string"}},"required":["draft_hash"],"type":"object"},"name":"foodblock_approve_draft","title":"Approve Agent Draft"},{"description":"List all AI agents in the FoodBlock system.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"foodblock_list_agents","title":"List Agents"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"reason":{"default":"erasure_request","description":"Reason for erasure (e.g. 'gdpr_erasure', 'user_request')","type":"string"},"requested_by":{"description":"Hash of the actor requesting erasure","type":"string"},"target_hash":{"description":"Hash of the block to tombstone (64-character hex string)","type":"string"}},"required":["target_hash","requested_by"],"type":"object"},"name":"foodblock_tombstone","title":"Tombstone FoodBlock"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"refs":{"additionalProperties":{},"default":{},"description":"Block refs to validate","type":"object"},"state":{"additionalProperties":{},"default":{},"description":"Block state to validate","type":"object"},"type":{"description":"Block type to validate","type":"string"}},"required":["type"],"type":"object"},"name":"foodblock_validate","title":"Validate FoodBlock"},{"description":"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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"blocks":{"description":"Array of blocks to create, each with type, state, refs","items":{"additionalProperties":false,"properties":{"refs":{"additionalProperties":{},"default":{},"type":"object"},"state":{"additionalProperties":{},"default":{},"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"},"type":"array"}},"required":["blocks"],"type":"object"},"name":"foodblock_batch","title":"Batch Create FoodBlocks"},{"description":"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'.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"text":{"description":"Any food-related natural language text","type":"string"}},"required":["text"],"type":"object"},"name":"foodblock_fb","title":"Natural Language FoodBlock"}]}}}
