blackboard_set
Publish a belief to a shared blackboard. The stored belief includes timestamp and provenance, enabling multi-agent collaboration with traceable shared knowledge.
Instructions
Publish a belief to the shared blackboard.
Returns the stored belief as a dict (with timestamp + provenance).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| value | Yes | ||
| source | No | mcp-client | |
| confidence | No | ||
| tags | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The @mcp.tool() decorated function 'blackboard_set' that handles the 'blackboard_set' tool. It accepts key, value, source, confidence, and tags, then upserts a Belief via the Blackboard instance and returns the stored belief as a dict.
@mcp.tool() def blackboard_set( key: str, value: Any, source: str = "mcp-client", confidence: float = 0.7, tags: list[str] | None = None, ) -> dict[str, Any]: """Publish a belief to the shared blackboard. Returns the stored belief as a dict (with timestamp + provenance). """ b = _BLACKBOARD.upsert( key=key, value=value, source=source, confidence=confidence, tags=tags, ) logger.info("blackboard.set key=%s source=%s", key, source) return b.to_dict() - src/mcp_research_collective/mcp_server.py:33-33 (registration)The @mcp.tool() decorator registers 'blackboard_set' as a FastMCP tool on line 33.
@mcp.tool() - The Blackboard.upsert() method, called by blackboard_set, creates a new Belief dataclass instance and stores it keyed by key in the thread-safe _store dict.
def upsert( self, key: str, value: Any, *, source: str, confidence: float = 0.7, ttl: Optional[float] = None, tags: Optional[list[str]] = None, provenance: Optional[dict[str, Any]] = None, ) -> Belief: with self._lock: b = Belief( key=key, value=value, source=source, confidence=confidence, ttl=ttl, tags=list(tags) if tags else [], provenance=dict(provenance) if provenance else {}, ) self._store[key] = b return b - The Belief dataclass used to represent a blackboard entry, with fields: key, value, source, confidence, ts, ttl, tags, provenance. The to_dict() method serializes it to a dict.
@dataclass class Belief: key: str value: Any source: str confidence: float = 0.7 ts: float = field(default_factory=time.time) ttl: Optional[float] = None tags: list[str] = field(default_factory=list) provenance: dict[str, Any] = field(default_factory=dict) def expired(self) -> bool: return self.ttl is not None and (time.time() - self.ts) > self.ttl def to_dict(self) -> dict[str, Any]: return self.__dict__.copy()