# Golem Define Tool Scala

> Defines and implements a typed Golem tool in Scala. Use when creating a tool provider or command schema.

- Skill: `golemcloud/golem-define-tool-scala` (Agent Skill)
- Install (CLI): `npx get-skill add golemcloud/golem-define-tool-scala`
- Raw SKILL.md: https://api.skillmd.com/api/skills/golemcloud/golem-define-tool-scala/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: golemcloud (https://skillmd.com/u/golemcloud)
- Updated: 2026-11-12
- Page: https://skillmd.com/skills/golemcloud/golem-define-tool-scala

---


# Define a Golem tool in Scala

Annotate the definition trait and implementation class. The build plugin generates registration,
metadata, and typed client sources:

```scala
import golem.runtime.annotations.{toolDefinition, toolImplementation}

@toolDefinition(version = "1.0.0")
trait Echo {
  def echo(value: String): String
}

@toolImplementation()
final class EchoImpl extends Echo {
  override def echo(value: String): String = value
}
```

Use `@arg`, `@command`, `@constraint`, `@result`, and `@annotations` when the command-line surface
needs explicit metadata. Custom values require `zio.blocks.schema.Schema`. Keep
`scalacOptions += "-experimental"` enabled for macro annotations and never edit generated client
or registration sources.

