> ## Documentation Index
> Fetch the complete documentation index at: https://gofastmcp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# resources

# `fastmcp.server.providers.local_provider.decorators.resources`

Resource decorator mixin for LocalProvider.

This module provides the ResourceDecoratorMixin class that adds resource
and template registration functionality to LocalProvider.

## Classes

### `ResourceDecoratorMixin` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/local\_provider/decorators/resources.py#L32](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/local_provider/decorators/resources.py#L32)</sup>

Mixin class providing resource decorator functionality for LocalProvider.

This mixin contains all methods related to:

* Resource registration via add\_resource()
* Resource template registration via add\_template()
* Resource decorator (@provider.resource)

**Methods:**

#### `add_resource` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/local\_provider/decorators/resources.py#L41](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/local_provider/decorators/resources.py#L41)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
add_resource(self: LocalProvider, resource: Resource | ResourceTemplate | Callable[..., Any]) -> Resource | ResourceTemplate
```

Add a resource to this provider's storage.

Accepts either a Resource/ResourceTemplate object or a decorated function with **fastmcp** metadata.

#### `add_template` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/local\_provider/decorators/resources.py#L105](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/local_provider/decorators/resources.py#L105)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
add_template(self: LocalProvider, template: ResourceTemplate) -> ResourceTemplate
```

Add a resource template to this provider's storage.

#### `resource` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/local\_provider/decorators/resources.py#L111](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/local_provider/decorators/resources.py#L111)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
resource(self: LocalProvider, uri: str) -> Callable[[F], F]
```

Decorator to register a function as a resource.

If the URI contains parameters (e.g. "resource://{param}") or the function
has parameters, it will be registered as a template resource.

**Args:**

* `uri`: URI for the resource (e.g. "resource://my-resource" or "resource://{param}")
* `name`: Optional name for the resource
* `title`: Optional title for the resource
* `description`: Optional description of the resource
* `icons`: Optional icons for the resource
* `mime_type`: Optional MIME type for the resource
* `tags`: Optional set of tags for categorizing the resource
* `enabled`: Whether the resource is enabled (default True). If False, adds to blocklist.
* `annotations`: Optional annotations about the resource's behavior
* `meta`: Optional meta information about the resource
* `auth`: Optional authorization checks for the resource

**Returns:**

* A decorator function.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.