Use a resource when the client should read data instead of asking the server to perform an action. Resources are a better fit than tools when the thing you are exposing has a stable identity and should be addressed by URI. This page focuses on when resources fit and how to model them well. For the exact resource contract, use Resource Definition.Documentation Index
Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
Use this file to discover all available pages before exploring further.
When a resource is the right fit
Use a resource when:- the client needs readable data
- the data has a stable URI
- subscriptions or change notifications make sense
Static and template resources
Redop supports two resource styles:- static resources such as
config://server - template resources such as
users://{id}/profile
Static resource example
Model the URI carefully
Resources have two identifiers:- the URI, which clients use to address the resource
- the
name, which is the human-readable display label
config://servernotes://latestusers://{id}/profile
Description and MIME type
Usedescription to explain what the resource represents.
Use mimeType to describe the content clients should expect back.
Template resource example
Redop infers template params from the URI you register. In a resource likeusers://{id}/profile, the handler receives params.id as a string.
What resource handlers return
Return one of these shapes:{ type: "text", text, mimeType? }for UTF-8 content{ type: "blob", blob, mimeType? }for base64-encoded binary content
Local hooks and middleware
Resources support per-resource execution logic:beforeruns before middleware and the handlerafterruns after a successful result and may replace itafterResponseruns after the response is written and cannot replace itmiddlewarewraps only that resource
afterResponse for non-critical follow-up work such as logging, metrics, or audit events.
Use subscriptions when the data changes
If clients should be notified when a resource changes:- set
subscribe: trueon the resource - call
notifyResourceChanged(uri)when the underlying data changes