Zod object schema for parameter validation (default: z.AnyZodObject)
OptionalcompleteOptional callback for argument autocompletion.
When provided, enables clients to request autocompletion suggestions for URI template variables. The callback receives the variable name and current partial value, and returns matching suggestions.
The SDK automatically registers the completions capability when
any resource template provides a complete callback.
ReadonlydescriptionHuman-readable description shown to LLM
Optional ReadonlyinputZod object schema for parameter validation.
When provided, parameters extracted from the URI are validated
against this schema before being passed to read().
OptionallistOptional function to enumerate available resources.
When provided, this enables LLMs to discover what resources are available for this template. Useful for dynamic resource discovery.
Optional ReadonlymimeMIME type of the content (optional)
ReadonlynameUnique resource name for identification
Content provider function with template parameters.
Optional ReadonlyrequiredScopes required to read this resource template (RBAC).
When set, the framework checks authInfo.scopes BEFORE
the read handler executes. All listed scopes must be present (AND logic).
If the check fails, a 403 Forbidden error is returned.
Omit or set to undefined for resources accessible to any authenticated user.
ReadonlyuriURI template pattern using RFC 6570 (e.g., 'myapp://logs/{logId}')
Resource template definition - for dynamic URIs (RFC 6570).
Templates allow LLMs to access content with variable parameters. Use Zod schemas for type-safe parameter handling.
Example