# Custom Toolsets in Go or Python

**URL:** <https://community.solace.com/t/custom-toolsets-in-go-or-python/4949>\
**Category:** Solace Agent Mesh\
**Created:** [November 10, 2026, 2:10pm UTC](https://community.solace.com/t/custom-toolsets-in-go-or-python/4949 "2026-11-10T14:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamimi](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/tamimi/32/2190_2.png) [@Tamimi](https://community.solace.com/u/Tamimi)\
**Post date:** [November 10, 2026, 2:10pm UTC](https://community.solace.com/t/custom-toolsets-in-go-or-python/4949/1 "2026-11-10T14:10:09Z")

</div>

The built-in tools cover a lot, but sooner or later your agent needs to call your own pricing engine, internal API, or some deterministic algorithm. That is what custom toolsets are for, and you can write them in Go or Python.

Start with the scaffold:

```bash
sam toolset init freight-rates --lang go
# or
sam toolset init weather --lang python

```

You get a `kind: toolset` YAML file plus a `src/` folder with the code, a `manifest.yaml` and a build script. The Go skeleton vendors the SDK, so it builds without network access.

**Go**

Each tool is a function with a typed params struct. The `desc` tags become the parameter descriptions the agent sees:

```go
type QuoteParams struct {
    Origin string `json:"origin" desc:"Origin city or port"`
    Destination string `json:"destination" desc:"Destination city or port"`
    Mode string `json:"mode" desc:"air, ocean, road, or rail"`
    WeightKg float64 `json:"weight_kg" desc:"Gross weight in kilograms"`
}

func main() {
    sdk.Run(
        sdk.NewTool("quote_freight_rate", "Quotes an all-in lane rate.", quoteFreightRate),
        sdk.NewTool("get_fuel_surcharge", "Returns the weekly fuel surcharge.", getFuelSurcharge),
    )
}

```

**Python**

Same idea, with type hints and a docstring:

```python
from sam_tool_sdk import SandboxToolContextFacade, ToolResult, tool_cli

def get_forecast(city: str, ctx: SandboxToolContextFacade) -> ToolResult:
    """Return the current forecast for a city.

    Args:
        city: City to look up the forecast for.
    """
    ctx.send_status(f"looking up forecast for {city}")
    return ToolResult.ok({"forecast": f"Sunny in {city}, 22 C."})

cli = tool_cli(get_forecast)

```

Before uploading anything, `sam toolset validate <name>` runs the same schema discovery the runtime does. That catches a bad import or schema in seconds. Then list the toolset in your manifest and `sam config apply` builds and uploads it. Against the desktop app you can use the reserved `desktop` target, so there’s no URL to hardcode.

 ![Custom toolsets next to the built-in ones](https://canada1.discourse-cdn.com/solace/original/2X/e/e8fb8846402ccd8f1261319e0049dcf1d8639ca9.jpeg)

Once it’s uploaded, the tools show up by name, ready to attach to any agent:

 ![The freight-rates toolset and its two tools](https://canada1.discourse-cdn.com/solace/original/2X/6/64742b617e1aa913f2474ce274a803a212ebb85a.jpeg)

My take: pick Go when you want a single binary with no dependencies, and Python when the library you need only exists there. Python toolsets need a desktop release with Python 3.10 or later.

Docs:

- [Creating Toolsets](https://docs.solace.com/Agent-Mesh/Framework/building/toolsets.htm)
- [Toolsets concepts](https://docs.solace.com/Agent-Mesh/Framework/concepts/toolsets.htm)

[Download the Solace Agent Mesh desktop app](https://solace.com/products/agent-mesh/) and scaffold your first toolset in a couple of minutes.

Go or Python for your tools? Tell me what you’d build first and I’ll help you get it running in the replies.
