blackboard_get
Retrieve a belief by key from the shared blackboard. Returns None if the key is missing or expired.
Instructions
Read a single belief by key. Returns None if absent or expired.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The MCP tool handler for blackboard_get — reads a belief by key from the blackboard and returns it as a dict, or None if absent/expired.
def blackboard_get(key: str) -> dict[str, Any] | None: """Read a single belief by key. Returns None if absent or expired.""" b = _BLACKBOARD.read(key) return None if b is None else b.to_dict() - The Belief dataclass that defines the schema for blackboard entries, including key, value, source, confidence, ttl, tags, and provenance.
@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() - The Blackboard.read() helper method called by blackboard_get — retrieves a belief by key, returns None if missing or expired.
def read(self, key: str) -> Optional[Belief]: with self._lock: b = self._store.get(key) if b is None: return None if b.expired(): del self._store[key] return None return b - src/mcp_research_collective/mcp_server.py:30-30 (registration)The FastMCP server instance that registers the tool via the @mcp.tool() decorator on line 56.
mcp = FastMCP("mcp-research-collective")