DiceMcpTools

class DiceMcpTools(repository: PropositionRepository, minConfidence: Double = DEFAULT_MIN_CONFIDENCE, defaultLimit: Int = DEFAULT_LIMIT)

Simplified DICE tools for external MCP clients.

In-process com.embabel.dice.agent.Memory and com.embabel.dice.agent.DiscoveryTools bake ContextId in at construction, so an agent cannot name another tenant. MCP clients are stateless and may serve many sessions, so every tool takes an explicit contextId. That is a caller-supplied scope, not a credential: it keeps one call from crossing contexts, and authorization is the host MCP server's job. dice_recall and dice_list start from com.embabel.dice.proposition.PropositionQuery.forContextId; dice_get collapses a missing id and a foreign id into one answer so the tool cannot confirm that an id it does not own exists.

Rod's #5: expose tools with simplified parameters. This class is that surface: dice_recall, dice_list, dice_store, dice_get. Extraction and discovery stay on the existing in-process asTools() path.

Export through embabel-agent's com.embabel.agent.mcpserver.McpToolExport, or add dice-mcp-autoconfigure with embabel.dice.mcp.enabled=true.

Parameters

repository

proposition store (required)

minConfidence

minimum effective confidence for recall/list

defaultLimit

default result cap for recall/list

Constructors

Link copied to clipboard
constructor(repository: PropositionRepository, minConfidence: Double = DEFAULT_MIN_CONFIDENCE, defaultLimit: Int = DEFAULT_LIMIT)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun getProposition(contextId: String, propositionId: String): String

Fetch a single proposition by id within a context.

Link copied to clipboard
fun listMemories(contextId: String, limit: Int = defaultLimit): String

List active propositions for a context, ordered by effective confidence.

Link copied to clipboard
fun recall(contextId: String, query: String? = null, limit: Int = defaultLimit): String

Hybrid semantic + keyword recall over stored propositions in a context.

Link copied to clipboard
fun storeMemory(contextId: String, text: String, confidence: Double = 0.8): String

Store a proposition directly without running the extraction pipeline.