A tool to allow an agent to send requests to a Solace broker and wait for a reply. It can also be configured to send 'fire-and-forget' events to the broker
Project description
Event Mesh Tool Plugin
This plugin for Solace Agent Mesh (SAM) provides a powerful and dynamic tool for sending messages into a Solace event mesh and receiving a response. It acts as a generic bridge, allowing a Large Language Model (LLM) to interact with any microservice or application connected to the event mesh.
Unlike a standalone agent, this is a tool that can be added to any existing or new agent, allowing you to create multi-faceted agents that can communicate with multiple backend services.
About Solace Agent Mesh
Solace Agent Mesh (SAM) is an open-source framework for building event-driven, multi-agent AI systems where specialized agents collaborate on complex tasks. It provides a standardized way for agents to communicate, share data, and integrate with external systems while keeping components loosely coupled and production-ready.
SAM helps you:
- Build event-driven multi-agent systems on Solace Event Mesh
- Connect agents, tools, gateways, and services through a common runtime
- Extend projects with installable plugins such as
sam-event-mesh-tool
Learn more in the Solace Agent Mesh documentation and the main project repository.
Key Features
- Dynamic Tool Creation: Define custom tools directly in your agent's YAML configuration. Each tool instance is completely independent.
- Dedicated Sessions: Each tool instance creates its own dedicated request-response session, allowing for fine-grained configuration and connection to different brokers if needed.
- Request-Response Interaction: Sends a request message and waits for a correlated response on a dynamically managed reply topic.
- Structured Payloads: Automatically construct complex JSON payloads from tool parameters using dot notation.
- Dynamic Topics: Use tool parameters to construct the request topic dynamically.
- Synchronous & Asynchronous Modes: Choose between blocking calls that wait for a response, or non-blocking "fire-and-forget" calls.
Installation
To add this tool to a new or existing agent, you must first install it and then manually add the tool configuration to your agent's YAML file:
sam plugin install sam-event-mesh-tool
Configuration
To use the tool, add one or more tool_type: python blocks to the tools list in your agent's app_config. Each block will create a new, independent tool instance.
Example Tool Configuration
Here is an example of configuring a tool to get weather information.
# In your agent's app_config:
tools:
- tool_type: python
component_module: "sam_event_mesh_tool.tools"
class_name: "EventMeshTool"
tool_config:
# --- Connection & Session Configuration ---
# This block configures the dedicated event mesh session for this tool.
event_mesh_config:
broker_config: *broker_connection # Anchor to shared broker settings
request_expiry_ms: 10000 # Timeout for requests in milliseconds
payload_format: "json" # Format of the outgoing request payload
# --- Tool Definition for LLM ---
tool_name: "GetWeather"
description: "Gets the current weather for a specific city."
# --- Tool Parameters ---
parameters:
- name: "city"
type: "string"
required: true
description: "The city to get the weather for."
payload_path: "location.city" # Maps to payload: {"location": {"city": "..."}}
- name: "unit"
type: "string"
required: false
default: "celsius"
payload_path: "unit" # Maps to payload: {"unit": "..."}
- name: "request_id" # Used in topic, but not in payload
type: "string"
required: true
description: "A unique identifier for this request."
- name: "user_id" # Sourced from context, not from LLM
context_expression: "user_id" # Fetches from tool_context.state.a2a_context.user_id
payload_path: "meta.requesting_user_id"
# --- Per-Request Configuration ---
topic: "acme/weather/request/{{ request_id }}"
wait_for_response: true
tool_config Details
event_mesh_config: Configures the dedicated session for this tool. This dictionary is passed directly to thecreate_request_response_sessionfunction. Key options include:broker_config: (Required) A block containing the connection details for the broker (broker_url,broker_username,broker_password,broker_vpn).request_expiry_ms: (Optional) Timeout in milliseconds for a request to receive a response. Defaults to60000.payload_format: (Optional) The format for the payload (e.g.,json,yaml,text). This controls both the encoding of the outgoing request and the decoding of the incoming response. Defaults tojson.payload_encoding: (Optional) The encoding for the payload (e.g.,utf-8,base64). Defaults toutf-8.response_topic_prefix: (Optional) A custom prefix for the dynamically generated reply topics. Defaults toreply.response_queue_prefix: (Optional) A custom prefix for the dynamically generated reply queues. Defaults toreply-queue.response_topic_insertion_expression: (Optional) An expression to insert the reply topic directly into the request message's payload (e.g.,input.payload:reply_to).user_properties_reply_topic_key: (Optional) The key used to store the reply topic in the request message's user properties.user_properties_reply_metadata_key: (Optional) The key used to store the reply metadata in the request message's user properties.- For a full list of all available options, refer to the "Broker Request-Response Guide" in the Solace AI Connector documentation.
tool_name: The function name the LLM will use to call the tool.description: A clear description for the LLM explaining what the tool does.parameters: A list of parameters the tool accepts.name: The parameter name.type: The data type. Must be one ofstring,integer,number, orboolean.required:trueorfalse.description: (Optional) A description of the parameter for the LLM.default: (Optional) A default value if the parameter is not provided.payload_path: (Optional) The path to map the parameter's value into the outgoing JSON payload. It supports dot notation for nested objects (e.g.,customer.address.city). If omitted, the parameter is not included in the payload but can still be used in the topic template.context_expression: (Optional) A dot-notation path to source the parameter's value from the agent's execution context (a2a_context). If this is specified, the parameter is considered internal and will not be exposed to the LLM. This is useful for automatically injecting data like user IDs, session details, or user profile information.
topic: The topic string for the outgoing request message. You can insert parameter values into the topic using{{ parameter_name }}.wait_for_response: (Optional)true(default) for synchronous requests that wait for a reply. Set tofalsefor asynchronous "fire-and-forget" requests.
Advanced Usage: Multiple Tools
You can configure multiple tools in the same agent, each with its own session and configuration. This is useful for interacting with different backend systems from a single agent.
# In your agent's app_config:
tools:
# --- Tool 1: Get Weather ---
- tool_type: python
component_module: "sam_event_mesh_tool.tools"
class_name: "EventMeshTool"
tool_config:
event_mesh_config:
broker_config: *weather_broker_connection
tool_name: "GetWeather"
# ... rest of weather tool config ...
# --- Tool 2: Update CRM ---
- tool_type: python
component_module: "sam_event_mesh_tool.tools"
class_name: "EventMeshTool"
tool_config:
event_mesh_config:
broker_config: *crm_broker_connection # Potentially a different broker
tool_name: "UpdateCrmRecord"
description: "Updates a customer record in the CRM."
wait_for_response: false # Fire-and-forget
# ... rest of CRM tool config ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sam_event_mesh_tool-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sam_event_mesh_tool-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5730e2dc0ff309995b6e4e98c9480b18ff178f7ca9542f5b5c2c4ff328629d
|
|
| MD5 |
052101b3aead7443eb30ee79eba568eb
|
|
| BLAKE2b-256 |
1a0a0150cf2e045137a226fb24b7d872f19bd9d0e35de73edf62f95f3fe10a29
|
Provenance
The following attestation bundles were made for sam_event_mesh_tool-0.1.1-py3-none-any.whl:
Publisher:
release.yaml on SolaceLabs/solace-agent-mesh-core-plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sam_event_mesh_tool-0.1.1-py3-none-any.whl -
Subject digest:
2c5730e2dc0ff309995b6e4e98c9480b18ff178f7ca9542f5b5c2c4ff328629d - Sigstore transparency entry: 1219754186
- Sigstore integration time:
-
Permalink:
SolaceLabs/solace-agent-mesh-core-plugins@e36d0c077901360f336c1740bdff192432fb8603 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SolaceLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@e36d0c077901360f336c1740bdff192432fb8603 -
Trigger Event:
workflow_dispatch
-
Statement type: