Keep the tool definition independent
What I built
A standalone tool() combines Zod schemas with a typed handler. createServer() composes those definitions into a server, with input and declared output parsing that honors schema defaults and transforms.
Why it matters
The same tool can be reused in different server compositions. Type inference supports authoring, while runtime validation checks the values crossing the tool boundary.