decidemcp

package
v0.52.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package decidemcp provides an in-process MCP server exposing a `decide` tool: the agent puts typed questions about a JSON state to a decision model and gets probabilities back. It follows the same pattern as internal/scriptmcp: no subprocess, the server runs in-process via mcp.NewInMemoryTransports.

Index

Constants

View Source
const ToolName = "decide"

ToolName is the advertised name of the decide tool.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Decider is a fixed decider, used when Resolve is nil. With neither set,
	// no tool is registered.
	Decider *llm.Decider
	// Resolve returns the decider at each call, so one added or changed at
	// runtime is used without reconnecting. A nil result is a tool error.
	Resolve func() *llm.Decider
	// DeciderName names the decider in the tool description. Defaults to
	// Decider's name.
	DeciderName string
	// AgentName is the agent the decider spend is billed to.
	AgentName string
	// Now stamps the billing session key. Defaults to time.Now.
	Now func() time.Time

	Logger *slog.Logger
}

Deps holds the runtime dependencies injected into the Decide MCP server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the in-process Decide MCP server for a single agent.

func New

func New(deps Deps) *Server

New constructs and wires the Decide MCP server. The decide tool is registered immediately (when a decider or resolver is set); the server does not begin serving until Connect is called.

func (*Server) Connect

func (s *Server) Connect(ctx context.Context) (*mcp.ClientSession, error)

Connect starts the in-process server goroutine and returns a *mcp.ClientSession ready to be passed to tool.Manager.RegisterSession.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL