# Custom Attribute Functions

{% hint style="warning" %}

## Project Toolchain Usage

This feature makes use of these Project Toolchain APIs: **Middleware**, **Extensions**. Because of this usage, it defines the following modules:

### customAttributeFunctions

This module defines the following middleware and extensions identifiers that can be imported via Project Toolchain, along with their descriptions:

* **attributeFunctions** - Remove empty OR blocks from queries.
  {% endhint %}

To enable this optional feature, add the `customAttributeFunctions` element to your [optionalFeatures](https://prisma-util.gitbook.io/stable/api-documentation/configuration-reference/optional-features) array, then use the generated middleware or extension inside of your code.

## Feature Effect

Whenever you attempt a create operation on a model, all fields that have a default function defined in the [defaultFunctions](https://prisma-util.gitbook.io/stable/api-documentation/configuration-reference/default-functions) configuration property will have their value set to the result of those functions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prisma-util.gitbook.io/stable/optional-features/schema-improvements/custom-attribute-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
