Tools¶
Terrarium tools are OpenAI-style function schemas exposed to agents during a simulation. Planning phases use blackboard communication tools, while execution phases add environment-specific action tools.
Built-In Tool Surfaces¶
Scope |
Class or Module |
Tool names |
|---|---|---|
Blackboard planning |
|
|
Meeting scheduling |
|
|
Personal assistant |
|
|
Smart grid |
|
|
Hospital |
|
|
Jira ticket |
|
|
External MCP servers |
|
Discovered from configured MCP servers |
Discovery and Registry¶
- class terrarium.tools.discovery.ToolsetDiscovery[source]¶
Bases:
object- get_blackboard_tool_names(environment_name='', retrieval_enabled=False)[source]¶
Get the set of tool names that this blackboard manager supports.
- get_env_tool_names(environment_name)[source]¶
Get the set of tool names that this environment supports.
- get_tools_for_blackboard(phase, environment_name='', retrieval_enabled=False)[source]¶
Get blackboard specific tools for the given phase. This is different from Environment tools.
- get_tools_for_environment(environment_name, phase)[source]¶
Get the toolset for a specific environment.
vLLM Tool Prompt Helpers¶
Utilities for injecting tool-calling instructions into prompts. Used only for vLLM provider.
- terrarium.tools.prompts.build_vllm_tool_instructions(full_config, *, execution_tool_lines, system_note=None, planning_header='Planning phase tools (coordination only):', execution_header='Execution phase tools:', planning_tool_lines=None)[source]¶
Return formatted tool-instruction blocks (planning/execution/system).
Environment Tool Classes¶
- class terrarium.environments.dcops.meeting_scheduling.meeting_scheduling_tools.MeetingSchedulingTools(blackboard_manager, environment=None)[source]¶
Bases:
objectCoLLAB v2 MeetingScheduling tools.
The execution action is attend_meeting, which sets an agent’s attendance interval for a specific meeting they participate in.
- class terrarium.environments.dcops.personal_assistant.personal_assistant_tools.PersonalAssistantTools(blackboard_manager, environment=None)[source]¶
Bases:
object- execute_action(agent_name, action, log_to_blackboards=True, phase=None, iteration=None)[source]¶
Execute an agent action (only choose_outfit supported).
- Parameters:
agent_name (str) – Name of the agent performing the action
action (Dict[str, Any]) – Dictionary containing action type and parameters
log_to_blackboards (bool) – Whether to log the action to blackboards (default: True)
phase (str | None) – Current simulation phase (planning/execution)
iteration (int | None) – Current iteration number
directly. (Uses bound environment state)
- Returns:
Dictionary with execution result, status, and state updates
- Return type:
- handle_tool_call(tool_name, agent_name, arguments, phase=None, iteration=None)[source]¶
Handle tool calls by routing to execute_action.
- Parameters:
- Returns:
Dictionary with tool execution result.
- Return type:
- class terrarium.environments.dcops.smart_grid.smartgrid_tools.SmartGridTools(blackboard_manager, environment=None)[source]¶
Bases:
object
- class terrarium.environments.dcops.hospital.hospital_tools.HospitalTools(blackboard_manager, environment=None)[source]¶
Bases:
objectHospital Tools: Supports Provisioner Logic and expanded Resource types.
External MCP Tools¶
- class terrarium.llm.clients.external_mcp.ExternalMCPServerConfig(name: 'str', transport: 'Any', tool_prefix: 'str' = '', include_tools: 'frozenset[str]' = frozenset(), exclude_tools: 'frozenset[str]' = frozenset(), timeout_seconds: 'Optional[float]' = None, auth: 'Optional[str]' = None)[source]¶
Bases:
object- Parameters:
- class terrarium.llm.clients.external_mcp.ExternalMCPToolRegistry(servers)[source]¶
Bases:
objectLazy external MCP tool discovery/execution registry.
Converts discovered MCP tools into OpenAI-style function schemas so the existing provider clients can expose them directly to models.
- Parameters:
servers (Sequence[ExternalMCPServerConfig])