The four important fields
input
input is parsed tool input.
Use it for:
- validated Zod input
- defaulted values
- coerced values
- plain JSON Schema object input
ctx
ctx is shared mutable per-request state.
Use it for:
- auth metadata
- tenant or organization data
- timing values
- request-scoped values computed by middleware or hooks
request
request is read-only transport metadata.
Use it for:
headersipmethodurlrawsessionIdtransport
tool
tool is the resolved tool name. This is especially useful in global hooks and shared middleware.
Mental model
input= validated business inputctx= mutable request staterequest= transport metadatatool= current tool identity