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

# getRule

> **getRule**(`config`, `rulesEngineRulesContract`, `policyId`, `ruleId`): `Promise`\<[`Maybe`](../../types/type-aliases/Maybe)\<[`RuleStruct`](../../types/type-aliases/RuleStruct)>>

Retrieves a specific rule from the Rules Engine.

## Parameters

| Parameter                          | Type                                  | Description                                                         |
| ---------------------------------- | ------------------------------------- | ------------------------------------------------------------------- |
| `config`                           | `Config`                              | -                                                                   |
| `rulesEngineRulesContract`         | `object`                              | The contract instance for interacting with the Rules Engine Policy. |
| `rulesEngineRulesContract.abi`     | (`object` \| `object` \| `object`)\[] | -                                                                   |
| `rulesEngineRulesContract.address` | \`0x\$\{string}\`                     | -                                                                   |
| `policyId`                         | `number`                              | The ID of the policy containing the rule.                           |
| `ruleId`                           | `number`                              | The ID of the rule to retrieve.                                     |

## Returns

`Promise`\<[`Maybe`](../../types/type-aliases/Maybe)\<[`RuleStruct`](../../types/type-aliases/RuleStruct)>>

The retrieved rule as a `RuleStruct`, or `null` if retrieval fails.

## Defined in

[src/modules/rules.ts:523](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/modules/rules.ts#L523)
